Skip to main content

Import

Usage

Return Type: UseQueryResult<TokenBalance>

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

Properties

data

TokenBalance | undefined Token balance object containing:
  • contractType: The type of contract (ERC20, ERC721, ERC1155)
  • contractAddress: The token contract address
  • accountAddress: The address whose balance was queried
  • balance: The balance amount in the token’s base units
  • chainId: The chain ID where the balance was fetched from
  • blockHash: Hash of the block containing the balance
  • blockNumber: Number of the block containing the balance
  • tokenID: Optional token ID for NFTs
  • uniqueCollectibles: Number of unique collectibles
  • isSummary: Whether this is a summary balance
  • contractInfo: Optional contract information
  • tokenMetadata: Optional token metadata

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: GetSingleTokenBalanceSummaryArgs

options: BalanceHookOptions