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

关于取消Metaplex Auctioneer创建的英式拍卖的技术问题咨询

Great question—let's break this down step by step since auctioneer-managed English auctions have subtle differences from standard Auction House listings.


1. Can You Cancel an English Auction Created via Auctioneer.createSellInstruction?

Yes, you can cancel these listings, but you need to fix two key issues from your failed attempt:

Fixing the AccountOwnedByWrongProgram Error

The error you saw (TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA vs 11111111111111111111111111111111) means you passed an invalid tokenAccount parameter. For cancel instructions, this account must be the seller's actual token account (owned by the official Token program), not a system account or other unrelated address.

Correct Cancel Instruction Parameters

Since English auctions don't use a fixed buyerPrice, you were right to use the u64 maximum value (18446744073709551615n)—this matches the buyerPrice used to create the initial sellerTradeState for the auction. Here's a corrected example of the cancel instruction:

// Reuse accounts from your original createSell call, with critical checks
const cancelAccounts = {
  auctionHouseProgram,
  wallet: sellerWallet, // Must be the original seller's wallet
  tokenAccount: sellerTokenAccount, // Verify this is owned by TokenkegQfe...
  metadata,
  authority: auctionHouseAuthority,
  auctionHouse,
  auctionHouseFeeAccount,
  sellerTradeState: existingTradeState, // Exact trade state from the initial listing
  freeSellerTradeState: existingFreeTradeState,
  auctioneerAuthority,
  ahAuctioneerPda,
  programAsSigner,
};

const cancelArgs = {
  buyerPrice: 18446744073709551615n, // Match the value used to create the trade state
  tokenSize: tokenSizeUsedInCreate, // Must match the token amount from your initial listing
};

const cancelIx = Auctioneer.createCancelInstruction(cancelAccounts, cancelArgs);

2. Creating a ListingReceipt for English Auctions

You absolutely can generate a ListingReceipt to track creation/cancel dates and other metadata. To do this:

  • Generate the listingReceipt PDA using seeds: ["listing_receipt", auctionHouse.address, sellerTradeState.address]
  • Include this account as an optional parameter in your original Auctioneer.createSellInstruction call.

Example snippet for including the receipt on creation:

import { findListingReceiptPda } from "@metaplex-foundation/mpl-auction-house";

// Generate the receipt PDA
const listingReceipt = findListingReceiptPda(auctionHouse.address, sellerTradeState.address);

// Add it to your createSell accounts
const createSellAccounts = {
  // ... all your original accounts
  listingReceipt,
};

const createSellIx = Auctioneer.createSellInstruction(createSellAccounts, args);

When you cancel the auction, you can either update this receipt's state to mark it as canceled or create a separate CancelReceipt PDA for audit trails.


3. Fixing "Address Already in Use" Errors When Re-Listing

This error happens because the old sellerTradeState or ListingReceipt accounts from the expired auction are still active and occupying their addresses. To resolve this:

  1. First confirm the auction has ended (check the endTime parameter from your initial listing).
  2. Run the cancel instruction outlined above to close the existing sellerTradeState account and free up the address.
  3. Once the cancel transaction confirms, you'll be able to create a new English auction for the same token without conflicts.

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.04.27 20:37:34