javascript 创建列表要求签名者错误[MetaplexError]:AuctionHouse>创建物品需要签名人

osh3o9ms  于 2023-02-02  发布在  Java
关注(0)|答案(1)|浏览(93)

我创建了一个列表,但是在传递和创建列表时,出现了一个错误:

CreateListingRequiresSignerError [MetaplexError]: AuctionHouse > Create Listing Requires Signer
>> Source: Plugin > AuctionHouse
>> Problem: You are trying to create a listing without providing a signer.
>> Solution: Either a seller or authority must be a Signer.

    at Object.createListingBuilder (C:\Users\SUMBAR\Visual Studio Code Project\mint-fungible-spl\node_modules\@metaplex-foundation\js\src\plugins\auctionHouseModule\operations\createListing.ts:314:11)
    at AuctionHouseBuildersClient.list (C:\Users\SUMBAR\Visual Studio Code Project\mint-fungible-spl\node_modules\@metaplex-foundation\js\src\plugins\auctionHouseModule\AuctionHouseBuildersClient.ts:100:12)
    at C:\Users\SUMBAR\Visual Studio Code Project\mint-fungible-spl\mint.ts:161:61
    at Generator.next (<anonymous>)
    at C:\Users\SUMBAR\Visual Studio Code Project\mint-fungible-spl\mint.ts:8:71
    at new Promise (<anonymous>)
    at __awaiter (C:\Users\SUMBAR\Visual Studio Code Project\mint-fungible-spl\mint.ts:4:12)
    at createListing (C:\Users\SUMBAR\Visual Studio Code Project\mint-fungible-spl\mint.ts:157:5)
    at C:\Users\SUMBAR\Visual Studio Code Project\mint-fungible-spl\mint.ts:285:9
    at Generator.next (<anonymous>) {
  key: 'metaplex.errors.plugin.auction_house.create_listing_requires_signer',
  title: 'AuctionHouse > Create Listing Requires Signer',
  problem: 'You are trying to create a listing without providing a signer.',
  solution: 'Either a seller or authority must be a Signer.',
  source: 'plugin',
  sourceDetails: 'AuctionHouse',
  cause: undefined,
  logs: undefined
}

下面是代码本身:

const listing = await metaplex2.auctionHouse().list(
    {
      auctionHouse: auction,
      mintAccount: mintAccount,
      price: price,
      seller: metaplex.identity().publicKey,
    },
    {}
  );

我已经尝试了所有方法,但仍然出现此错误

6jjcrrmo

6jjcrrmo1#

下面是适用于我的代码:

await mx.auctionHouse().list({
    auctionHouse, // A model of the Auction House related to this listing
    seller: mx.identity(), // Creator of a listing ----> I was using mx.identity().publicKey and getting the error
    authority: wallet.publicKey, // The Auction House authority
    mintAccount: nftParam.mint.address, // The mint account to create a listing for, used to find the metadata
    tokenAccount: nftParam.address, // The token account address that's associated to the asset a listing created is for
  });

相关问题