I am looking to setup a collection on the solana blockchain. The idea is that when a real world watch is sold, the buyer receives an nft validiting this purchase with the appropriate metadata (time of purchase, watch details, name etc). However, my question is if it is possible to add new nfts to an already created collection from the same contract as each watch is purchased? Thanks
1 Answer
If i assume you are using the candy machine, no you cannot add NFTs defined by the candy machine ID as the size is predefined on initialization.
If you are talking about the Collection metaplex standard, yes you can add NFTs to a collection at any time.
You can set a collection while minting the NFT with CreateMetadataAccountArgsV3
https://github.com/metaplex-foundation/metaplex-program-library/blob/3a9c68ab8c48318f96379a136feaa9b66c322752/token-metadata/program/src/instruction.rs#L82
then verify it VerifyCollection
https://github.com/metaplex-foundation/metaplex-program-library/blob/3a9c68ab8c48318f96379a136feaa9b66c322752/token-metadata/program/src/instruction.rs#L347
or set and verify on an already created NFT which doesn't have the collection set SetAndVerifyCollection
https://github.com/metaplex-foundation/metaplex-program-library/blob/3a9c68ab8c48318f96379a136feaa9b66c322752/token-metadata/program/src/instruction.rs#L428