Function useTransferBatchToken

  • Beta

    Airdrop tokens to a list of wallets

    Parameters

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

    a mutation object that can be used to transfer batch tokens

    Example

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

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

    return (
    <button
    disabled={isLoading}
    onClick={() => transferBatchTokens([{ to: "{{wallet_address}}", amount: 1000 }, { to: "{{wallet_address}}", amount: 2000 }])}
    >
    Airdrop
    </button>
    );
    };

    Twfeature

    ERC20

    See

    Documentation

Generated using TypeDoc