MetaplexAuctioneerProgram.executeSale constructor
MetaplexAuctioneerProgram.executeSale({
- required SolAddress auctionHouseProgram,
- required SolAddress listingConfig,
- required SolAddress buyer,
- required SolAddress seller,
- required SolAddress tokenAccount,
- required SolAddress tokenMint,
- required SolAddress metadata,
- required SolAddress treasuryMint,
- required SolAddress escrowPaymentAccount,
- required SolAddress sellerPaymentReceiptAccount,
- required SolAddress buyerReceiptTokenAccount,
- required SolAddress authority,
- required SolAddress auctionHouse,
- required SolAddress auctionHouseFeeAccount,
- required SolAddress auctionHouseTreasury,
- required SolAddress buyerTradeState,
- required SolAddress sellerTradeState,
- required SolAddress freeTradeState,
- required SolAddress auctioneerAuthority,
- required SolAddress ahAuctioneerPda,
- required SolAddress programAsSigner,
- required MetaplexAuctioneerExecuteSaleLayout layout,
- SolAddress tokenProgramId = SPLTokenProgramConst.tokenProgramId,
- SolAddress systemProgram = SystemProgramConst.programId,
- SolAddress rent = SystemProgramConst.sysvarRentPubkey,
- SolAddress ata = AssociatedTokenAccountProgramConst.associatedTokenProgramId,
Execute sale between provided buyer and seller trade state accounts transferring funds to seller wallet and token to buyer wallet.
Implementation
factory MetaplexAuctioneerProgram.executeSale(
{
/// Auction House Program
required SolAddress auctionHouseProgram,
/// The Listing Config used for listing settings
required SolAddress listingConfig,
/// Buyer user wallet account.
required SolAddress buyer,
/// Seller user wallet account.
required SolAddress seller,
/// Token account where the SPL token is stored.
required SolAddress tokenAccount,
/// Token mint account for the SPL token.
required SolAddress tokenMint,
/// Metaplex metadata account decorating SPL mint account.
required SolAddress metadata,
/// Auction House treasury mint account.
required SolAddress treasuryMint,
/// Buyer escrow payment account.
required SolAddress escrowPaymentAccount,
/// Seller SOL or SPL account to receive payment at.
required SolAddress sellerPaymentReceiptAccount,
/// Buyer SPL token account to receive purchased item at.
required SolAddress buyerReceiptTokenAccount,
/// Auction House instance authority.
required SolAddress authority,
/// Auction House instance PDA account.
required SolAddress auctionHouse,
/// Auction House instance fee account.
required SolAddress auctionHouseFeeAccount,
/// Auction House instance treasury account.
required SolAddress auctionHouseTreasury,
/// Buyer trade state PDA account encoding the buy order.
required SolAddress buyerTradeState,
/// Seller trade state PDA account encoding the sell order.
required SolAddress sellerTradeState,
/// Free seller trade state PDA account encoding a free sell order.
required SolAddress freeTradeState,
/// The auctioneer program PDA running this auction.
required SolAddress auctioneerAuthority,
/// The auctioneer PDA owned by Auction House storing scopes.
required SolAddress ahAuctioneerPda,
required SolAddress programAsSigner,
required MetaplexAuctioneerExecuteSaleLayout layout,
SolAddress tokenProgramId = SPLTokenProgramConst.tokenProgramId,
SolAddress systemProgram = SystemProgramConst.programId,
SolAddress rent = SystemProgramConst.sysvarRentPubkey,
SolAddress ata =
AssociatedTokenAccountProgramConst.associatedTokenProgramId}) {
return MetaplexAuctioneerProgram(keys: [
auctionHouseProgram.toReadOnly(),
listingConfig.toWritable(),
buyer.toWritable(),
seller.toWritable(),
tokenAccount.toWritable(),
tokenMint.toReadOnly(),
metadata.toReadOnly(),
treasuryMint.toReadOnly(),
escrowPaymentAccount.toWritable(),
sellerPaymentReceiptAccount.toWritable(),
buyerReceiptTokenAccount.toWritable(),
authority.toReadOnly(),
auctionHouse.toReadOnly(),
auctionHouseFeeAccount.toWritable(),
auctionHouseTreasury.toWritable(),
buyerTradeState.toWritable(),
sellerTradeState.toWritable(),
freeTradeState.toWritable(),
auctioneerAuthority.toReadOnly(),
ahAuctioneerPda.toReadOnly(),
tokenProgramId.toReadOnly(),
systemProgram.toReadOnly(),
ata.toReadOnly(),
programAsSigner.toReadOnly(),
rent.toReadOnly(),
], programId: MetaplexAuctioneerProgramConst.programId, layout: layout);
}