'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var AuctionHouseBuildersClient = require('./AuctionHouseBuildersClient.cjs');
var AuctionHousePdasClient = require('./AuctionHousePdasClient.cjs');
var createBid = require('./operations/createBid.cjs');
var directBuy = require('./operations/directBuy.cjs');
var cancelBid = require('./operations/cancelBid.cjs');
var cancelListing = require('./operations/cancelListing.cjs');
var createAuctionHouse = require('./operations/createAuctionHouse.cjs');
var depositToBuyerAccount = require('./operations/depositToBuyerAccount.cjs');
var executeSale = require('./operations/executeSale.cjs');
var findAuctionHouseByAddress = require('./operations/findAuctionHouseByAddress.cjs');
var findAuctionHouseByCreatorAndMint = require('./operations/findAuctionHouseByCreatorAndMint.cjs');
var findBidByReceipt = require('./operations/findBidByReceipt.cjs');
var findBidByTradeState = require('./operations/findBidByTradeState.cjs');
var findBidsByPublicKeyField = require('./operations/findBidsByPublicKeyField.cjs');
var findListingByTradeState = require('./operations/findListingByTradeState.cjs');
var findListingByReceipt = require('./operations/findListingByReceipt.cjs');
var findListings = require('./operations/findListings.cjs');
var findPurchaseByTradeState = require('./operations/findPurchaseByTradeState.cjs');
var findPurchaseByReceipt = require('./operations/findPurchaseByReceipt.cjs');
var findPurchasesByPublicKeyField = require('./operations/findPurchasesByPublicKeyField.cjs');
var getBuyerBalance = require('./operations/getBuyerBalance.cjs');
var createListing = require('./operations/createListing.cjs');
var loadBid = require('./operations/loadBid.cjs');
var loadListing = require('./operations/loadListing.cjs');
var loadPurchase = require('./operations/loadPurchase.cjs');
var directSell = require('./operations/directSell.cjs');
var updateAuctionHouse = require('./operations/updateAuctionHouse.cjs');
var withdrawFromBuyerAccount = require('./operations/withdrawFromBuyerAccount.cjs');
var withdrawFromFeeAccount = require('./operations/withdrawFromFeeAccount.cjs');
var withdrawFromTreasuryAccount = require('./operations/withdrawFromTreasuryAccount.cjs');

/**
 * This is a client for the Auction House module.
 *
 * It enables us to interact with the Auction House program in order to
 * create and update Auction House to configure a marketplace as well to allow
 * users to list, bid and execute sales.
 *
 * You may access this client via the `auctionHouse()` method of your `Metaplex` instance.
 *
 * ```ts
 * const auctionHouseClient = metaplex.auctionHouse();
 * ```
 *
 * @example
 * You can create a new Auction House with minimum input like so.
 * By default, the current identity of the Metaplex instance will be
 * the authority of the Auction House.
 *
 * ```ts
 * const { auctionHouse } = await metaplex
 *   .auctionHouse()
 *   .create({
 *     sellerFeeBasisPoints: 500, // 5% royalties
 *   };
 * ```
 *
 * @see {@link AuctionHouse} The `AuctionHouse` model
 * @group Modules
 */
class AuctionHouseClient {
  constructor(metaplex) {
    this.metaplex = metaplex;
  }

  /**
   * You may use the `builders()` client to access the
   * underlying Transaction Builders of this module.
   *
   * ```ts
   * const buildersClient = metaplex.auctions().builders();
   * ```
   */
  builders() {
    return new AuctionHouseBuildersClient.AuctionHouseBuildersClient(this.metaplex);
  }

  /**
   * You may use the `pdas()` client to build PDAs related to this module.
   *
   * ```ts
   * const pdasClient = metaplex.auctionHouse().pdas();
   * ```
   */
  pdas() {
    return new AuctionHousePdasClient.AuctionHousePdasClient(this.metaplex);
  }

  /** {@inheritDoc createBidOperation} */
  bid(input, options) {
    return this.metaplex.operations().execute(createBid.createBidOperation(input), options);
  }

  /** {@inheritDoc buyOperation} */
  buy(input, options) {
    return this.metaplex.operations().execute(directBuy.directBuyOperation(input), options);
  }

  /** {@inheritDoc cancelBidOperation} */
  cancelBid(input, options) {
    return this.metaplex.operations().execute(cancelBid.cancelBidOperation(input), options);
  }

  /** {@inheritDoc cancelListingOperation} */
  cancelListing(input, options) {
    return this.metaplex.operations().execute(cancelListing.cancelListingOperation(input), options);
  }

  /** {@inheritDoc createAuctionHouseOperation} */
  create(input, options) {
    return this.metaplex.operations().execute(createAuctionHouse.createAuctionHouseOperation(input), options);
  }

  /** {@inheritDoc depositToBuyerAccountOperation} */
  depositToBuyerAccount(input, options) {
    return this.metaplex.operations().execute(depositToBuyerAccount.depositToBuyerAccountOperation(input), options);
  }

