Skip to main content

Import

Usage

Return Type: UseQueryResult<TokenBalance[]>

The hook returns all properties from React Query’s UseQueryResult with token balance data, including metadata. Here’s the detailed structure:

Properties

data

TokenBalance[] | undefined Array of token balance objects containing:
  • contractType: Type of the token contract (NATIVE, ERC20, ERC721, ERC1155)
  • contractAddress: Address of the token contract
  • accountAddress: Address of the account holding the tokens
  • balance: Token balance as a string (in base units)
  • chainId: Chain ID where the token exists
  • blockHash: Hash of the block where balance was last updated
  • blockNumber: Block number where balance was last updated
  • tokenID: (for NFTs) ID of the token
  • contractInfo: Token contract information including name, symbol, decimals, and logo URL
  • tokenMetadata: (for NFTs) Detailed token metadata including name, description, image URL, and attributes
  • uniqueCollectibles: Number of unique collectibles
  • isSummary: Whether the balance is a summary

isLoading

boolean Loading state for the data fetch.

isError

boolean Error state indicating if the query failed.

error

Error | null Any error that occurred during data fetching.

Parameters

The hook accepts two parameters:

args: GetTokenBalancesDetailsArgs

options: BalanceHookOptions