[英]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:上面的分叉有以下变化:
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.