Protected
Readonly
metaplexYou may use the builders()
client to access the
underlying Transaction Builders of this module.
const buildersClient = metaplex.auctions().builders();
You may use the pdas()
client to build PDAs related to this module.
const pdasClient = metaplex.auctionHouse().pdas();
Creates a bid on a given asset.
You can post a public bid on a non-listed NFT by skipping seller and tokenAccount properties. Public bids are specific to the token itself and not to any specific auction. This means that a bid can stay active beyond the end of an auction and be resolved if it meets the criteria for subsequent auctions of that token.
await metaplex
.auctionHouse()
.bid({ auctionHouse, mintAccount, seller };
Optional
options: OperationOptionsCreates a bid on a given asset and then executes a sale on the created bid and listing.
await metaplex
.auctionHouse()
.buy({ auctionHouse, listing, buyer };
Optional
options: OperationOptionsCancels the user's bid in the given auction house.
await metaplex
.auctionHouse()
.cancelBid({ auctionHouse, bid };
Optional
options: OperationOptionsCancels the user's listing in the given auction house.
await metaplex
.auctionHouse()
.cancelListing({ auctionHouse, listing };
Optional
options: OperationOptionsCreates an Auction House.
await metaplex
.auctionHouse()
.create({ sellerFeeBasisPoints: 500 }); // 5% fee
Provide auctioneerAuthority
in case you want to enable Auctioneer.
await metaplex
.auctionHouse()
.create({ sellerFeeBasisPoints: 500, auctioneerAuthority: mx.identity().publicKey };
Optional
options: OperationOptionsAdds funds to the user's buyer escrow account for the given auction house.
await metaplex
.auctionHouse()
.depositToBuyerAccount({ auctionHouse, buyer, amount };
Optional
options: OperationOptionsExecutes a sale on a given bid and listing.
await metaplex
.auctionHouse()
.executeSale({ auctionHouse, bid, listing };
Optional
options: OperationOptionsFinds an Auction House by its address.
const nft = await metaplex
.auctionHouse()
.findByAddress({ address };
Optional
options: OperationOptionsFinds an Auction House by its creator and treasury mint.
const nft = await metaplex
.auctionHouse()
.findByCreatorAndMint({ creator, treasuryMint };
Optional
options: OperationOptionsFinds a Bid by its receipt address.
const nft = await metaplex
.auctionHouse()
.findBidByReceipt({ receiptAddress, auctionHouse };
Optional
options: OperationOptionsFinds a Bid by its trade state address.
const nft = await metaplex
.auctionHouse()
.findBidByTradeState({ tradeStateAddress, auctionHouse };
Optional
options: OperationOptionsFinds Bids by multiple criteria. You can use any combination of keys.
// Find all bids in an Auction House.
const bids = await metaplex
.auctionHouse()
.findBids({ auctionHouse });
// Find bids by buyer and mint.
const bids = await metaplex
.auctionHouse()
.findBids({ auctionHouse, buyer, mint });
// Find bids by metadata.
const bids = await metaplex
.auctionHouse()
.findBids({ auctionHouse, metadata });
Optional
options: OperationOptionsFinds a Listing by its trade state address.
const nft = await metaplex
.auctionHouse()
.findListingByTradeState({ tradeStateAddress, auctionHouse };
Optional
options: OperationOptionsFinds a Listing by its receipt address.
const nft = await metaplex
.auctionHouse()
.findListingByReceipt({ receiptAddress, auctionHouse };
Optional
options: OperationOptionsFinds Listings by multiple criteria. You can use any combination of keys.
// Find all listings in an Auction House.
const listings = await metaplex
.auctionHouse()
.findListings({ auctionHouse });
// Find listings by seller and mint.
const listings = await metaplex
.auctionHouse()
.findListings({ auctionHouse, seller, mint });
Optional
options: OperationOptionsFinds a Purchase by its trade state address.
const nft = await metaplex
.auctionHouse()
.findPurchaseByTradeState({ sellerTradeState, buyerTradeState, auctionHouse };
Optional
options: OperationOptionsFinds a Purchase by its receipt address.
const nft = await metaplex
.auctionHouse()
.findPurchaseByReceipt({ receiptAddress, auctionHouse };
Optional
options: OperationOptionsFinds Purchases by multiple criteria.
You can use any combination of keys.
Supports only 3 criteria at the same time including
the required auctionHouse
attribute.
// Find all purchases in an Auction House.
const purchases = await metaplex
.auctionHouse()
.findPurchases({ auctionHouse });
// Find purchases by buyer and mint.
const purchases = await metaplex
.auctionHouse()
.findPurchases({ auctionHouse, buyer, mint });
// Find purchases by metadata.
const purchases = await metaplex
.auctionHouse()
.findPurchases({ auctionHouse, metadata });
// Find purchases by seller and buyer.
const purchases = await metaplex
.auctionHouse()
.findPurchases({ auctionHouse, seller, buyer });
Optional
options: OperationOptionsGets the balance of a buyer's escrow account for a given Auction House.
await metaplex
.auctionHouse()
.getBuyerBalance({ auctionHouse, buyerAddress };
Optional
options: OperationOptionsCreates a listing on a given asset.
await metaplex
.auctionHouse()
.list({ auctionHouse, mintAccount };
Optional
options: OperationOptionsTransforms a LazyBid
model into a Bid
model.
const bid = await metaplex
.auctionHouse()
.loadBid({ lazyBid };
Optional
options: OperationOptionsTransforms a LazyListing
model into a Listing
model.
const listing = await metaplex
.auctionHouse()
.loadListing({ lazyListing };
Optional
options: OperationOptionsTransforms a LazyPurchase
model into a Purchase
model.
const purchase = await metaplex
.auctionHouse()
.loadPurchase({ lazyPurchase };
Optional
options: OperationOptionsCreates a listing on a given asset and then executes a sell on the created bid and listing.
await metaplex
.auctionHouse()
.sell({ auctionHouse, bid };
Optional
options: OperationOptionsUpdates an existing Auction House.
await metaplex
.autionHouse()
.update({
auctionHouse,
canChangeSalePrice: true, // Updates the canChangeSalePrice only.
};
Optional
options: OperationOptionsWithdraws funds from the user's buyer escrow account for the given auction house.
await metaplex
.auctionHouse()
.withdrawFromBuyerAccount({ auctionHouse, buyer, amount };
Optional
options: OperationOptionsTransfers funds from Auction House Fee Wallet to the Fee Withdrawal Destination Wallet.
By default Fee Withdrawal Destination Wallet is set to metaplex.identity()
.
await metaplex
.auctionHouse()
.withdrawFromFeeAccount({ auctionHouse, amount };
Optional
options: OperationOptionsTransfers funds from Auction House Treasury Wallet to the Treasury Withdrawal Destination Wallet set on an Auction House creation.
By default Treasury Withdrawal Destination Wallet is set to metaplex.identity()
.
await metaplex
.auctionHouse()
.withdrawFromTreasuryAccount({ auctionHouse, amount };
Optional
options: OperationOptionsGenerated using TypeDoc
This is a client for the Auction House module.
It enables us to interact with the Auction House program in order to create and update Auction House to configure a marketplace as well to allow users to list, bid and execute sales.
You may access this client via the
auctionHouse()
method of yourMetaplex
instance.Example
You can create a new Auction House with minimum input like so. By default, the current identity of the Metaplex instance will be the authority of the Auction House.
See
AuctionHouse The
AuctionHouse
model