oms.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 | SDK network entry, such as Networks.polygon or Networks.amoy. |
contractAddress | string or undefined | 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 | { page?: number; pageSize?: number } or undefined | Optional pagination request. Defaults to page 0 with up to 40 entries. |
getTokenBalances returns Promise<TokenBalancesResult>.
| Field | Type | Description |
|---|---|---|
status | number | HTTP status code from the balance response. |
page | TokenBalancesPage or undefined | Pagination metadata from the balance response. |
balances | TokenBalance[] | Balances returned for the wallet. |
Get Native Token Balance
| Parameter | Type | Description |
|---|---|---|
network | Network | SDK network entry, such as Networks.polygon or Networks.amoy. |
walletAddress | string | Wallet address to inspect. |
getNativeTokenBalance returns Promise<TokenBalance | undefined>.
It returns undefined when the response does not include a native balance.
Token Balance Shape
EachTokenBalance can include:
| Field | Type | Description |
|---|---|---|
contractType | string or undefined | Token contract type, such as ERC20, ERC721, or NATIVE. |
contractAddress | string or undefined | Token contract address. Native token balances do not include a contract address. |
accountAddress | string or undefined | Wallet address queried. |
tokenId | string or undefined | Token ID for token types that use IDs. |
balance | string or undefined | Raw base-unit balance as a string. |
blockHash | string or undefined | Block hash for the balance snapshot. |
blockNumber | number or undefined | Block number for the balance snapshot. |
chainId | number or undefined | Numeric chain ID. |