Skip to main content

useClaimToken() function

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

Use this to claim tokens on your

Example

const Component = () => {
const {
mutate: claimTokens,
isLoading,
error,
} = useClaimToken(TokenDropContract);

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

return (
<button
disabled={isLoading}
onClick={() => claimTokens({ to: "0x...", amount: 100 })}
>
Claim Tokens!
</button>
);
};

Signature:

export declare function useClaimToken<TContract extends TokenDrop>(
contract: RequiredParam<TContract>,
): import("@tanstack/react-query").UseMutationResult<
Omit<
{
receipt: import("@ethersproject/abstract-provider").TransactionReceipt;
data: () => Promise<unknown>;
},
"data"
>,
unknown,
ClaimTokenParams,
unknown
>;

Parameters

ParameterTypeDescription
contractRequiredParam<TContract>an instance of a

Returns:

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

a mutation object that can be used to tokens to the wallet specificed in the params