Skip to main content

useSetClaimConditions() function

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

Use this to set claim conditions on your NFTContract

Example 1

const Component = () => {
const nftDrop = useNFTDrop(<ContractAddress>);
const {
mutate: setClaimConditions,
isLoading,
error,
} = useSetClaimConditions(nftDrop);

if (error) {
console.error("failed to set claim conditions", error);
}

return (
<button
disabled={isLoading}
onClick={() => setClaimConditions({ phases: [{ price: 2, maxQuantity: 100 }] })}
>
Set Claim Conditions!
</button>
);
};

Example 2

const Component = () => {
const { contract } = useContract(<ContractAddress>);
const {
mutate: setClaimConditions,
isLoading,
error,
} = useSetClaimConditions(contract?.nft);

if (error) {
console.error("failed to set claim conditions", error);
}

return (
<button
disabled={isLoading}
onClick={() => setClaimConditions({ phases: [{ price: 2, maxQuantity: 100 }] })}
>
Set Claim Conditions!
</button>
);
};

Signature:

export declare function useSetClaimConditions<TContract extends NFTContract>(
...[contract, tokenId]: ClaimConditionsInputParams<TContract>
): import("@tanstack/react-query").UseMutationResult<
| Omit<
{
receipt: import("@ethersproject/abstract-provider").TransactionReceipt;
data: () => Promise<unknown>;
},
"data"
>
| undefined,
unknown,
SetClaimConditionsParams,
unknown
>;

Parameters

ParameterTypeDescription
[contract, tokenId]ClaimConditionsInputParams<TContract>

Returns:

import("@tanstack/react-query").UseMutationResult<Omit<{ receipt: import("@ethersproject/abstract-provider").TransactionReceipt; data: () => Promise<unknown>; }, "data"> | undefined, unknown, SetClaimConditionsParams, unknown>

a mutation object that can be used to set claim conditions