Documentation Index
Fetch the complete documentation index at: https://www.dynamic.xyz/docs/llms.txt
Use this file to discover all available pages before exploring further.
For most apps, prefer
getMultichainTokenBalances —
it batches token balances across chains, networks, and addresses in a
single call. Reach for getTokenBalances only when you have one wallet
on one chain (still fine across multiple networks of that chain) and
want a simpler call shape.getTokenBalances function. This returns native and token balances for a single chain (one or more networks of that chain), unlike getMultichainTokenBalances which queries across multiple chains in one call.
If you only need the native token balance, use getNativeBalance instead.
Usage
With options
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
walletAccount | WalletAccount | Yes | The wallet account to get the balances for |
networkId | number | No | The network ID to query. Defaults to the active network |
includePrices | boolean | No | Include token prices in the response |
includeNative | boolean | No | Include the native token balance |
filterSpamTokens | boolean | No | Filter out spam tokens (default: true) |
forceRefresh | boolean | No | Force a refresh instead of using cached values |
whitelistedContracts | string[] | No | Only return balances for these contract addresses |
React
Fetch balances in auseEffect and refresh when the wallet account changes:
Response
Returns aPromise<TokenBalance[]> — an array of token balance objects.
Related functions
- Getting Multichain Token Balances - Recommended default for token balances across chains
- Getting Native Balance - Native gas balance only
- Getting the Wallet Account Given an Address and Chain
- Getting Active Network