generateMintSignature
Generates the payload and signature for minting an ERC1155 token.
import { mintWithSignature, generateMintSignature,} from "thirdweb/extensions/erc1155"; const { payload, signature } = await generateMintSignature({ account, contract, mintRequest: { to: "0x...", quantity: 10n, 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; pricePerToken: bigint; primarySaleRecipient: string; quantity: bigint; royaltyBps: bigint; royaltyRecipient: string; to: string; tokenId: bigint; uid: `0x${string}`; uri: string; validityEndTimestamp: bigint; validityStartTimestamp: bigint; }; signature: `0x${string}`;}>;
let returnType: Promise<{ payload: { currency: string; pricePerToken: bigint; primarySaleRecipient: string; quantity: bigint; royaltyBps: bigint; royaltyRecipient: string; to: string; tokenId: bigint; uid: `0x${string}`; uri: string; validityEndTimestamp: bigint; validityStartTimestamp: bigint; }; signature: `0x${string}`;}>;
A promise that resolves to the payload and signature.