ERC1155BatchMintable
Functionality available for contracts that implement the
ERC1155Enumerable
,
ERC1155Mintable
, and
Multicall
extensions.
Allows you to mint multiple NFTs at once to a wallet address.
By default, the NFT metadata is uploaded and pinned to IPFS before minting.
You can override this default behavior by providing a string as the metadata
property
that points to valid metadata object.
mint_batch
Mint many different NFTs with limited supplies to the connected wallet.
from thirdweb.types.nft import NFTMetadataInput, EditionMetadataInput
# Note that you can customize this metadata however you like
metadatas_with_supply = [
EditionMetadataInput(
NFTMetadataInput.from_json({
"name": "Cool NFT",
"description": "This is a cool NFT",
"image": open("path/to/file.jpg", "rb"),
}),
100
),
EditionMetadataInput(
NFTMetadataInput.from_json({
"name": "Cooler NFT",
"description": "This is a cooler NFT",
"image": open("path/to/file.jpg", "rb"),
}),
100
)
]
# You can pass in any address here to mint the NFT to
txs = contract.erc1155.mint_batch(metadatas_with_supply)
receipt = txs[0].receipt
token_id = txs[0].id
nft = txs[0].data()
Configuration
mint_batch_to
The same as mint_batch
, but allows you to specify the wallet, rather than using the connected one.
from thirdweb.types.nft import NFTMetadataInput, EditionMetadataInput
# Note that you can customize this metadata however you like
metadatas_with_supply = [
EditionMetadataInput(
NFTMetadataInput.from_json({
"name": "Cool NFT",
"description": "This is a cool NFT",
"image": open("path/to/file.jpg", "rb"),
}),
100
),
EditionMetadataInput(
NFTMetadataInput.from_json({
"name": "Cooler NFT",
"description": "This is a cooler NFT",
"image": open("path/to/file.jpg", "rb"),
}),
100
)
]
# You can pass in any address here to mint the NFT to
txs = contract.erc1155.mint_batch_to("0x7fDae677aA6f94Edff9872C4b91D26407709c790", metadatas_with_supply)
receipt = txs[0].receipt
token_id = txs[0].id
nft = txs[0].data()