Justin
Justin

Reputation: 3039

Add NFT to Collection on solana

I'm trying to add an existing NFT on solana to a metaplex certified collection but a little stumped as the API isn't that well documented.

I'm fairly certain this call below is what i need to use. Based on what I can infer from the docs here https://docs.metaplex.com/programs/token-metadata/changelog/v1.1.

Several of of the items in the object are unclear, here's the code with the types:

    let tx = new Transaction().add(
      createVerifyCollectionInstruction({
        metadata: web3.PublicKey,            (?)
        collectionAuthority: web3.PublicKey, (?)
        payer: wallet.PublicKey,             (obvious)
        collectionMint: web3.PublicKey,      (nft to be added)
        collection: web3.PublicKey,          (collection public key)
        collectionMasterEditionAccount: web3.PublicKey,   (?)
      }),
    );

I have some idea of whats got to happen here but still fuzzy on others, could someone breakdown each of these params? Thanks for any insight!

Upvotes: 0

Views: 1002

Answers (1)

ProfLupin
ProfLupin

Reputation: 306

You should use SetAndVerifyCollection instruction to set and verify the collection, both: https://docs.metaplex.com/programs/token-metadata/instructions#set-and-verify-the-collection

Metadata: Every NFT has on-chain and off-chain metadata, and this attribute points to the account that stores the on-chain metadata of the given NFT. You can read more about this account here: https://docs.metaplex.com/programs/token-metadata/accounts#metadata

Collection Authority: Refers to the collection's update authority. If you have the authority of the candy machine using which you minted the collection, this is what it refers to. You can read more about the account here: https://docs.metaplex.com/programs/token-metadata/accounts#collection-authority-record

Collection MasterEdition Account: If you used a MasterEdition to mint out editions, you will need to specify this (optional). Can read more about this account here: https://docs.metaplex.com/programs/token-metadata/accounts#master-edition

Upvotes: 2

Related Questions