-
Notifications
You must be signed in to change notification settings - Fork 92
feat: add vault image generation scripts and automation #342
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Add comprehensive vault image generation system including: - Token image downloading from external sources - LP token fetching from blockchain - Image merging for multi-asset vaults - Metadata updates with generated images - Cloudinary upload integration - Environment configuration example
…red backgrounds - Change image output format from PNG to JPG in all merge functions - Set background color to match border/brand color instead of white - Update file extension from .png to .jpg in local save path - Update Kodiak brand color to #A1623D This ensures generated vault images have consistent branding with the border color applied throughout the entire image.
…ed styling - Add BrandColor type to support both solid colors and linear gradients - Update protocol brand colors with new values and gradient support for Infrared Finance - Refactor mergeImages to properly handle gradients using SVG definitions - Improve circular masking and background composition for JPEG output - Add owner and action fields to Vault type - Simplify brand color logic to only use owner field (not protocol fallback)
- Import BrandColor type from _constants - Add proper type annotation to brandColor variable - Update console log to display 'gradient' for gradient objects instead of stringifying
scripts/generateVaultImages.ts
Outdated
| const uploadResult = await uploadVaultImage(mergedImage, vaultAddress); | ||
|
|
||
| if (!uploadResult.success) { | ||
| console.error( | ||
| chalk.red(` Error: Upload failed - ${uploadResult.error}`), | ||
| ); | ||
| return false; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be very hesitant with this as it could potentially overwrite existing images in place if the name is the same. We sort of avoid this to start because there was a possibility that direct uploads to Cloudinary could have potential issues with changing protocols and validators images without even the PR getting merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we could create a new folder and upload them there and not override existing uploads (also note this would only affect vaults with LP based underlying tokens, not validator images or non-lp vaults), the script aims to not only create images for new vaults but also old vaults with redundant images like the ones below:
here's an example of a generated image from the script, the border and divider would be the color of the owner of the protocol, with this on all LP vaults it'll be more clean and consistent across the hub ui:

Add BakderDAO brand color (#CE7E02) to PROTOCOL_BRAND_COLORS constant. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
…age generator Remove --all flag functionality and Cloudinary upload integration to simplify the vault image generation script. The script now only supports generating images for a single vault at a time and saves them locally. Changes: - Remove Cloudinary import and upload functionality - Remove --all and --force flags - Simplify to single vault processing only - Remove batch processing loop and summary statistics - Update usage instructions and validation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Add comprehensive vault image generation system including:
Test dry run: