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

创建Metaplex AuctionHouse挂单时遇CreateListingRequiresSignerError报错求助

解决AuctionHouse创建挂单时的CreateListingRequiresSignerError错误

问题原因

你代码中传入的seller参数只是公钥(PublicKey类型),而Metaplex的list方法要求seller必须是一个Signer对象(具备签名能力,可对交易进行授权)。单纯的公钥无法完成签名操作,因此触发了该错误。

解决方案

将seller参数从metaplex.identity().publicKey改为metaplex.identity(),后者是完整的Signer对象,包含签名所需的私钥信息:

const listing = await metaplex2.auctionHouse().list(
  {
    auctionHouse: auction,
    mintAccount: mintAccount,
    price: price,
    seller: metaplex.identity(), // 直接传入Signer对象
  },
  {}
);

额外说明

如果挂单操作需要使用其他身份作为卖家,同样要传入对应的Signer对象而非仅传公钥。比如使用已初始化的钱包实例作为Signer:

// 假设已初始化钱包signer
const sellerSigner = walletAdapter.wallet;
const listing = await metaplex2.auctionHouse().list(
  {
    auctionHouse: auction,
    mintAccount: mintAccount,
    price: price,
    seller: sellerSigner,
  },
  {}
);

内容的提问来源于stack exchange,提问作者Леонид

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.12 15:55:36