mirror of
https://github.com/hanzo-docs/docs.git
synced 2026-10-26 23:49:51 +00:00
Removed standalone apps (content absorbed into main docs): - apps/explorer-docs/ - apps/hsm-docs/ - apps/indexer-docs/ Added new standalone apps: - apps/bootnode-docs/ — Blockchain infrastructure - apps/dns-docs/ — DNS/domain management Expanded main docs (apps/docs/): - New Infrastructure section: tasks, functions, pubsub, o11y, zt - New Web3 section: services/web3/ (7 pages) - Services meta.json: 40+ services in 7 categories S3 domain consolidation: - hanzo.space → s3.hanzo.ai - s3.hanzo.space → s3-api.hanzo.ai Updated footer with s3.hanzo.ai link
71 lines
1.6 KiB
Plaintext
71 lines
1.6 KiB
Plaintext
---
|
|
title: Token API
|
|
description: Indexed ERC-20 token balances, metadata, prices, and transfer history across all supported chains.
|
|
---
|
|
|
|
The Token API provides indexed access to ERC-20 token data without direct RPC calls. Balances, metadata, and transfer history are pre-indexed for instant queries.
|
|
|
|
## Get Token Balances
|
|
|
|
```
|
|
GET /v1/tokens/{chain}/balances/{address}
|
|
```
|
|
|
|
```bash
|
|
curl https://api.bootno.de/v1/tokens/ethereum/balances/0x742d35Cc6634C0532925a3b844Bc9e7595f2bD18 \
|
|
-H "X-API-Key: YOUR_API_KEY"
|
|
```
|
|
|
|
```json title="Response"
|
|
{
|
|
"address": "0x742d35Cc6634C0532925a3b844Bc9e7595f2bD18",
|
|
"chain": "ethereum",
|
|
"tokens": [
|
|
{
|
|
"contract": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
|
"symbol": "USDC",
|
|
"name": "USD Coin",
|
|
"decimals": 6,
|
|
"balance": "1500000000",
|
|
"balance_formatted": "1500.00",
|
|
"price_usd": 1.0,
|
|
"value_usd": 1500.0
|
|
}
|
|
],
|
|
"total_value_usd": 1500.0
|
|
}
|
|
```
|
|
|
|
## Get Token Metadata
|
|
|
|
```
|
|
GET /v1/tokens/{chain}/metadata/{contract_address}
|
|
```
|
|
|
|
Returns token name, symbol, decimals, total supply, and logo URI.
|
|
|
|
```python
|
|
metadata = await client.tokens.metadata(
|
|
chain="ethereum",
|
|
contract="0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
|
|
)
|
|
print(f"{metadata['symbol']}: {metadata['name']}")
|
|
```
|
|
|
|
## Transfer History
|
|
|
|
```
|
|
GET /v1/transfers/{chain}/address/{address}
|
|
```
|
|
|
|
Query parameters: `from_block`, `to_block`, `contract`, `limit`, `offset`.
|
|
|
|
```typescript
|
|
const transfers = await client.transfers.byAddress({
|
|
chain: 'ethereum',
|
|
address: '0x742d35Cc...',
|
|
fromBlock: 19000000,
|
|
limit: 50,
|
|
})
|
|
```
|