MetaplexAuctioneerProgram.buy constructor
MetaplexAuctioneerProgram.buy({
- required SolAddress auctionHouseProgram,
- required SolAddress listingConfig,
- required SolAddress seller,
- required SolAddress wallet,
- required SolAddress paymentAccount,
- required SolAddress transferAuthority,
- required SolAddress treasuryMint,
- required SolAddress tokenAccount,
- required SolAddress metadata,
- required SolAddress escrowPaymentAccount,
- required SolAddress authority,
- required SolAddress auctionHouse,
- required SolAddress auctionHouseFeeAccount,
- required SolAddress buyerTradeState,
- required SolAddress auctioneerAuthority,
- required SolAddress ahAuctioneerPda,
- required MetaplexAuctioneerBuyLayout layout,
- SolAddress tokenProgramId = SPLTokenProgramConst.tokenProgramId,
- SolAddress systemProgram = SystemProgramConst.programId,
- SolAddress rent = SystemProgramConst.sysvarRentPubkey,
Create a private buy bid by creating a buyer_trade_state
account and an escrow_payment
account and funding the escrow with the necessary SOL or SPL token amount.
Implementation
factory MetaplexAuctioneerProgram.buy(
{
/// Auction House Program
required SolAddress auctionHouseProgram,
// Accounts used for Auctioneer
/// The Listing Config used for listing settings
required SolAddress listingConfig,
/// The seller of the NFT
required SolAddress seller,
/// User wallet account.
required SolAddress wallet,
/// User SOL or SPL account to transfer funds from.
required SolAddress paymentAccount,
/// SPL token account transfer authority.
required SolAddress transferAuthority,
/// Auction House instance treasury mint account.
required SolAddress treasuryMint,
/// SPL token account.
required SolAddress tokenAccount,
/// SPL token account metadata.
required SolAddress metadata,
/// Buyer escrow payment account PDA.
required SolAddress escrowPaymentAccount,
/// Auction House instance authority account.
required SolAddress authority,
/// Auction House instance PDA account.
required SolAddress auctionHouse,
/// Auction House instance fee account.
required SolAddress auctionHouseFeeAccount,
/// Buyer trade state PDA.
required SolAddress buyerTradeState,
/// The auctioneer program PDA running this auction.
required SolAddress auctioneerAuthority,
/// The auctioneer PDA owned by Auction House storing scopes.
required SolAddress ahAuctioneerPda,
required MetaplexAuctioneerBuyLayout layout,
SolAddress tokenProgramId = SPLTokenProgramConst.tokenProgramId,
SolAddress systemProgram = SystemProgramConst.programId,
SolAddress rent = SystemProgramConst.sysvarRentPubkey}) {
return MetaplexAuctioneerProgram(keys: [
auctionHouseProgram.toReadOnly(),
listingConfig.toWritable(),
seller.toReadOnly(),
wallet.toSigner(),
paymentAccount.toWritable(),
transferAuthority.toReadOnly(),
treasuryMint.toReadOnly(),
tokenAccount.toReadOnly(),
metadata.toReadOnly(),
escrowPaymentAccount.toWritable(),
authority.toReadOnly(),
auctionHouse.toReadOnly(),
auctionHouseFeeAccount.toWritable(),
buyerTradeState.toWritable(),
auctioneerAuthority.toReadOnly(),
ahAuctioneerPda.toReadOnly(),
tokenProgramId.toReadOnly(),
systemProgram.toReadOnly(),
rent.toReadOnly(),
], programId: MetaplexAuctioneerProgramConst.programId, layout: layout);
}