Edition
When using the Edition smart contract, additional top-level functionality is available to use.
To access the top-level functionality, use the get_edition
method when creating the contract instance:
contract = sdk.get_edition(
"{{contract_address}}",
)
The extensions that the edition contract supports are listed below.
- ERC1155
- ERC1155Burnable
- ERC1155Enumerable
- ERC1155Mintable
- ERC1155BatchMintable
- ERC1155SignatureMintable
- Royalty
- PlatformFee
- PrimarySale
- Permissions
- ContractMetadata
- Ownable
- Gasless
mint
Mint a new NFT to the connected wallet.
from thirdweb.types.nft import NFTMetadataInput, EditionMetadataInput
# Note that you can customize this metadata however you like
metadata_with_supply = EditionMetadataInput(
NFTMetadataInput.from_json({
"name": "Cool NFT",
"description": "This is a cool NFT",
"image": open("path/to/file.jpg", "rb"),
}),
100
)
# You can pass in any address here to mint the NFT to
tx = contract.mint(metadata_with_supply)
receipt = tx.receipt
token_id = tx.id
nft = tx.data()
Configuration
mint_additional_supply
Mint additional quantity of an NFT that already exists on the contract.
token_id = 0
additional_supply = 1
tx = contract.mint_additional_supply(token_id, additional_supply)
receipt = tx.receipt
token_id = tx.id
nft = tx.data()
Configuration
mint_additional_supply_to
The same as mint_additional_supply
, but allows you to specify the address of the wallet rather than using the connected wallet.
to = "0x7fDae677aA6f94Edff9872C4b91D26407709c790"
token_id = 0
additional_supply = 1
tx = contract.mint_additional_supply_to(to, token_id, additional_supply)
receipt = tx.receipt
token_id = tx.id
nft = tx.data()
Configuration
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.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.mint_batch_to("0x7fDae677aA6f94Edff9872C4b91D26407709c790", metadatas_with_supply)
receipt = txs[0].receipt
token_id = txs[0].id
nft = txs[0].data()