mintWithSignature

Mints ERC1155 tokens to a specified address with a signature via a MintableERC1155 module.

Example

import { MintableERC1155 } from "thirdweb/modules";
// generate the payload and signature, this is typically done on the server
// requires to be generated with a wallet that has the MINTER_ROLE
const { payload, signature } =
await MintableERC1155.generateMintSignature({
account,
contract,
nft: {
name: "My NFT",
description: "This is my NFT",
image: "ipfs://...",
},
mintRequest: {
recipient: "0x...",
quantity: "10",
},
});
// prepare the transaction, this is typically done on the client
// can be executed by any wallet
const transaction = MintableERC1155.mintWithSignature({
contract,
payload,
signature,
});
// Send the transaction
await sendTransaction({ transaction, account });
function mintWithSignature(
payload: {
amount: bigint;
baseURI: string;
data: `0x${string}`;
to: `0x${string}`;
tokenId: bigint;
};
signature: `0x${string}`;
}>,

Parameters

The options for minting tokens.

Type

let options: BaseTransactionOptions<{
payload: {
amount: bigint;
baseURI: string;
data: `0x${string}`;
to: `0x${string}`;
tokenId: bigint;
};
signature: `0x${string}`;
}>;

Returns

let returnType: PreparedTransaction<
any,
AbiFunction,
>;

A transaction to mint tokens.