useClaimConditions() function
This feature is currently in beta and may change based on feedback that we receive.
Use this to get all claim conditions for ERC20, ERC721 or ERC1155 based contracts. They need to extend the claimCondition
extension for this hook to work.
Example 1
const { data: claimConditions, isLoading, error } = useClaimConditions(<YourERC20ContractInstance>);
Example 2
const { data: claimConditions, isLoading, error } = useClaimConditions(<YourERC721ContractInstance>);
Example 3
const { data: claimConditions, isLoading, error } = useClaimConditions(<YourERC1155ContractInstance>, <tokenId>);
Signature:
export declare function useClaimConditions(
contract: RequiredParam<DropContract>,
tokenId?: BigNumberish,
options?: ClaimConditionFetchOptions,
): import("@tanstack/react-query").UseQueryResult<
{
metadata?:
| {
[x: string]: unknown;
name?: string | undefined;
}
| undefined;
snapshot?:
| {
price?: string | undefined;
currencyAddress?: string | undefined;
address: string;
maxClaimable: string;
}[]
| null
| undefined;
maxClaimableSupply: string;
startTime: Date;
price: import("ethers").BigNumber;
currencyAddress: string;
maxClaimablePerWallet: 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
Parameter | Type | Description |
---|---|---|
contract | RequiredParam<DropContract> | an instance of a contract that extends the ERC721, ERC1155 or ERC20 spec and implements the claimConditions extension. |
tokenId | BigNumberish | (Optional) the id of the token to fetch the claim conditions for (if the contract is an ERC1155 contract) |
options | ClaimConditionFetchOptions | (Optional) |
Returns:
import("@tanstack/react-query").UseQueryResult<{ metadata?: { [x: string]: unknown; name?: string | undefined; } | undefined; snapshot?: { price?: string | undefined; currencyAddress?: string | undefined; address: string; maxClaimable: string; }[] | null | undefined; maxClaimableSupply: string; startTime: Date; price: import("ethers").BigNumber; currencyAddress: string; maxClaimablePerWallet: 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 list of claim conditions