I'm working on an NFT project and while I can easily mint an NFT with the Metaplex Token Metadata program (an individual or a collection NFT) I'm struggling somewhat with how to correctly call set_and_verify_collection, in order to verify that the NFT being minted is verified as being part of the collection.
I've been spinning my wheels for the past few days and I suspect that there's something fundamental that I'm missing with how to use this (and/or my understanding of the different accounts/keys required).
My mint function can be found here and as you can see it's similar to numerous examples found online (with a few tweaks). The payer/update authority is my own wallet (again, am trying to keep this as simple as possible in order to get it working). The mint function is passed the pubkey of the collection NFT, too.
Does anyone have a concrete example of how set_and_verify_collection
ought to be invoked?
Thanks!
anchor_spl::metadata
wrapper implementation of the CPI call to make it easier from within an Anchor program. github.com/coral-xyz/anchor/blob/master/spl/src/…