curl "https://api.metastreams.dev/v1/wallets/balances?wallets=7YttLkHDoNj9wyDur5pM1ejNaAvT9X4eqaYcHQqtj2G5&chains=solana" \
-H "Authorization: Bearer $API_KEY"
const url = new URL("https://api.metastreams.dev/v1/wallets/balances");
url.searchParams.set("wallets", "7YttLkHDoNj9wyDur5pM1ejNaAvT9X4eqaYcHQqtj2G5");
url.searchParams.set("chains", "solana");
const response = await fetch(url, {
headers: { Authorization: `Bearer ${process.env.API_KEY}` },
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const { balances } = await response.json();
{
"balances": [
{
"chain": "solana",
"wallet": "7YttLkHDoNj9wyDur5pM1ejNaAvT9X4eqaYcHQqtj2G5",
"asset": "SOL",
"balance": "41.208113",
"trigger": "trade",
"blockNumber": 371204118,
"signature": "4xQmVb8e2kT1nR7pZcW3sLdHfA9jEuY6gVnX1oB5iC0wQ2rT8yU3iO7pA1sD4fG6h",
"txIndex": 812,
"updatedAt": 1789632015120
}
]
}
{
"balances": []
}
REST
Wallet balances
Read the latest balance of each wallet and asset, across one or more chains.
GET
/
v1
/
wallets
/
balances
curl "https://api.metastreams.dev/v1/wallets/balances?wallets=7YttLkHDoNj9wyDur5pM1ejNaAvT9X4eqaYcHQqtj2G5&chains=solana" \
-H "Authorization: Bearer $API_KEY"
const url = new URL("https://api.metastreams.dev/v1/wallets/balances");
url.searchParams.set("wallets", "7YttLkHDoNj9wyDur5pM1ejNaAvT9X4eqaYcHQqtj2G5");
url.searchParams.set("chains", "solana");
const response = await fetch(url, {
headers: { Authorization: `Bearer ${process.env.API_KEY}` },
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const { balances } = await response.json();
{
"balances": [
{
"chain": "solana",
"wallet": "7YttLkHDoNj9wyDur5pM1ejNaAvT9X4eqaYcHQqtj2G5",
"asset": "SOL",
"balance": "41.208113",
"trigger": "trade",
"blockNumber": 371204118,
"signature": "4xQmVb8e2kT1nR7pZcW3sLdHfA9jEuY6gVnX1oB5iC0wQ2rT8yU3iO7pA1sD4fG6h",
"txIndex": 812,
"updatedAt": 1789632015120
}
]
}
{
"balances": []
}
The latest balance of each wallet you name, one row per chain, wallet and asset.
wallets takes 1 to 100 addresses, comma-separated. chains narrows the read to some chains. Leave it out to read every chain.
Response
balances lists one row per wallet and asset that has moved, ordered by chain, wallet, then asset. A wallet and asset with no observed balance has no row. A missing row is not a zero.
balance is the amount after the transaction that last moved it, in the asset’s own units. trigger names what moved it, such as trade or deposit. trigger and asset are open sets, so keep a value you do not recognize.
blockNumber and txIndex place the row in its chain. To merge this read with the wallet.balances stream, follow the rule on that page.
Errors
| Code | When |
|---|---|
UNSUPPORTED_CHAIN | A chains value is not a supported slug |
VALIDATION_ERROR | No wallet or more than 100, a malformed address, or an unknown parameter |
curl "https://api.metastreams.dev/v1/wallets/balances?wallets=7YttLkHDoNj9wyDur5pM1ejNaAvT9X4eqaYcHQqtj2G5&chains=solana" \
-H "Authorization: Bearer $API_KEY"
const url = new URL("https://api.metastreams.dev/v1/wallets/balances");
url.searchParams.set("wallets", "7YttLkHDoNj9wyDur5pM1ejNaAvT9X4eqaYcHQqtj2G5");
url.searchParams.set("chains", "solana");
const response = await fetch(url, {
headers: { Authorization: `Bearer ${process.env.API_KEY}` },
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const { balances } = await response.json();
{
"balances": [
{
"chain": "solana",
"wallet": "7YttLkHDoNj9wyDur5pM1ejNaAvT9X4eqaYcHQqtj2G5",
"asset": "SOL",
"balance": "41.208113",
"trigger": "trade",
"blockNumber": 371204118,
"signature": "4xQmVb8e2kT1nR7pZcW3sLdHfA9jEuY6gVnX1oB5iC0wQ2rT8yU3iO7pA1sD4fG6h",
"txIndex": 812,
"updatedAt": 1789632015120
}
]
}
{
"balances": []
}
Authorizations
Send the API key as Authorization: Bearer <key>.
Query Parameters
Wallet addresses, CSV; one to 100.
Chains to scope to, CSV of the chain slugs. Absent means every spot chain.
Response
The latest balance of each named wallet and asset. A pair with no observed balance has no row, which is not a zero.
The latest balance of each wallet and asset a read named.
One row per observed wallet and asset, ordered by chain, wallet, then asset.
Show child attributes
Show child attributes