Draft
Conversation
Agent-Logs-Url: https://github.com/pinax-network/token-api/sessions/fa53f791-3fd3-42a9-847b-d1abb4c47bfb Co-authored-by: DenisCarriere <550895+DenisCarriere@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add /tokens/metadata endpoint to fetch token metadata
Add /tokens/metadata endpoint
Apr 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a lightweight
/tokens/metadataendpoint that returns only token metadata (name, symbol, decimals) — no supply, holder, or transfer counts — for bulk contract/mint lookups. Same query pattern as/tokens.Endpoints
GET /v1/evm/tokens/metadata?network=…&contract=…(repeatablecontractfor bulk)GET /v1/svm/tokens/metadata?network=…&mint=…(repeatablemintfor bulk)GET /v1/tvm/tokens/metadata?network=…&contract=…(repeatablecontractfor bulk)Changes
src/routes/tokens/{evm,svm,tvm}_metadata.{ts,sql}. EVM/TVM read directly frommetadata.metadata(no balances/transfers join); SVM joinsdb_metadata.metadataanddb_accounts.decimals_stateonly.src/routes/index.ts, withcacheControl()applied to/v1/*/tokens/metadata.ROUTE_DEFINITIONSinsrc/supported-routes.ts(EVM requiresbalances, SVM requiresbalances, TVM requirestransfers— matching the corresponding/tokensroute's network availability).src/routes/routes.sql.spec.tsasserting 200 + presence ofname/symbol/decimalsand absence ofcirculating_supply/holders/total_transfers.Response shape (EVM example)
{ "data": [{ "contract": "0xdac17f958d2ee523a2206206994597c13d831ec7", "name": "Tether USD", "symbol": "USDT", "decimals": 6, "network": "mainnet", "icon": { "web3icon": "usdt" } }] }Notes
nativeContractRedirectmiddleware on the metadata route — metadata lookups are valid for the zero-address as well.program_id(which would require a balances join) to keep the query truly metadata-only.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
networks-registry.thegraph.com/home/REDACTED/.bun/bin/bun bun index.ts(dns block)If you need me to access, download, or install something from one of these locations, you can either: