MetaplexAuctioneerProgram.sell constructor

MetaplexAuctioneerProgram.sell({
  1. required SolAddress auctionHouseProgram,
  2. required SolAddress listingConfig,
  3. required SolAddress wallet,
  4. required SolAddress tokenAccount,
  5. required SolAddress metadata,
  6. required SolAddress authority,
  7. required SolAddress auctionHouse,
  8. required SolAddress auctionHouseFeeAccount,
  9. required SolAddress sellerTradeState,
  10. required SolAddress freeSellerTradeState,
  11. required SolAddress auctioneerAuthority,
  12. required SolAddress ahAuctioneerPda,
  13. required SolAddress programAsSigner,
  14. required MetaplexAuctioneerSellLayout layout,
  15. SolAddress tokenProgramId = SPLTokenProgramConst.tokenProgramId,
  16. SolAddress systemProgram = SystemProgramConst.programId,
  17. SolAddress rent = SystemProgramConst.sysvarRentPubkey,
  18. SolAddress ata = AssociatedTokenAccountProgramConst.associatedTokenProgramId,
})

Create a sell bid by creating a seller_trade_state account and approving the program as the token delegate.

Implementation

factory MetaplexAuctioneerProgram.sell(
    {
    /// Auction House Program used for CPI call
    required SolAddress auctionHouseProgram,

    /// The Listing Config used for listing settings
    required SolAddress listingConfig,

    /// User wallet account.
    required SolAddress wallet,

    /// SPL token account containing token for sale.
    required SolAddress tokenAccount,

    /// Metaplex metadata account decorating SPL mint account.
    required SolAddress metadata,

    /// Auction House authority account.
    required SolAddress authority,

    /// Auction House instance PDA account.
    required SolAddress auctionHouse,

    /// Auction House instance fee account.
    required SolAddress auctionHouseFeeAccount,

    /// 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 freeSellerTradeState,

    /// 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 MetaplexAuctioneerSellLayout layout,
    SolAddress tokenProgramId = SPLTokenProgramConst.tokenProgramId,
    SolAddress systemProgram = SystemProgramConst.programId,
    SolAddress rent = SystemProgramConst.sysvarRentPubkey,
    SolAddress ata =
        AssociatedTokenAccountProgramConst.associatedTokenProgramId}) {
  return MetaplexAuctioneerProgram(keys: [
    auctionHouseProgram.toReadOnly(),
    listingConfig.toWritable(),
    wallet.toWritable(),
    tokenAccount.toWritable(),
    metadata.toReadOnly(),
    authority.toReadOnly(),
    auctionHouse.toReadOnly(),
    auctionHouseFeeAccount.toWritable(),
    sellerTradeState.toWritable(),
    freeSellerTradeState.toWritable(),
    auctioneerAuthority.toReadOnly(),
    ahAuctioneerPda.toReadOnly(),
    programAsSigner.toReadOnly(),
    tokenProgramId.toReadOnly(),
    systemProgram.toReadOnly(),
    rent.toReadOnly(),
  ], programId: MetaplexAuctioneerProgramConst.programId, layout: layout);
}