Fetch the balance of a wallet for a specific token.
import { useWalletBalance } from "thirdweb/react"; const { data, isLoading, isError } = useWalletBalance({ chain, address, client, tokenAddress,});
function useWalletBalance( options: { address: undefined | string; chain: undefined | Readonly<ChainOptions & { rpc: string }>; client: ThirdwebClient; tokenAddress?: string; }, queryOptions?: UseWalletBalanceQueryOptions,): UseQueryResult<GetWalletBalanceResult>;
GetWalletBalanceOptions - The options for fetching the wallet balance.
let options: { address: undefined | string; chain: undefined | Readonly<ChainOptions & { rpc: string }>; client: ThirdwebClient; tokenAddress?: string;};
let queryOptions: UseWalletBalanceQueryOptions;
let returnType: UseQueryResult<GetWalletBalanceResult>;
GetWalletBalanceResult The result of the query.