generateMintSignature
Generates the payload and signature for minting an ERC721 token.
import { mintWithSignature, generateMintSignature,} from "thirdweb/extensions/erc721"; const { payload, signature } = await generateMintSignature({ account, contract, mintRequest: { to: "0x...", metadata: { name: "My NFT", description: "This is my NFT", image: "https://example.com/image.png", }, },}); const transaction = mintWithSignature({ contract, payload, signature,});await sendTransaction({ transaction, account });
function generateMintSignature(): Promise<{ payload: { currency: string; price: bigint; primarySaleRecipient: string; royaltyBps: bigint; royaltyRecipient: string; to: string; uid: `0x${string}`; uri: string; validityEndTimestamp: bigint; validityStartTimestamp: bigint; }; signature: `0x${string}`;}>;
The options for the minting process.
let options: { contractType?: "TokenERC1155" | "SignatureMintERC1155"; mintRequest: GeneratePayloadInput;};
let returnType: Promise<{ payload: { currency: string; price: bigint; primarySaleRecipient: string; royaltyBps: bigint; royaltyRecipient: string; to: string; uid: `0x${string}`; uri: string; validityEndTimestamp: bigint; validityStartTimestamp: bigint; }; signature: `0x${string}`;}>;
A promise that resolves to the payload and signature.