I’m struggling with collection verification while creating NFTs. When I use the solana.tokens().generate() method, I keep getting errors even though I’m sure my solana.wallet() has the right permissions for the collection.
Here’s the error I keep seeing:
SolanaError: TokenProgram > Collection Verification Failed
>> Source: Program > TokenProgram [solana...abc123]
>> Issue: Program [TokenProgram] at [sol...abc123] threw error [74]: "Collection Verification Failed"
>> Fix: Review program error details
Caused By: VerificationError: Collection Verification Failed
The weird thing is that when I set verified: false everything works perfectly. So I know my minting setup is correct.
Can you actually add tokens to an existing verified collection using solana.tokens().generate()? If not, what’s the right way to verify the collection right after minting?
I also get this stack trace:
at SolanaClient.handleError (node_modules/@solana/web3/client.js:156:12)
at SolanaClient.processTransaction (node_modules/@solana/web3/client.js:89:15)
at TokenBuilder.execute (node_modules/@solana/web3/builder.js:98:10)
at generateToken (src/token/create.js:34:18)
at mintToken (src/token/create.js:55:8)
hmm that’s interesting - are you using the latest solana web3 SDK? I had the same issues a few months back. Turned out there was a bug in how generate() handled collection verification in older versions.
Also curious about your setup - when you say your wallet has the “right permissions”, are you the original collection creator or did someone delegate authority to you? I’ve noticed verification behaves differently depending on how you got those permissions.
One thing that worked for me: check the collection’s metadata account first. Make sure the authority field actually matches your wallet address. Sometimes what looks like correct permissions in your code doesn’t match what’s on-chain.
What happens if you try minting with verified: false first, then immediately call the verify method in the same transaction bundle? That might help you figure out if it’s a timing issue or actual permissions problem.
Btw, are you testing on devnet or mainnet? Devnet sometimes has weird quirks with collection verification that don’t happen on mainnet.
after minting, you’ll need to sign the verification transaction yourself. the generate() method doesn’t do it automatically for security. just call solana.collections().verify() right after your mint, but double-check that your wallet has the collection authority first.
In order to successfully verify your collection using the generate() method, you must ensure that your wallet is the update authority for the collection. I dealt with a similar issue in the past. Check the collection’s metadata using the solana.nfts().findByMint() function to ensure that the updateAuthority field corresponds to your wallet address for smooth auto-verification during the minting process. If you’re not the update authority, you can either have the update authority sign the transaction, or mint it unverified first and then verify it later, which can be more efficient for error handling. Be mindful that certain collection standards may necessitate additional signatures beyond just the update authority, so verify if your collection requires extra accounts involved in the transaction.