MetaplexAuctioneerProgram.sell constructor
MetaplexAuctioneerProgram.sell({
- required SolAddress auctionHouseProgram,
- required SolAddress listingConfig,
- required SolAddress wallet,
- required SolAddress tokenAccount,
- required SolAddress metadata,
- required SolAddress authority,
- required SolAddress auctionHouse,
- required SolAddress auctionHouseFeeAccount,
- required SolAddress sellerTradeState,
- required SolAddress freeSellerTradeState,
- required SolAddress auctioneerAuthority,
- 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,
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);
}