M2DT
M2DT

Reputation: 165

How can i add a nft to an existing collection

I want to create a collection where i can add nfts manually afterwards. I would like to use the Metaplex sdk, but other libraries are welcome too.

Upvotes: 0

Views: 390

Answers (1)

Mark Sackerberg
Mark Sackerberg

Reputation: 848

There are basically two steps that you have to take:

  1. Create the collection NFT parent (JS SDK Example)
const { nft } = await metaplex.nfts().create({
   uri: "https://arweave.net/123",
   name: "My NFT",
   sellerFeeBasisPoints: 500, // Represents 5.00%.
});

  1. Optional: Migrate to a sized collection (JS SDK API reference)
metaplex
  .nfts()
  .migrateToSizedCollection({ mintAddress, size: toBigNumber(10000) });

  1. Use "set and verify" instruction to assign the NFT to the collection (JS SDK API reference):
metaplex.nfts().verifyCollection({mintAddress, collectionMintAddress,  isSizedCollection: false})

Upvotes: 0

Related Questions