-
Notifications
You must be signed in to change notification settings - Fork 3
Add token metadata to SVM Swaps #305
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
- Same format as EVM with tuple of `(mint, symbol, decimals)` - Add `price` and `price_inv`, `summary` of swap - Update OpenAPI schemas
🦋 Changeset detectedLatest commit: 6d26a2a The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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.
Pull request overview
This PR enhances the SVM Swaps API response to include token metadata (mint address, symbol, decimals), calculated price fields, and a human-readable swap summary. The changes align the SVM response format with the existing EVM token metadata structure.
Key changes:
- Token metadata now returns structured objects with
(mint, symbol, decimals)instead of just addresses - Added
price,price_inv, andsummaryfields to provide calculated swap metrics - Updated SQL query to perform batch lookups for token decimals and symbols
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/types/zod.ts | Updated schema to rename address to mint and add symbol field with nullable types |
| src/sql/swaps/svm.sql | Added token metadata lookups, price calculations, and summary formatting to swap queries |
| src/routes/v1/svm/swaps/svm.ts | Updated response schema and route handler to include new token metadata structure and fields |
| .changeset/fresh-lands-bet.md | Added changeset documenting the minor version update |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Convert `program_id` to string before using the SQL function
|
Needs to move to a |
(mint, symbol, decimals)priceandprice_inv,summaryof swapFixes #298