generateMintSignature

Generates the payload and signature for minting an ERC20 token.

Example

import {
mintWithSignature,
generateMintSignature,
} from "thirdweb/extensions/erc20";
const { payload, signature } = await generateMintSignature({
account,
contract,
mintRequest: {
to: "0x...",
quantity: "10",
},
});
const transaction = mintWithSignature({
contract,
payload,
signature,
});
await sendTransaction({ transaction, account });
function generateMintSignature(
): Promise<{
payload: {
currency: string;
price: bigint;
primarySaleRecipient: string;
quantity: bigint;
to: string;
uid: `0x${string}`;
validityEndTimestamp: bigint;
validityStartTimestamp: bigint;
};
signature: `0x${string}`;
}>;

Parameters

The options for the minting process.

Type

let options: {
account: Account;
contract: ThirdwebContract;
contractType?: "TokenERC1155" | "SignatureMintERC1155";
mintRequest: GeneratePayloadInput;
};

Returns

let returnType: Promise<{
payload: {
currency: string;
price: bigint;
primarySaleRecipient: string;
quantity: bigint;
to: string;
uid: `0x${string}`;
validityEndTimestamp: bigint;
validityStartTimestamp: bigint;
};
signature: `0x${string}`;
}>;

A promise that resolves to the payload and signature.