generateAirdropSignatureERC20

Generates the req and signature for sending ERC20 airdrop.

Example

import {
airdropERC20WithSignature,
generateAirdropSignatureERC20,
} from "thirdweb/extensions/airdrop";
// list of recipients and amounts to airdrop for each recipient
const 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 });

Parameters

Returns

A promise that resolves to the req and signature.