Get token metadata and supply
Before you render a token amount you need its decimals and symbol. The metadata endpoint returns name, symbol, decimals and supply in a single C1 read that is cheap enough to cache aggressively.
- A live API key
- The token id you want to describe
1Call the metadata endpoint
Request metadata by token id. This is a C1 read — one of the cheapest calls on the surface — so treat it as reference data.
curl https://api.1st-node.com/v1/market/token/eth/metadata \ -H "Authorization: Bearer sk_live_..."
2Read name, symbol, decimals and supply
Use decimals to format raw on-chain balances into human amounts, and symbol/name to label them. Supply figures give you the denominator for market-cap math.
> { "name": "Ether", "symbol": "ETH",
> "decimals": 18, "supply": "120280000" }3Cache it — metadata rarely changes
Name, symbol and decimals are effectively immutable and supply moves slowly, so cache the response for long TTLs instead of fetching per request.
常见问题
How cheap is a metadata read?
It is a C1 read, the lowest tier on the surface. Combined with caching it costs almost nothing to keep token reference data on hand.
Why do I need decimals?
On-chain balances are integers in the token's smallest unit. Decimals let you convert them to human-readable amounts without guessing.
继续阅读
充值、拿密钥、上线。
自助开通。支持加密货币或银行卡。按额度计费——重型原语更贵,简单调用很便宜。
获取 API 密钥