DOCS

useTransferBatchToken

Airdrop tokens to a list of wallets

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>
  );
};

Parameters

Returns

a mutation object that can be used to transfer batch tokens