useActiveClaimConditionForWallet

Hook for getting the active claim condition on a drop contract for a specific wallet address.

Each wallet address can have unique claim conditions at any given time. This hook allows you to get the active claim condition for a specific wallet address at this time.

This is available for available for contracts that implement the "ClaimConditions" interface; such as NFT Drop , Edition Drop , and Token Drop .


  • Returns the claim condition specific to the wallet address if found in the claimer snapshot.

  • Returns the default claim condition on the contract if the address is not found in the claimer snapshot.

  • Populates the error field if there is no active claim condition on the contract.

Example

import {
useActiveClaimConditionForWallet,
useContract,
useAddress,
} from "@thirdweb-dev/react";
function App() {
const address = useAddress();
const { contract } = useContract(contractAddress);
const { data, isLoading, error } = useActiveClaimConditionForWallet(
contract,
address,
);
}
function useActiveClaimConditionForWallet(
contract: RequiredParam<DropContract>,
walletAddress: RequiredParam<string>,
tokenId?: BigNumberish,
): UseQueryResult<ClaimCondition | null>;

Parameters

Instance of a contract that extends the ERC20, ERC721 or ERC1155 spec and implements the "ClaimConditions" extension.

Type

let contract: RequiredParam<DropContract>;

The wallet address to check the active claim condition for. You can use the useAddress hook to get the currently connected wallet's address.

Type

let walletAddress: RequiredParam<string>;

When using the hook with ERC1155 contracts, pass the tokenId as the third parameter; as each token can have unique claim conditions.

Pass undefined , or leave this field out if you are using ERC721 or ERC20 drop contracts.

Type

let tokenId: BigNumberish;

Returns

let returnType: UseQueryResult<ClaimCondition | null>;

The active claim condition for the wallet address or null if there is no active claim condition