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