Skip to main content

ERC1155 - Lazy Mint

You can utilize these features of the SDK on your contract if it implements LazyMint.

Batch Lazy Mint NFTs

Batch upload NFT metadata to be lazy-minted to the contract.

You can provide metadata objects to have them uploaded and pinned to IPFS, or provide your own URLs.

// Custom metadata of the NFTs to create
const metadatas = [{
name: "Cool NFT",
description: "This is a cool NFT",
image: fs.readFileSync("path/to/image.png"), // This can be an image url or file
}, {
name: "Cool NFT",
description: "This is a cool NFT",
image: fs.readFileSync("path/to/image.png"),
}];

const results = await contract.erc1155.lazyMint(metadatas); // uploads and creates the NFTs on chain
const firstTokenId = results[0].id; // token id of the first created NFT
const firstNFT = await results[0].data(); // (optional) fetch details of the first created NFT

This snippet is for v3 of the SDK. Learn how to upgrade.

View in React SDK Documentation