Collection Config

Once you have a marketplace config initialized, set up a collection NFT that will be used with the marketplace with initCollectionConfig.

This only needs to be done once per collection

Create a collection NFT

Use the marketplace authority keypair to create a new collection NFT. We recommend using the @metaplex-foundation/js library for this.

import {Metaplex, keypairIdentity} from "@metaplex-foundation/js";

const metaplex = new Metaplex(connection).use(keypairIdentity(marketplaceAuthorityKey));
await metaplex.nfts().create({
  name: COLLECTION_NAME,
  symbol: COLLECTION_SYMBOL,
  uri: COLLECTION_METADATA_URI,
  sellerFeeBasisPoints: COLLECTION_ROYALTY_BPS,
  creators: [{
    address: marketplaceAuthorityKey.publicKey,
    share: 100
  }],
  isCollection: true,
  useNewMint: mintKeypair, // Optional, if you have a pre-generated keypair to use
  mintAuthority: marketplaceAuthorityKey,
}, {
  commitment: "finalized"
})

Initialize Collection Config

The collection config will be used to verify that NFTs listed on Carbon were created by you. The sellerFeeBasisPoints and symbol will also be used for all newly minted items via buyVirtual.

await carbon.methods.initCollectionConfig({
  args: {
    collectionMint: collectionMintAddress,
    sellerFeeBasisPoints: COLLECTION_ROYALTY_BPS,
    symbol: COLLECTION_SYMBOL
  }
})

Last updated