import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
export class LCDQueryClient {
  constructor({
    requestClient
  }) {
    _defineProperty(this, "req", void 0);
    this.req = requestClient;
    this.params = this.params.bind(this);
    this.currentValset = this.currentValset.bind(this);
    this.valsetRequest = this.valsetRequest.bind(this);
    this.valsetConfirm = this.valsetConfirm.bind(this);
    this.valsetConfirmsByNonce = this.valsetConfirmsByNonce.bind(this);
    this.lastValsetRequests = this.lastValsetRequests.bind(this);
    this.lastPendingValsetRequestByAddr = this.lastPendingValsetRequestByAddr.bind(this);
    this.lastEventByAddr = this.lastEventByAddr.bind(this);
    this.getPendingSendToEth = this.getPendingSendToEth.bind(this);
    this.batchFees = this.batchFees.bind(this);
    this.outgoingTxBatches = this.outgoingTxBatches.bind(this);
    this.lastPendingBatchRequestByAddr = this.lastPendingBatchRequestByAddr.bind(this);
    this.batchRequestByNonce = this.batchRequestByNonce.bind(this);
    this.batchConfirms = this.batchConfirms.bind(this);
    this.eRC20ToDenom = this.eRC20ToDenom.bind(this);
    this.denomToERC20 = this.denomToERC20.bind(this);
    this.getDelegateKeyByValidator = this.getDelegateKeyByValidator.bind(this);
    this.getDelegateKeyByEth = this.getDelegateKeyByEth.bind(this);
    this.getDelegateKeyByOrchestrator = this.getDelegateKeyByOrchestrator.bind(this);
    this.peggyModuleState = this.peggyModuleState.bind(this);
  }
  /* Deployments queries deployments */

  async params(_params = {}) {
    const endpoint = `peggy/v1/params`;
    return await this.req.get(endpoint);
  }
  /* valset */

  async currentValset(_params = {}) {
    const endpoint = `peggy/v1/valset/current`;
    return await this.req.get(endpoint);
  }
  /* ValsetRequest */

  async valsetRequest(params) {
    const options = {
      params: {}
    };
    if (typeof (params === null || params === void 0 ? void 0 : params.nonce) !== "undefined") {
      options.params.nonce = params.nonce;
    }
    const endpoint = `peggy/v1/valset`;
    return await this.req.get(endpoint, options);
  }
  /* ValsetConfirm */

  async valsetConfirm(params) {
    const options = {
      params: {}
    };
    if (typeof (params === null || params === void 0 ? void 0 : params.nonce) !== "undefined") {
      options.params.nonce = params.nonce;
    }
    if (typeof (params === null || params === void 0 ? void 0 : params.address) !== "undefined") {
      options.params.address = params.address;
    }
    const endpoint = `peggy/v1/valset/confirm`;
    return await this.req.get(endpoint, options);
  }
  /* ValsetConfirmsByNonce */

  async valsetConfirmsByNonce(params) {
    const endpoint = `peggy/v1/confirms/${params.nonce}`;
    return await this.req.get(endpoint);
  }
  /* LastValsetRequests */

  async lastValsetRequests(_params = {}) {
    const endpoint = `peggy/v1/valset/requests`;
    return await this.req.get(endpoint);
  }
  /* LastPendingValsetRequestByAddr */

  async lastPendingValsetRequestByAddr(params) {
    const options = {
      params: {}
    };
    if (typeof (params === null || params === void 0 ? void 0 : params.address) !== "undefined") {
      options.params.address = params.address;
    }
    const endpoint = `peggy/v1/valset/last`;
    return await this.req.get(endpoint, options);
  }
  /* claim */

  async lastEventByAddr(params) {
    const endpoint = `peggy/v1/oracle/event/${params.address}`;
    return await this.req.get(endpoint);
  }
  /* batch */

  async getPendingSendToEth(params) {
    const options = {
      params: {}
    };
    if (typeof (params === null || params === void 0 ? void 0 : params.senderAddress) !== "undefined") {
      options.params.sender_address = params.senderAddress;
    }
    const endpoint = `peggy/v1/pending_send_to_eth`;
    return await this.req.get(endpoint, options);
  }
  /* BatchFees */

