import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
export class LCDQueryClient {
  constructor({
    requestClient
  }) {
    _defineProperty(this, "req", void 0);
    this.req = requestClient;
    this.insuranceParams = this.insuranceParams.bind(this);
    this.insuranceFund = this.insuranceFund.bind(this);
    this.insuranceFunds = this.insuranceFunds.bind(this);
    this.estimatedRedemptions = this.estimatedRedemptions.bind(this);
    this.pendingRedemptions = this.pendingRedemptions.bind(this);
    this.insuranceModuleState = this.insuranceModuleState.bind(this);
  }
  /* Retrieves insurance params */

  async insuranceParams(_params = {}) {
    const endpoint = `injective/insurance/v1beta1/params`;
    return await this.req.get(endpoint);
  }
  /* Retrieves individual insurance fund information from market id */

  async insuranceFund(params) {
    const endpoint = `injective/insurance/v1beta1/insurance_fund/${params.marketId}`;
    return await this.req.get(endpoint);
  }
  /* Retrieves all insurance funds */

  async insuranceFunds(_params = {}) {
    const endpoint = `injective/insurance/v1beta1/insurance_funds`;
    return await this.req.get(endpoint);
  }
  /* Retrives the value of insurance fund share token at current price (not pending redemption) */

  async estimatedRedemptions(params) {
    const options = {
      params: {}
    };
    if (typeof (params === null || params === void 0 ? void 0 : params.marketId) !== "undefined") {
      options.params.marketId = params.marketId;
    }
    if (typeof (params === null || params === void 0 ? void 0 : params.address) !== "undefined") {
      options.params.address = params.address;
    }
    const endpoint = `injective/insurance/v1beta1/estimated_redemptions`;
    return await this.req.get(endpoint, options);
  }
  /* Retrieves pending redemptions' share token at current price */

  async pendingRedemptions(params) {
    const options = {
      params: {}
    };
    if (typeof (params === null || params === void 0 ? void 0 : params.marketId) !== "undefined") {
      options.params.marketId = params.marketId;
    }
    if (typeof (params === null || params === void 0 ? void 0 : params.address) !== "undefined") {
      options.params.address = params.address;
    }
    const endpoint = `injective/insurance/v1beta1/pending_redemptions`;
    return await this.req.get(endpoint, options);
  }
  /* Retrieves the entire insurance module's state */

  async insuranceModuleState(_params = {}) {
    const endpoint = `injective/insurance/v1beta1/module_state`;
    return await this.req.get(endpoint);
  }
}