Function useClaimToken

  • Beta

    Claim tokens to a specific wallet

    Parameters

    Returns UseMutationResult<Omit<{
        data: (() => Promise<unknown>);
        receipt: providers.TransactionReceipt;
    }, "data">, unknown, ClaimTokenParams, unknown>

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

    Example

    const Component = () => {
    const { contract } = useContract("{{contract_address}}");
    const {
    mutate: claimTokens,
    isLoading,
    error,
    } = useClaimToken(contract);

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

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

    Twfeature

    ERC20ClaimPhasesV2 | ERC20ClaimPhasesV1 | ERC20ClaimConditionsV2 | ERC20ClaimConditionsV1

    See

    Documentation

Generated using TypeDoc