Erc1155.lazyMint() method
Create a batch of NFTs to be claimed in the future
Example
// 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
Signature:
lazyMint(metadatas: NFTMetadataOrUri[], options?: {
onProgress: (event: UploadProgressEvent) => void;
}): Promise<TransactionResultWithId<NFTMetadata>[]>;
Parameters
Parameter | Type | Description |
---|---|---|
metadatas | NFTMetadataOrUri[] | The metadata to include in the batch. |
options | { onProgress: (event: UploadProgressEvent) => void; } | (Optional) optional upload progress callback |
Returns:
Promise<TransactionResultWithId<NFTMetadata>[]>
Remarks
Create batch allows you to create a batch of many NFTs in one transaction.