  /** {@inheritDoc executeSaleOperation} */
  executeSale(input, options) {
    return this.metaplex.operations().execute(executeSale.executeSaleOperation(input), options);
  }

  /** {@inheritDoc findAuctionHouseByAddressOperation} */
  findByAddress(input, options) {
    return this.metaplex.operations().execute(findAuctionHouseByAddress.findAuctionHouseByAddressOperation(input), options);
  }

  /** {@inheritDoc findAuctionHouseByCreatorAndMintOperation} */
  findByCreatorAndMint(input, options) {
    return this.metaplex.operations().execute(findAuctionHouseByCreatorAndMint.findAuctionHouseByCreatorAndMintOperation(input), options);
  }

  /** {@inheritDoc findBidByReceiptOperation} */
  findBidByReceipt(input, options) {
    return this.metaplex.operations().execute(findBidByReceipt.findBidByReceiptOperation(input), options);
  }

  /** {@inheritDoc findBidByTradeStateOperation} */
  findBidByTradeState(input, options) {
    return this.metaplex.operations().execute(findBidByTradeState.findBidByTradeStateOperation(input), options);
  }

  /** {@inheritDoc findBidsByPublicKeyFieldOperation} */
  findBidsBy(input, options) {
    return this.metaplex.operations().execute(findBidsByPublicKeyField.findBidsByPublicKeyFieldOperation(input), options);
  }

  /** {@inheritDoc findListingByTradeStateOperation} */
  findListingByTradeState(input, options) {
    return this.metaplex.operations().execute(findListingByTradeState.findListingByTradeStateOperation(input), options);
  }

  /** {@inheritDoc findListingByReceiptOperation} */
  findListingByReceipt(input, options) {
    return this.metaplex.operations().execute(findListingByReceipt.findListingByReceiptOperation(input), options);
  }

  /** {@inheritDoc findListingsOperation} */
  findListings(input, options) {
    return this.metaplex.operations().execute(findListings.findListingsOperation(input), options);
  }

  /** {@inheritDoc findPurchaseByTradeStateOperation} */
  findPurchaseByTradeState(input, options) {
    return this.metaplex.operations().execute(findPurchaseByTradeState.findPurchaseByTradeStateOperation(input), options);
  }

  /** {@inheritDoc findPurchaseByReceiptOperation} */
  findPurchaseByReceipt(input, options) {
    return this.metaplex.operations().execute(findPurchaseByReceipt.findPurchaseByReceiptOperation(input), options);
  }

  /** {@inheritDoc findPurchasesByPublicKeyFieldOperation} */
  findPurchasesBy(input, options) {
    return this.metaplex.operations().execute(findPurchasesByPublicKeyField.findPurchasesByPublicKeyFieldOperation(input), options);
  }

  /** {@inheritDoc getBuyerBalanceOperation} */
  getBuyerBalance(input, options) {
    return this.metaplex.operations().execute(getBuyerBalance.getBuyerBalanceOperation(input), options);
  }

  /** {@inheritDoc createListingOperation} */
  list(input, options) {
    return this.metaplex.operations().execute(createListing.createListingOperation(input), options);
  }

  /** {@inheritDoc loadBidOperation} */
  loadBid(input, options) {
    return this.metaplex.operations().execute(loadBid.loadBidOperation(input), options);
  }

  /** {@inheritDoc loadListingOperation} */
  loadListing(input, options) {
    return this.metaplex.operations().execute(loadListing.loadListingOperation(input), options);
  }

  /** {@inheritDoc loadPurchaseOperation} */
  loadPurchase(input, options) {
    return this.metaplex.operations().execute(loadPurchase.loadPurchaseOperation(input), options);
  }

  /** {@inheritDoc saleOperation} */
  sell(input, options) {
    return this.metaplex.operations().execute(directSell.directSellOperation(input), options);
  }

  /** {@inheritDoc updateAuctionHouseOperation} */
  update(input, options) {
    return this.metaplex.operations().execute(updateAuctionHouse.updateAuctionHouseOperation(input), options);
  }

  /** {@inheritDoc withdrawFromBuyerAccountOperation} */
  withdrawFromBuyerAccount(input, options) {
    return this.metaplex.operations().execute(withdrawFromBuyerAccount.withdrawFromBuyerAccountOperation(input), options);
  }

  /** {@inheritDoc withdrawFromFeeAccountOperation} */
  withdrawFromFeeAccount(input, options) {
    return this.metaplex.operations().execute(withdrawFromFeeAccount.withdrawFromFeeAccountOperation(input), options);
  }

  /** {@inheritDoc withdrawFromTreasuryAccountOperation} */
  withdrawFromTreasuryAccount(input, options) {
    return this.metaplex.operations().execute(withdrawFromTreasuryAccount.withdrawFromTreasuryAccountOperation(input), options);
  }
}

exports.AuctionHouseClient = AuctionHouseClient;
//# sourceMappingURL=AuctionHouseClient.cjs.map
