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 });
function generateAirdropSignatureERC721(options: GenerateAirdropERC721SignatureOptions) : Promise<{ req: { contents: readonly Array<{ recipient: string; tokenId: bigint }>; expirationTimestamp: bigint; tokenAddress: string; uid: `0x${string}` }; signature: `0x${string}` }>

Parameters

The options for the airdrop.

Type

let options: {
account: Account;
airdropRequest: GenerateReqInput;
contract: ThirdwebContract;
};

Returns

let returnType: Promise<{ req: { contents: readonly Array<{ recipient: string; tokenId: bigint }>; expirationTimestamp: bigint; tokenAddress: string; uid: `0x${string}` }; signature: `0x${string}` }>

A promise that resolves to the req and signature.