Skip to main content

Edition Drop

Learn how to interact with your Edition Drop contract in the SDK.

Create an Edition Drop Contract

const sdk = useSDK();

const contractAddress = await sdk.deployer.deployEditionDrop({
name: "My Edition Drop",
primary_sale_recipient: "your-address",
});
View in React SDK Documentation

Getting the contract in your application

To start using your Edition Drop contract inside your application, you need to use its contract address. You can get the contract address from the dashboard.

This feature is missing a code snippet or might not be supported yet.

Check the React SDK Reference for more information.

Reach out on Discord for further assistance!

Lazy Minting Your NFTs

Create a batch of NFTs to be claimed in the future
// 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.createBatch(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
View in React SDK Documentation

Setting Claim Phases

Configure claim conditions for each NFT
const presaleStartTime = new Date();
const publicSaleStartTime = new Date(Date.now() + 60 * 60 * 24 * 1000);
const claimConditions = [
{
startTime: presaleStartTime, // start the presale now
maxQuantity: 2, // limit how many mints for this presale
price: 0.01, // presale price
snapshot: ['0x...', '0x...'], // limit minting to only certain addresses
},
{
startTime: publicSaleStartTime, // 24h after presale, start public sale
price: 0.08, // public sale price
}
]);

const tokenId = 0; // the id of the NFT to set claim conditions on
await contract.claimConditions.set(tokenId, claimConditions);
View in React SDK Documentation

Setting Royalty Fees

Configure royalties
// royalties on the whole contract
contract.royalties.setDefaultRoyaltyInfo({
seller_fee_basis_points: 100, // 1%
fee_recipient: "0x..."
});
// override royalty for a particular token
contract.royalties.setTokenRoyaltyInfo(tokenId, {
seller_fee_basis_points: 500, // 5%
fee_recipient: "0x..."
});
View in React SDK Documentation

Minting / Claiming NFTs

Claim NFTs to a specific Wallet
const address = "{{wallet_address}}"; // address of the wallet you want to claim the NFTs
const tokenId = 0; // the id of the NFT you want to claim
const quantity = 1; // how many NFTs you want to claim

const tx = await contract.claimTo(address, tokenId, quantity);
const receipt = tx.receipt; // the transaction receipt
View in React SDK Documentation

Airdrop NFTs

Airdrop multiple NFTs
// The token ID of the NFT you want to airdrop
const tokenId = "0";
// Array of objects of addresses and quantities to airdrop NFTs to
const addresses = [
{
address: "0x...",
quantity: 2,
},
{
address: "0x...",
quantity: 3,
},
];
await contract.airdrop(tokenId, addresses);

// You can also pass an array of addresses, it will airdrop 1 NFT per address
const tokenId = "0";
const addresses = [
"0x...", "0x...", "0x...",
]
await contract.airdrop(tokenId, addresses);
View in React SDK Documentation

Viewing NFTs

One NFT

Get a single NFT Metadata
const nft = await contract.get("0");
View in React SDK Documentation

All NFTs

Get All Minted NFTs
const nfts = await contract.getAll();
View in React SDK Documentation

NFTs owned by a specific wallet

Get Owned NFTs
// Address of the wallet to get the NFTs of
const address = "{{wallet_address}}";
const nfts = await contract.getOwned(address);
View in React SDK Documentation

Amount of tokens owned by a specific wallet

Get NFT Balance
// 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);
View in React SDK Documentation

Transferring NFTs

Transfer a single NFT
// 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);
View in React SDK Documentation

Burning NFTs

Burn a specified amount of a NFT
const result = await contract.burnTokens(tokenId, amount);
View in React SDK Documentation