mintWithSignature

Mints a new ERC721 token with the given minter signature

Example

import { mintWithSignature, generateMintSignature } from "thirdweb/extensions/erc721";
import { sendTransaction } from "thirdweb";
const { payload, signature } = await generateMintSignature(...)
const transaction = mintWithSignature({
contract,
payload,
signature,
});
await sendTransaction({ transaction, account });
function mintWithSignature(
| {
payload: {
currency: string;
pricePerToken: bigint;
primarySaleRecipient: string;
quantity: bigint;
royaltyBps: bigint;
royaltyRecipient: string;
to: string;
uid: `0x${string}`;
uri: string;
validityEndTimestamp: bigint;
validityStartTimestamp: bigint;
};
signature: `0x${string}`;
}
| {
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}`;
}
>,

Parameters

The transaction options.

Type

| {
payload: {
currency: string;
pricePerToken: bigint;
primarySaleRecipient: string;
quantity: bigint;
royaltyBps: bigint;
royaltyRecipient: string;
to: string;
uid: `0x${string}`;
uri: string;
validityEndTimestamp: bigint;
validityStartTimestamp: bigint;
};
signature: `0x${string}`;
}
| {
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}`;
}
>;

Returns

let returnType: PreparedTransaction<
any,
AbiFunction,
>;

A promise that resolves to the transaction result.