generateAirdropSignatureERC20
Generates the req and signature for sending ERC20 airdrop.
import { airdropERC20WithSignature, generateAirdropSignatureERC20,} from "thirdweb/extensions/airdrop"; // list of recipients and amounts to airdrop for each recipientconst contents = [ { recipient: "0x...", amount: 10n }, // amount in wei { recipient: "0x...", amount: 15n }, // amount in wei { recipient: "0x...", amount: 20n }, // amount in wei]; const { req, signature } = await generateAirdropSignatureERC20({ account, contract, airdropRequest: { tokenAddress: "0x...", // address of the ERC20 token to airdrop contents, },}); const transaction = airdropERC20WithSignature({ contract, req, signature,});await sendTransaction({ transaction, account });
function generateAirdropSignatureERC20(options: GenerateAirdropERC20SignatureOptions) : Promise<{ req: { contents: readonly Array<{ amount: bigint; recipient: string }>; expirationTimestamp: bigint; tokenAddress: string; uid: `0x${string}` }; signature: `0x${string}` }>
The options for the airdrop.
let options: { airdropRequest: GenerateReqInput;};