MetaplexAuctionHouseProgram.buy constructor
MetaplexAuctionHouseProgram.buy({
- 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 MetaplexAuctionHouseBuyLayout layout,
- SolAddress tokenProgram = 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 MetaplexAuctionHouseProgram.buy({
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 MetaplexAuctionHouseBuyLayout layout,
SolAddress tokenProgram = SPLTokenProgramConst.tokenProgramId,
SolAddress systemProgram = SystemProgramConst.programId,
SolAddress rent = SystemProgramConst.sysvarRentPubkey,
}) {
return MetaplexAuctionHouseProgram(keys: [
wallet.toSigner(),
paymentAccount.toWritable(),
transferAuthority.toReadOnly(),
treasuryMint.toReadOnly(),
tokenAccount.toReadOnly(),
metadata.toReadOnly(),
escrowPaymentAccount.toWritable(),
authority.toReadOnly(),
auctionHouse.toReadOnly(),
auctionHouseFeeAccount.toWritable(),
buyerTradeState.toWritable(),
tokenProgram.toReadOnly(),
systemProgram.toReadOnly(),
rent.toReadOnly()
], programId: MetaplexAuctionHouseProgramConst.programId, layout: layout);
}