Edition
thirdweb's Edition contract is a n-of-1 or n-of-many NFT Collection, that follows the ERC1155 Standard also known as "Semi-Fungible Tokens".
The Edition contract is best used when you want to release many NFTs based on the same asset, but you don't want to "drop" or "release" them for your community to claim.
Unlike the Edition Drop contract, the Edition contract does not lazy mint your NFTs. Instead, NFTs are minted immediately when they are added to the collection.
This means you can still transfer the NFTs or sell them on a Marketplace, and perform any other actions you would expect to do with a NFT.
You could use the Edition contract to:
- Create an NFT Collection where each NFT has 100 copies
- Airdrop a list of wallet addresses an NFT that all use the same asset and metadata
- Create 10 "copies" of your artwork and sell them on a Marketplace
Create an Edition Contract
Learn how to create any of thirdweb's pre-built contracts in the Deploying Contracts page.
Getting the contract in your application
To start using your Edition contract inside your application, you'll need to use it's contract address. You can get the contract address from the dashboard.
- Javascript
- React
- Python
- Go
import { ThirdwebSDK } from "@thirdweb-dev/sdk";
const sdk = new ThirdwebSDK("rinkeby");
const contract = sdk.getEdition("{{contract_address}}");
import { useEdition } from '@thirdweb-dev/react'
export default function Component() {
const edition = useEdition("<YOUR-CONTRACT-ADDRESS>")
// Now you can use the edition contract in the rest of the component
}
from thirdweb import ThirdwebSDK
from eth_account import Account
# You can customize this to a supported network or your own RPC URL
network = "mumbai"
# This will create a random account to use for signing transactions
signer = Account.create()
sdk = ThirdwebSDK(network, signer)
contract = sdk.get_edition("{{contract_address}}")
import (
"github.com/thirdweb-dev/go-sdk/thirdweb"
)
privateKey = "..."
sdk, err := thirdweb.NewThirdwebSDK("mumbai", &thirdweb.SDKOptions{
PrivateKey: privateKey,
})
contract, err := sdk.GetEditionDrop("{{contract_address}}")
Setting Royalty Fees
Royalty fees are fees you earn on secondary sales of your NFTs. For example, if you sell an NFT on the marketplace, and it is then sold again to another user, you will earn a royalty fee.
Using the dashboard
From the dashboard, in the Settings tab you can set the royalty percentage and the address that should receive the revenue from royalties earned from secondary sales of the assets.
Using the thirdweb SDK
- Javascript
- React
- Python
- Go
// royalties on the whole contract
contract.royalty.setDefaultRoyaltyInfo({
seller_fee_basis_points: 100, // 1%
fee_recipient: "0x..."
});
// override royalty for a particular token
contract.royalty.setTokenRoyaltyInfo(tokenId, {
seller_fee_basis_points: 500, // 5%
fee_recipient: "0x..."
});
React SDK support for royalty is coming soon.
Want this feature sooner? Let us know in Discord!
Python SDK support for royalty is coming soon.
Want this feature sooner? Let us know in Discord!
Go SDK support for royalty is coming soon.
Want this feature sooner? Let us know in Discord!
Minting NFTs
With an Edition contract, you choose which wallet addresses are able to mint NFTs into your collection.
By default, only you (the smart contract owner) are able to mint NFTs into the collection.
You can specify which wallets can mint in the Permissions tab of your NFT Collection, under the Creator section.
For more advanced use-cases, such as creating a community-made collection, you can use signature-based minting.
Using the dashboard
For a more in-depth guide on how to create an NFT Collection, check out our guide here Creating an Edition.
Using the thirdweb SDK
Mint One NFT
- Javascript
- React
- Python
- Go
// Address of the wallet you want to mint the NFT to
const toAddress = "{{wallet_address}}"
// Custom metadata of the NFT, note that you can fully customize this metadata with other properties.
const metadata = {
name: "Cool NFT",
description: "This is a cool NFT",
image: fs.readFileSync("path/to/image.png"), // This can be an image url or file
}
const metadataWithSupply = {
metadata,
supply: 1000, // The number of this NFT you want to mint
}
const tx = await contract.mintTo(toAddress, metadataWithSupply);
const receipt = tx.receipt; // the transaction receipt
const tokenId = tx.id; // the id of the NFT minted
const nft = await tx.data(); // (optional) fetch details of minted NFT
React SDK support for mintTo is coming soon.
Want this feature sooner? Let us know in Discord!
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_to("{{wallet_address}}", metadata_with_supply)
receipt = tx.receipt
token_id = tx.id
nft = tx.data()
Go SDK support for mintTo is coming soon.
Want this feature sooner? Let us know in Discord!
Mint Many NFTs (Batch Mint)
- Javascript
- React
- Python
- Go
// Address of the wallet you want to mint the NFT to
const toAddress = "{{wallet_address}}"
// Custom metadata and supplies of your NFTs
const metadataWithSupply = [{
supply: 50, // The number of this NFT you want to mint
metadata: {
name: "Cool NFT #1",
description: "This is a cool NFT",
image: fs.readFileSync("path/to/image.png"), // This can be an image url or file
},
}, {
supply: 100,
metadata: {
name: "Cool NFT #2",
description: "This is a cool NFT",
image: fs.readFileSync("path/to/image.png"), // This can be an image url or file
},
}];
const tx = await contract.mintBatchTo(toAddress, metadataWithSupply);
const receipt = tx[0].receipt; // same transaction receipt for all minted NFTs
const firstTokenId = tx[0].id; // token id of the first minted NFT
const firstNFT = await tx[0].data(); // (optional) fetch details of the first minted NFT
React SDK support for mintBatchTo is coming soon.
Want this feature sooner? Let us know in Discord!
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_to("{{wallet_address}}", metadata_with_supply)
receipt = txs[0].receipt
token_id = txs[0].id
nft = txs[0].data()
Go SDK support for mintBatchTo is coming soon.
Want this feature sooner? Let us know in Discord!
Mint One NFT
- Javascript
- React
- Python
- Go
// Address of the wallet you want to mint the NFT to
const toAddress = "{{wallet_address}}"
// Custom metadata of the NFT, note that you can fully customize this metadata with other properties.
const metadata = {
name: "Cool NFT",
description: "This is a cool NFT",
image: fs.readFileSync("path/to/image.png"), // This can be an image url or file
}
const metadataWithSupply = {
metadata,
supply: 1000, // The number of this NFT you want to mint
}
const tx = await contract.mintTo(toAddress, metadataWithSupply);
const receipt = tx.receipt; // the transaction receipt
const tokenId = tx.id; // the id of the NFT minted
const nft = await tx.data(); // (optional) fetch details of minted NFT
React SDK support for mintTo is coming soon.
Want this feature sooner? Let us know in Discord!
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_to("{{wallet_address}}", metadata_with_supply)
receipt = tx.receipt
token_id = tx.id
nft = tx.data()
Go SDK support for mintTo is coming soon.
Want this feature sooner? Let us know in Discord!
Mint Many NFTs (Batch Mint)
- Javascript
- React
- Python
- Go
// Address of the wallet you want to mint the NFT to
const toAddress = "{{wallet_address}}"
// Custom metadata and supplies of your NFTs
const metadataWithSupply = [{
supply: 50, // The number of this NFT you want to mint
metadata: {
name: "Cool NFT #1",
description: "This is a cool NFT",
image: fs.readFileSync("path/to/image.png"), // This can be an image url or file
},
}, {
supply: 100,
metadata: {
name: "Cool NFT #2",
description: "This is a cool NFT",
image: fs.readFileSync("path/to/image.png"), // This can be an image url or file
},
}];
const tx = await contract.mintBatchTo(toAddress, metadataWithSupply);
const receipt = tx[0].receipt; // same transaction receipt for all minted NFTs
const firstTokenId = tx[0].id; // token id of the first minted NFT
const firstNFT = await tx[0].data(); // (optional) fetch details of the first minted NFT
React SDK support for mintBatchTo is coming soon.
Want this feature sooner? Let us know in Discord!
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_to("{{wallet_address}}", metadata_with_supply)
receipt = txs[0].receipt
token_id = txs[0].id
nft = txs[0].data()
Go SDK support for mintBatchTo is coming soon.
Want this feature sooner? Let us know in Discord!
Airdrop NFTs
Airdropping means you send a wallet or a list of wallets a configurable quantity of your NFT.
Using the dashboard
Using the thirdweb dashboard, you can upload a .csv
file containing a list of addresses you want to airdrop NFTs to.
You can download our example .csv
file for airdrops here.
In the csv
file you must specify an address
column and a quantity
column; representing the address you want to send the NFTs to, and how many you wish to send.
Using the thirdweb SDK
- Javascript
- React
- Python
- Go
// Array of objects of addresses and quantities to airdrop NFTs to
const addresses = [
{
address: "0x...",
quantity: 2,
},
{
address: "0x...",
quantity: 3,
},
];
const tokenId = "0";
await contract.airdrop(addresses, tokenId);
// You can also pass an array of addresses, it will airdrop 1 NFT per address
const addresses = [
"0x...", "0x...", "0x...",
]
const tokenId = "0";
await contract.airdrop(addresses, tokenId);
React SDK support for airdrop is coming soon.
Want this feature sooner? Let us know in Discord!
Python SDK support for airdrop is coming soon.
Want this feature sooner? Let us know in Discord!
Go SDK support for airdrop is coming soon.
Want this feature sooner? Let us know in Discord!
Viewing NFTs
Our SDKs provide helpful ways to view the NFTs in your collection.
One NFT
- Javascript
- React
- Python
- Go
const nft = await contract.get("0");
React SDK support for get is coming soon.
Want this feature sooner? Let us know in Discord!
nft = contract.get(0)
print(nft)
nft, err := contract.Get(0)
All NFTs
- Javascript
- React
- Python
- Go
const nfts = await contract.getAll();
React SDK support for getAll is coming soon.
Want this feature sooner? Let us know in Discord!
metadatas = contract.get_all()
print(metadatas)
nfts, err := contract.GetAll()
supplyOne := nfts[0].Supply
nameOne := nfts[0].Metadata.Name
NFTs owned by a specific wallet
- Javascript
- React
- Python
- Go
// Address of the wallet to get the NFTs of
const address = "{{wallet_address}}";
const nfts = await contract.getOwned(address);
React SDK support for getOwned is coming soon.
Want this feature sooner? Let us know in Discord!
address = "{{wallet_address}}"
owned = contract.get_owned(address)
print(owned)
owner := "{{wallet_address}}"
nfts, err := contract.GetOwned(owner)
name := nfts[0].Metadata.Name
Amount of tokens owned by a specific wallet
- Javascript
- React
- Python
- Go
// Address of the wallet to check NFT balance
const walletAddress = "{{wallet_address}}";
const tokenId = 0; // Id of the NFT to check
const balance = await contract.balanceOf(walletAddress, tokenId);
React SDK support for balanceOf is coming soon.
Want this feature sooner? Let us know in Discord!
address = "{{wallet_address}}"
token_id = 0
balance = contract.balance_of(address, token_id)
address := "{{wallet_address}}"
tokenId := 0
balance, err := contract.BalanceOf(address, tokenId)
Transferring NFTs
Transferring NFTs means you can send this NFT to another wallet. You must be the owner of the NFT you're trying to transfer in order for this to be successful.
- Javascript
- React
- Python
- Go
// Address of the wallet you want to send the NFT to
const toAddress = "{{wallet_address}}";
const tokenId = "0"; // The token ID of the NFT you want to send
const amount = 3; // How many copies of the NFTs to transfer
await contract.transfer(toAddress, tokenId, amount);
React SDK support for transfer is coming soon.
Want this feature sooner? Let us know in Discord!
to = "{{wallet_address}}"
token_id = 0
amount = 1
receipt = contract.transfer(to, token_id, amount)
to := "0x..."
tokenId := 0
amount := 1
tx, err := contract.Transfer(to, tokenId, amount)
Burning NFTs
Burning is the process of removing the token from circulation by sending it to an inaccessible address. It does not delete the token from the blockchain.
Using the dashboard
Using the SDK
- Javascript
- React
- Python
- Go
const result = await contract.burn(tokenId, amount);
React SDK support for burn is coming soon.
Want this feature sooner? Let us know in Discord!
Python SDK support for burn is coming soon.
Want this feature sooner? Let us know in Discord!
tokenId := 0
amount := 1
tx, err := contract.Burn(tokenId, amount)