Hooks
useTokenBalances
Hook is available from version 2.2.4 and Solana support from 2.2.9
Summary
Used to fetch the token balances of an account on a specified network. The default behavior is to return the token balances of the primary account on the current network, but optionally the account, network, includeFiat and includeNativeBalance can be specified.
Currently only supported on Ethereum, Optimism, Polygon, Arbitrum, Base and Solana networks for logged in users.
Usage
With arguments
Parameter | Type | Description |
---|---|---|
networkId | Number | The network ID |
chainName | ChainEnum | The chain used |
tokenAddresses | String[] | The token addresses |
includeFiat | Boolean | Should include Fiat prices |
includeNativeBalance | Boolean | Should include native balance |
Optionally, you can pass an object with the account address and network id specified. Additionally, you can pass an array of token addresses to filter the results.
Solana support with Fiat prices (with SDK version 2.2.9)
Was this page helpful?