简体   繁体   English

Metaplex 拍卖行错误“错误处理指令 0:指令的帐户密钥不足”

[英]Metaplex Auction House Error "Error processing Instruction 0: insufficient account keys for instruction"

I have been trying to run the execute_sale ix from the mpl-auction-house package but I get this error in the logs I have got the sellInstruction and buyInstruction working我一直在尝试从 mpl-auction-house 包中运行 execute_sale ix,但我在日志中收到此错误,我已经让 sellInstruction 和 buyInstruction 工作在此处输入图像描述

This is my Code这是我的代码

  const executeSellInstructionAccounts:ExecuteSaleInstructionAccounts = {
    buyer:buyerwallet.publicKey,
    seller:Sellerwallet.publicKey,
    tokenAccount:tokenAccountKey,
    tokenMint:mint,
    metadata:await getMetadata(mint),
    treasuryMint:new anchor.web3.PublicKey(AuctionHouse.mint),
    auctionHouse:new anchor.web3.PublicKey(AuctionHouse.address),
    auctionHouseFeeAccount:new anchor.web3.PublicKey(AuctionHouse.feeAccount),
    authority:new anchor.web3.PublicKey(AuctionHouse.authority),
    programAsSigner:programAsSigner,
    auctionHouseTreasury:new anchor.web3.PublicKey(AuctionHouse.treasuryAccount),
    buyerReceiptTokenAccount:buyerATA.address,
    sellerPaymentReceiptAccount:Sellerwallet.publicKey,
    buyerTradeState:BuyertradeState,
    escrowPaymentAccount:escrowPaymentAccount,
    freeTradeState:freeTradeState,
    sellerTradeState:SellertradeState,
  }

  const executeSellInstructionArgs:ExecuteSaleInstructionArgs = {
      escrowPaymentBump:escrowBump,
      freeTradeStateBump:freeTradeBump,
      programAsSignerBump:programAsSignerBump,
      buyerPrice:buyPriceAdjusted,
      tokenSize:tokenSizeAdjusted,
  }


  const execute_sale_ix = createExecuteSaleInstruction(
    executeSellInstructionAccounts,executeSellInstructionArgs
  )

  const execute_sale_tx = new anchor.web3.Transaction(
    {
      recentBlockhash: blockhash,
      feePayer: Sellerwallet.publicKey,
    }
  )

  execute_sale_tx.add(execute_sale_ix);

  const execute_sale_res = await sprovider.sendAndConfirm(execute_sale_tx);

There is currently a discrepancy between the published AuctionHouse SDK and the underlying Rust program.目前发布的 AuctionHouse SDK 和底层的 Rust 程序之间存在差异。

The console reference implementation is here: https://github.com/metaplex-foundation/metaplex/blob/master/js/packages/cli/src/auction-house-cli.ts控制台参考实现在这里: https ://github.com/metaplex-foundation/metaplex/blob/master/js/packages/cli/src/auction-house-cli.ts

The console reference implementation works because it loads the idl directly from the chain and is therefore up to date.控制台参考实现之所以有效,是因为它直接从链中加载 idl,因此是最新的。 It bypasses the AuctionHouse SDK completely.它完全绕过了 AuctionHouse SDK。

However, if you're doing this in the browser, you probably don't want to load the IDL from the chain.但是,如果您在浏览器中执行此操作,您可能不想从链中加载 IDL。 You'd need things like a decompression library and that would blow up your package size quite a bit.你需要像解压缩库这样的东西,这会大大增加你的包大小。

To work around this, I've forked metaplex repo here: https://github.com/neftworld/metaplex为了解决这个问题,我在这里分叉了 metaplex 仓库: https ://github.com/neftworld/metaplex

The fork above has the following changes:上面的分叉有以下变化:

  1. Including the IDL definition as a typescript src file (correct as at 30 May 2022)将 IDL 定义包含为 typescript src 文件(截至 2022 年 5 月 30 日正确)
  2. Fetching auctionHouse program from local IDL definition instead getting it from the chain从本地 IDL 定义中获取 auctionHouse 程序,而不是从链中获取它

Hence, you can use this as a base for your web implementation.因此,您可以将其用作 Web 实施的基础。 To make this work on the web, you will need to remove references to keypair - console uses a key pair file - and use the browser wallet to sign the transaction before sending.要在网络上进行这项工作,您需要删除对密钥对的引用——控制台使用密钥对文件——并在发送前使用浏览器钱包对交易进行签名。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 Metaplex Auction House 的拍卖师中执行销售功能的指令需要额外的帐户密钥 - The instruction expected additional account keys in execute sale function in auctioneer of Metaplex Auction House Solana metaplex 拍卖在 ValidateSafetyDepositBoxV2 指令中失败,并显示“向空支付帐户提供了无效的创建者索引” - Solana metaplex auction fails in ValidateSafetyDepositBoxV2 instruction with "Supplied an invalid creator index to empty payment account" 错误处理指令0:账户数据序列化或反序列化失败:未知 - Error processing Instruction 0: Failed to serialize or deserialize account data: Unknown 我的 Token.createMintToInstruction 抛出“错误处理指令 0:指令的帐户数据无效” - My Token.createMintToInstruction is throwing "Error processing instruction 0: invalid account data for instruction" Metaplex Auction house execute_sale 函数抛出错误“程序日志:在'index out of bounds: the len is 0 but index is 0'” - Metaplex Auction house execute_sale function is throwing error " Program log: panicked at 'index out of bounds: the len is 0 but the index is 0'" 初始令牌帐户错误 - “错误处理指令 0:自定义程序错误:0x0” - Init Token Account error - "Error processing Instruction 0: custom program error: 0x0" 部署 Solana 程序时错误处理指令 1? - Error processing Instruction 1 when deploying Solana program? 交易模拟失败:错误处理指令0:使用未经授权的签名者或可写帐户进行跨程序调用 - Transaction simulation failed: Error processing Instruction 0: Cross-program invocation with unauthorized signer or writable account 错误处理指令0:未经授权的签名者或可写帐户的跨程序调用 - Error processing Instruction 0: Cross-program invocation with unauthorized signer or writable account 拍卖行 CLI:我无法执行出售指令来列出我的 NFT - Auction House CLI: I cannot execute the sale instruction to list my NFT
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM