client.indexer for wallet balance reads. Requests use the project access key configured on OMSClient, and balance amounts are returned as raw base-unit strings.
Get Token Balances
| Parameter | Type | Description |
|---|---|---|
network | Network | Supported SDK network, such as Network.POLYGON or Network.AMOY. |
contractAddress | String? | Optional token contract address filter. Omit it to query balances across contracts. |
walletAddress | String | Wallet address to inspect. This can be the active non-custodial wallet or any wallet address. |
includeMetadata | Boolean | Whether token metadata should be included in the response. |
page | TokenBalancesPageRequest | Optional pagination request. Defaults to page 0 with up to 40 entries. |
getTokenBalances returns TokenBalancesResult.
| Field | Type | Description |
|---|---|---|
status | Int | HTTP status code from the balance response. |
page | TokenBalancesPage? | Pagination metadata from the balance response. |
balances | List<TokenBalance> | Balances returned for the wallet. |
Get Native Token Balance
| Parameter | Type | Description |
|---|---|---|
network | Network | Supported SDK network, such as Network.POLYGON or Network.AMOY. |
walletAddress | String | Wallet address to inspect. |
getNativeTokenBalance returns TokenBalance?.
It returns null when the response does not include a native balance.
Token Balance Shape
EachTokenBalance can include:
| Field | Type | Description |
|---|---|---|
contractType | String? | Token contract type, such as ERC20, ERC721, or NATIVE. |
contractAddress | String? | Token contract address. Native token balances do not include a contract address. |
accountAddress | String? | Wallet address queried. |
tokenId | String? | Token ID for token types that use IDs. |
balance | String? | Raw base-unit balance as a string. |
blockHash | String? | Block hash for the balance snapshot. |
blockNumber | Long? | Block number for the balance snapshot. |
chainId | Long? | Numeric chain ID. |