generateAirdropSignatureERC1155

Generates the req and signature for sending ERC1155 airdrop.

Example

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

Parameters

The options for the airdrop.

Type

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

Returns

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

A promise that resolves to the req and signature.