Skip to main content

Erc1155.mintBatch() method

Mint Many NFTs with limited supplies

Example

// Custom metadata and supplies of your NFTs
const metadataWithSupply = [
{
supply: 50, // The number of this NFT you want to mint
metadata: {
name: "Cool NFT #1",
description: "This is a cool NFT",
image: fs.readFileSync("path/to/image.png"), // This can be an image url or file
},
},
{
supply: 100,
metadata: {
name: "Cool NFT #2",
description: "This is a cool NFT",
image: fs.readFileSync("path/to/image.png"), // This can be an image url or file
},
},
];

const tx = await contract.erc1155.mintBatch(metadataWithSupply);
const receipt = tx[0].receipt; // same transaction receipt for all minted NFTs
const firstTokenId = tx[0].id; // token id of the first minted NFT
const firstNFT = await tx[0].data(); // (optional) fetch details of the first minted NFT

Signature:

mintBatch(metadataWithSupply: EditionMetadataOrUri[]): Promise<TransactionResultWithId<EditionMetadata>[]>;

Parameters

ParameterTypeDescription
metadataWithSupplyEditionMetadataOrUri[]

Returns:

Promise<TransactionResultWithId<EditionMetadata>[]>

Remarks

Mint many different NFTs with limited supplies to the connected wallet.