generateAirdropSignatureERC721

Generates the req and signature for sending ERC721 airdrop.

Example

import {
airdropERC721WithSignature,
generateAirdropSignatureERC721,
} from "thirdweb/extensions/airdrop";
// list of recipients and tokenIds to airdrop for each recipient
const contents = [
{ recipient: "0x...", tokenId: 0 },
{ recipient: "0x...", tokenId: 1 },
{ recipient: "0x...", tokenId: 2 },
];
const { req, signature } = await generateAirdropSignatureERC721({
account,
contract,
airdropRequest: {
tokenAddress: "0x...", // address of the ERC721 token to airdrop
contents,
},
});
const transaction = airdropERC721WithSignature({
contract,
req,
signature,
});
await sendTransaction({ transaction, account });

Parameters

Returns

A promise that resolves to the req and signature.