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 the total count of NFT tokens of your NFTContract.

Example

const { contract } = useContract(<ContractAddress>);
const { data: count, isLoading, error } = useTotalCount(contract);

Signature:

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

Parameters

ParameterTypeDescription
contractRequiredParam<TContract>an instance of a NFTContract

Returns:

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

a response object that includes the total count of NFTs