Skip to main content

useActiveClaimCondition() function

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

Use this to get the active claim conditon for ERC20, ERC721 or ERC1155 based contracts. They need to extend the claimCondition extension for this hook to work.

Example 1

const { data: activeClaimCondition, isLoading, error } = useActiveClaimCondition(<YourERC20ContractInstance>);

Example 2

const { data: activeClaimCondition, isLoading, error } = useActiveClaimCondition(<YourERC721ContractInstance>);

Example 3

const { data: activeClaimCondition, isLoading, error } = useActiveClaimCondition(<YourERC1155ContractInstance>, <tokenId>);

Signature:

export declare function useActiveClaimCondition(
contract: RequiredParam<DropContract>,
tokenId?: BigNumberish,
): import("@tanstack/react-query").UseQueryResult<
{
snapshot?:
| {
address: string;
maxClaimable: string;
}[]
| undefined;
quantityLimitPerTransaction: string;
startTime: Date;
price: import("ethers").BigNumber;
currencyAddress: string;
maxQuantity: string;
waitInSeconds: import("ethers").BigNumber;
merkleRootHash: string | number[];
availableSupply: string;
currentMintSupply: string;
currencyMetadata: {
symbol: string;
value: import("ethers").BigNumber;
name: string;
decimals: number;
displayValue: string;
};
},
unknown
>;

Parameters

ParameterTypeDescription
contractRequiredParam<DropContract>an instance of a contract that extends the ERC721 or ERC1155 spec and implements the claimConditions extension.
tokenIdBigNumberish(Optional) the id of the token to fetch the claim conditions for (if the contract is an ERC1155 contract)

Returns:

import("@tanstack/react-query").UseQueryResult<{ snapshot?: { address: string; maxClaimable: string; }[] | undefined; quantityLimitPerTransaction: string; startTime: Date; price: import("ethers").BigNumber; currencyAddress: string; maxQuantity: string; waitInSeconds: import("ethers").BigNumber; merkleRootHash: string | number[]; availableSupply: string; currentMintSupply: string; currencyMetadata: { symbol: string; value: import("ethers").BigNumber; name: string; decimals: number; displayValue: string; }; }, unknown>

a response object with the currently active claim condition