Skip to main content

useTotalCount() function

This feature is currently in beta and may change based on feedback that we receive.

Use this to get a the number of tokens in your NFTContract.

Example 1

const nftDrop = useNFTDrop(<ContractAddress>);
const { data: totalCount, isLoading, error } = useTotalCount(nftDrop);

Example 2

const { contract } = useContract(<ContractAddress>);
const { data: totalCount, isLoading, error } = useTotalCount(contract?.nft);

Signature:

export declare function useTotalCount(
contract: RequiredParam<NFTContract>,
): import("@tanstack/react-query").UseQueryResult<BigNumber, unknown>;

Parameters

ParameterTypeDescription
contractRequiredParam<NFTContract>an instance of a NFTContract

Returns:

import("@tanstack/react-query").UseQueryResult<BigNumber, unknown>

a response object that incudes the total number of tokens in the contract

Remarks

The total count and total supply are the same for based contracts. For the total count is the number of NFTs that exist on the contract, **not** the sum of all supply of each token. (Since ERC1155 can have multiple owners per token.)