useActiveClaimCondition
Hook for getting the active claim condition for a given drop contract.
Available for contracts that implement the claim conditions interface; such as NFT Drop, Edition Drop, and Token Drop.
import { useActiveClaimCondition } from "@thirdweb-dev/react";
const { data, isLoading, error } = useActiveClaimCondition(contract);
Usage
Provide your drop contract as the first argument to the hook.
import {
useActiveClaimCondition,
useContract,
} from "@thirdweb-dev/react";
function App() {
// Contract can be any contract that implements claim conditions.
// Including ERC721, ERC1155, and ERC20 drop contracts.
const { contract } = useContract(contractAddress);
const { data, isLoading, error } =
useActiveClaimCondition(contract);
}
Configuration
Returns
The hook's data
property, once loaded, contains the following properties:
{
maxClaimableSupply: string;
startTime: Date;
price: BigNumber;
currencyAddress: string;
maxClaimablePerWallet: string;
waitInSeconds: BigNumber;
merkleRootHash: string | number[];
availableSupply: string;
currentMintSupply: string;
currencyMetadata: {
symbol: string;
value: BigNumber;
name: string;
decimals: number;
displayValue: string;
};
metadata?: {
[x: string]: unknown;
name?: string | undefined;
} | undefined;
snapshot?: {
price?: string | undefined;
currencyAddress?: string | undefined;
address: string;
maxClaimable: string;
}[] | null | undefined;
}