The SDK includes typed wrappers for the public token endpoints. All return cached prices where possible — use them in tight UI loops without hammering the API.
getAllTokens
const tokens = await dzap.getAllTokens(1); // Ethereum
const withPrices = await dzap.getAllTokens(1, undefined, '0xUser'); // include balances
getTokenDetails
const usdc = await dzap.getTokenDetails(
'0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', // address
1, // chainId
'0xUser', // account (optional)
true, // includeBalance
true, // includePrice
);
getTokenPrices
const prices = await dzap.getTokenPrices(
['0xA0b...', '0xC02...'],
1,
);
// prices => { '0xA0b...': '1.00', '0xC02...': '3450.12' } (USD strings or null)
getBalances
const balances = await dzap.getBalances(
8453, // chainId
'0xUser',
);
// Native + ERC20 balances with USD valuation
Tips
- Native token — comes back under the sentinel address
0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE.
- Price freshness — DZap aggregates prices across CoinGecko + protocol-native sources. Stale prices (>5min) are flagged in the response.
- Decimals — always check
decimals before formatting. USDC is 6, WETH is 18.
Last modified on May 4, 2026