MetaplexAuctionHouseProgram.createAuctionHouse constructor

MetaplexAuctionHouseProgram.createAuctionHouse({
  1. required MetaplexAuctionHouseCreateAuctionHouseLayout layout,
  2. required SolAddress treasuryMint,
  3. required SolAddress payer,
  4. required SolAddress authority,
  5. required SolAddress feeWithdrawalDestination,
  6. required SolAddress treasuryWithdrawalDestination,
  7. required SolAddress treasuryWithdrawalDestinationOwner,
  8. required SolAddress auctionHouse,
  9. required SolAddress auctionHouseFeeAccount,
  10. required SolAddress auctionHouseTreasury,
  11. SolAddress tokenProgram = SPLTokenProgramConst.tokenProgramId,
  12. SolAddress systemProgram = SystemProgramConst.programId,
  13. SolAddress associatedTokenProgramId = AssociatedTokenAccountProgramConst.associatedTokenProgramId,
  14. SolAddress rent = SystemProgramConst.sysvarRentPubkey,
})

Create a new Auction House instance.

Implementation

factory MetaplexAuctionHouseProgram.createAuctionHouse({
  required MetaplexAuctionHouseCreateAuctionHouseLayout layout,

  /// Treasury mint account, either native SOL mint or a SPL token mint.
  required SolAddress treasuryMint,

  /// Key paying SOL fees for setting up the Auction House.
  required SolAddress payer,

  /// Authority key for the Auction House.
  required SolAddress authority,

  /// Account that pays for fees if the marketplace executes sales.
  required SolAddress feeWithdrawalDestination,

  /// SOL or SPL token account to receive Auction House fees. If treasury mint is native this will be the same as the `treasury_withdrawl_destination_owner`.
  required SolAddress treasuryWithdrawalDestination,

  /// Owner of the `treasury_withdrawal_destination` account or the same address if the `treasury_mint` is native.
  required SolAddress treasuryWithdrawalDestinationOwner,

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

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

  /// Auction House instance treasury PDA account.
  required SolAddress auctionHouseTreasury,
  SolAddress tokenProgram = SPLTokenProgramConst.tokenProgramId,
  SolAddress systemProgram = SystemProgramConst.programId,
  SolAddress associatedTokenProgramId =
      AssociatedTokenAccountProgramConst.associatedTokenProgramId,
  SolAddress rent = SystemProgramConst.sysvarRentPubkey,
}) {
  return MetaplexAuctionHouseProgram(keys: [
    treasuryMint.toReadOnly(),
    payer.toSignerAndWritable(),
    authority.toReadOnly(),
    feeWithdrawalDestination.toWritable(),
    treasuryWithdrawalDestination.toWritable(),
    treasuryWithdrawalDestinationOwner.toReadOnly(),
    auctionHouse.toWritable(),
    auctionHouseFeeAccount.toWritable(),
    auctionHouseTreasury.toWritable(),
    tokenProgram.toReadOnly(),
    systemProgram.toReadOnly(),
    associatedTokenProgramId.toReadOnly(),
    rent.toReadOnly(),
  ], programId: MetaplexAuctionHouseProgramConst.programId, layout: layout);
}