Transfers a batch of ERC20 tokens from the sender's address to the specified recipient address.
import { transferBatch } from "thirdweb/extensions/erc20";import { sendTransaction } from "thirdweb"; const transaction = transferBatch({ contract, batch: [ { to: "0x...", amount: 100, }, { to: "0x...", amount: "0.1", },]); await sendTransaction({ transaction, account });
function transferBatch( batch: Array< { to: string } & ( | { amount: string | number } | { amountWei: bigint } ) >; overrides?: Omit< StaticPrepareTransactionOptions, "to" | "data" | "from" | "maxFeePerBlobGas" | "client" | "chain" >; }>,
The options for the batch transfer transaction.
batch: Array< { to: string } & ( | { amount: string | number } | { amountWei: bigint } ) >; overrides?: Omit< StaticPrepareTransactionOptions, "to" | "data" | "from" | "maxFeePerBlobGas" | "client" | "chain" >;}>;
A promise that resolves to the prepared transaction.