MetaplexAuctionHouseProgram.publicBuy constructor
MetaplexAuctionHouseProgram.publicBuy({
- 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 MetaplexAuctionHousePublicBuyLayout layout,
- SolAddress tokenProgram = SPLTokenProgramConst.tokenProgramId,
- SolAddress systemProgram = SystemProgramConst.programId,
- SolAddress rent = SystemProgramConst.sysvarRentPubkey,
Create a public buy bid by creating a public_buyer_trade_state
account and an escrow_payment
account and funding the escrow with the necessary SOL or SPL token amount.
Implementation
factory MetaplexAuctionHouseProgram.publicBuy({
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 MetaplexAuctionHousePublicBuyLayout 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);
}