  async batchFees(_params = {}) {
    const endpoint = `peggy/v1/batchfees`;
    return await this.req.get(endpoint);
  }
  /* OutgoingTxBatches */

  async outgoingTxBatches(_params = {}) {
    const endpoint = `peggy/v1/batch/outgoingtx`;
    return await this.req.get(endpoint);
  }
  /* LastPendingBatchRequestByAddr */

  async lastPendingBatchRequestByAddr(params) {
    const options = {
      params: {}
    };
    if (typeof (params === null || params === void 0 ? void 0 : params.address) !== "undefined") {
      options.params.address = params.address;
    }
    const endpoint = `peggy/v1/batch/last`;
    return await this.req.get(endpoint, options);
  }
  /* BatchRequestByNonce */

  async batchRequestByNonce(params) {
    const options = {
      params: {}
    };
    if (typeof (params === null || params === void 0 ? void 0 : params.nonce) !== "undefined") {
      options.params.nonce = params.nonce;
    }
    if (typeof (params === null || params === void 0 ? void 0 : params.contractAddress) !== "undefined") {
      options.params.contract_address = params.contractAddress;
    }
    const endpoint = `peggy/v1/batch`;
    return await this.req.get(endpoint, options);
  }
  /* BatchConfirms */

  async batchConfirms(params) {
    const options = {
      params: {}
    };
    if (typeof (params === null || params === void 0 ? void 0 : params.nonce) !== "undefined") {
      options.params.nonce = params.nonce;
    }
    if (typeof (params === null || params === void 0 ? void 0 : params.contractAddress) !== "undefined") {
      options.params.contract_address = params.contractAddress;
    }
    const endpoint = `peggy/v1/batch/confirms`;
    return await this.req.get(endpoint, options);
  }
  /* ERC20ToDenom */

  async eRC20ToDenom(params) {
    const options = {
      params: {}
    };
    if (typeof (params === null || params === void 0 ? void 0 : params.erc20) !== "undefined") {
      options.params.erc20 = params.erc20;
    }
    const endpoint = `peggy/v1/cosmos_originated/erc20_to_denom`;
    return await this.req.get(endpoint, options);
  }
  /* DenomToERC20 */

  async denomToERC20(params) {
    const options = {
      params: {}
    };
    if (typeof (params === null || params === void 0 ? void 0 : params.denom) !== "undefined") {
      options.params.denom = params.denom;
    }
    const endpoint = `peggy/v1/cosmos_originated/denom_to_erc20`;
    return await this.req.get(endpoint, options);
  }
  /* GetDelegateKeyByValidator */

  async getDelegateKeyByValidator(params) {
    const options = {
      params: {}
    };
    if (typeof (params === null || params === void 0 ? void 0 : params.validatorAddress) !== "undefined") {
      options.params.validator_address = params.validatorAddress;
    }
    const endpoint = `peggy/v1/query_delegate_keys_by_validator`;
    return await this.req.get(endpoint, options);
  }
  /* GetDelegateKeyByEth */

  async getDelegateKeyByEth(params) {
    const options = {
      params: {}
    };
    if (typeof (params === null || params === void 0 ? void 0 : params.ethAddress) !== "undefined") {
      options.params.eth_address = params.ethAddress;
    }
    const endpoint = `peggy/v1/query_delegate_keys_by_eth`;
    return await this.req.get(endpoint, options);
  }
  /* GetDelegateKeyByOrchestrator */

  async getDelegateKeyByOrchestrator(params) {
    const options = {
      params: {}
    };
    if (typeof (params === null || params === void 0 ? void 0 : params.orchestratorAddress) !== "undefined") {
      options.params.orchestrator_address = params.orchestratorAddress;
    }
    const endpoint = `peggy/v1/query_delegate_keys_by_orchestrator`;
    return await this.req.get(endpoint, options);
  }
  /* Retrieves the entire peggy module's state */

  async peggyModuleState(_params = {}) {
    const endpoint = `peggy/v1/module_state`;
    return await this.req.get(endpoint);
  }
}