You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用metaplex.nfts().create()添加NFT至认证集合时验证失败求助

Metaplex NFT铸造集合验证问题解决方案

问题重现

使用metaplex.nfts().create()铸造NFT时,尝试关联并验证已有集合(确认metaplex.identity()拥有集合NFT的更新权限),触发以下错误:

MetaplexError: TokenMetadataProgram > Cannot Verify Collection in this Instruction

Source: Program > TokenMetadataProgram [metaqbxx...x1s]
Problem: The program [TokenMetadataProgram] at address [meta...x1s] raised an error of code [74] that translates to "Cannot Verify Collection in this Instruction".
Solution: Check the error message provided by the program.
Caused By: CollectionCannotBeVerifiedInThisInstruction: Cannot Verify Collection in this Instruction

当设置verified: 0时铸造流程正常,仅无法完成集合验证。

核心问题解答

1. 能否通过metaplex.nfts().create()直接将NFT加入已认证集合?

不能。Token Metadata Program的规则限制:创建NFT的指令中无法同时执行集合验证操作,哪怕操作者拥有集合的更新权限也不行。verified:0仅完成集合关联,不触发验证逻辑,因此能成功执行。

2. 铸造完成后立即验证集合的最佳方式

拆分两步操作:先铸造并关联集合,再单独执行集合验证。使用Metaplex JS的nfts().verifyCollection()方法实现,示例代码如下:

// 第一步:铸造NFT,关联集合但不验证
const mintedNft = await metaplex.nfts().create({
  // 填写你的NFT元数据、接收地址等参数
  collection: {
    address: "你的集合NFT mint地址",
    verified: false // 仅关联,不验证
  }
});

// 第二步:铸造完成后立即验证集合
await metaplex.nfts().verifyCollection({
  mintAddress: mintedNft.mint.address,
  collectionMintAddress: "你的集合NFT mint地址"
  // 无需额外指定signer,metaplex.identity()会自动用集合更新权限签名
});

关键注意事项

  • 确认metaplex.identity()的地址是集合NFT的updateAuthority(更新权限持有者)
  • 两步操作可在同一个异步函数内连续执行,Metaplex方法会自动处理交易确认逻辑

完整堆栈信息:

at RpcClient.parseProgramError (file:///.../node_modules/@metaplex-foundation/js/dist/esm/plugins/rpcModule/RpcClient.mjs:206:28)
      at RpcClient.sendTransaction (file:///.../node_modules/@metaplex-foundation/js/dist/esm/plugins/rpcModule/RpcClient.mjs:48:18)
      at processTicksAndRejections (node:internal/process/task_queues:96:5)
      at async RpcClient.sendAndConfirmTransaction (file:///.../node_modules/@metaplex-foundation/js/dist/esm/plugins/rpcModule/RpcClient.mjs:69:23)
      at async TransactionBuilder.sendAndConfirm (file:///.../node_modules/@metaplex-foundation/js/dist/esm/utils/TransactionBuilder.mjs:131:22)
      at async file:///.../node_modules/@metaplex-foundation/js/dist/esm/utils/Task.mjs:58:23
      at async Disposable.run (file:///.../node_modules/@metaplex-foundation/js/dist/esm/utils/Disposable.mjs:22:14)
      at async Task.callback (file:///.../node_modules/@metaplex-foundation/js/dist/esm/plugins/nftModule/NftClient.mjs:48:22)
      at async file:///.../node_modules/@metaplex-foundation/js/dist/esm/utils/Task.mjs:58:23
      at async Disposable.run (file:///.../node_modules/@metaplex-foundation/js/dist/esm/utils/Disposable.mjs:22:14)
      at async mintNft (file:///.../src/mint/mint_lib.js:46:29)
      at async mint (file:///.../src/mint/mint_lib.js:71:12)
      at async Context.<anonymous> (file:///.../test/mint-test.js:27:20)

内容的提问来源于stack exchange,提问作者larry 8

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.21 20:06:22