useNFTBalance() function
This feature is currently in beta and may change based on feedback that we receive.
Use this to get a the total balance of a NFTContract and wallet address.
Example 1
const nftDrop = useNFTDrop(<ContractAddress>);
const { data: ownerBalance, isLoading, error } = useNFTBalance(nftDrop, <OwnerWalletAddress>);
Example 2
const { contract } = useContract(<ContractAddress>);
const { data: ownerBalance, isLoading, error } = useNFTBalance(contract?.nft, <OwnerWalletAddress>);
Signature:
export declare function useNFTBalance<TContract extends NFTContract>(
...[contract, ownerWalletAddress, tokenId]: useNFTBalanceParams<TContract>
): import("@tanstack/react-query").UseQueryResult<BigNumber, unknown>;
Parameters
Parameter | Type | Description |
---|---|---|
[contract, ownerWalletAddress, tokenId] | useNFTBalanceParams<TContract> |
Returns:
import("@tanstack/react-query").UseQueryResult<BigNumber, unknown>
a response object that includes the total balance of the owner