heavy-duty / znap

Performance-first Rust Framework to build APIs compatible with the Solana Actions Spec.
Apache License 2.0
54 stars 1 forks source link

Generate dynamic images for actions #52

Closed danmt closed 3 weeks ago

danmt commented 3 weeks ago

It would be great to have dynamic images in the Hats example so it generates a unique image for the action. The Hats example at the moment shows the hat, it would be nice if the image included things like the price. Also, in the future, we want to add categories (sport, team, etc) and show them in the image.

Source values:

Source image:

image

Generated image:

image

danmt commented 3 weeks ago

After looking through the spec, it turns out the image has to be uploaded somewhere as the action metadata expects the image to be a URL. This would break the idea of generating these images on-demand, instead, we're going to generate the images manually and associate them with each hat so we can wrap this up and focus on more important issues.

danmt commented 3 weeks ago

If you happen to make any progress on this @SergioRibera we can still use it to generate the images outside of the project and manually add them to the example.