getBalances function. This returns native and token balances for a single network, unlike getMultichainBalances which queries across multiple chains.
If you only need the native token balance, use getBalance 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 |
Response
Returns aPromise<TokenBalance[]> — an array of token balance objects.
Related functions
- Getting Balance - For native token balance only
- Getting Multichain Balances - For balances across multiple chains
- Getting the Wallet Account Given an Address and Chain
- Getting Active Network