Skip to main content

ERC721LazyMintable

Functionality available for contracts that implement the ERC721 and LazyMint extensions.

Allows you to lazy mint new batches of NFTs to be claimed in the future.

By default, the NFT metadata is uploaded and pinned to IPFS before lazy-minting. You can override this default behavior by providing a list of URLs as strings that point to valid metadata objects.

create_batch

Define a list of metadata objects that you want to lazy-mint.

from thirdweb.types.nft import NFTMetadataInput

# You can customize this metadata however you like
metadatas = [
NFTMetadataInput.from_json({
"name": "Cool NFT",
"description": "This is a cool NFT",
"image": open("path/to/file.jpg", "rb"),
}),
NFTMetadataInput.from_json({
"name": "Cooler NFT",
"description": "This is a cooler NFT",
"image": open("path/to/file.jpg", "rb"),
}),
]

txs = contract.erc721.create_batch(metadatas)
first_token_id = txs[0].id
first_nft = txs[0].data()
Configuration

A list of metadata objects for the NFTs you want to mint.

Must be a List of NFTMetadataInput objects that conform to the metadata standards. Alternatively, you can provide a list of strings that point to valid metadata objects, to override the default behavior of uploading and pinning the metadata to IPFS (shown below).

metadatas = [
NFTMetadataInput.from_json({
"name": "Cool NFT",
"description": "This is a cool NFT",
"image": open("path/to/file.jpg", "rb"),
}),
NFTMetadataInput.from_json({
"name": "Cooler NFT",
"description": "This is a cooler NFT",
"image": open("path/to/file.jpg", "rb"),
}),
]

txResult = contract.erc721.create_batch(metadatas)
class NFTMetadataInput:
name: str
description: Optional[str] = None
image: Optional[str] = None
external_url: Optional[str] = None
animation_url: Optional[str] = None
background_color: Optional[str] = None
properties: Optional[Dict[str, Any]] = None
attributes: Optional[Dict[str, Any]] = None