MetaplexAuctioneerProgram.executeSale constructor

MetaplexAuctioneerProgram.executeSale({
  1. required SolAddress auctionHouseProgram,
  2. required SolAddress listingConfig,
  3. required SolAddress buyer,
  4. required SolAddress seller,
  5. required SolAddress tokenAccount,
  6. required SolAddress tokenMint,
  7. required SolAddress metadata,
  8. required SolAddress treasuryMint,
  9. required SolAddress escrowPaymentAccount,
  10. required SolAddress sellerPaymentReceiptAccount,
  11. required SolAddress buyerReceiptTokenAccount,
  12. required SolAddress authority,
  13. required SolAddress auctionHouse,
  14. required SolAddress auctionHouseFeeAccount,
  15. required SolAddress auctionHouseTreasury,
  16. required SolAddress buyerTradeState,
  17. required SolAddress sellerTradeState,
  18. required SolAddress freeTradeState,
  19. required SolAddress auctioneerAuthority,
  20. required SolAddress ahAuctioneerPda,
  21. required SolAddress programAsSigner,
  22. required MetaplexAuctioneerExecuteSaleLayout layout,
  23. SolAddress tokenProgramId = SPLTokenProgramConst.tokenProgramId,
  24. SolAddress systemProgram = SystemProgramConst.programId,
  25. SolAddress rent = SystemProgramConst.sysvarRentPubkey,
  26. 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);
}