import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
//@ts-nocheck

import * as _m0 from "protobufjs/minimal";
import { createProtobufRpcClient } from "@cosmjs/stargate";
import { QueryParamsRequest, QueryParamsResponse, QueryLiquidValidatorsRequest, QueryLiquidValidatorsResponse, QueryStatesRequest, QueryStatesResponse } from "./query";
/** Query defines the gRPC query service for the liquidstake module. */

export class QueryClientImpl {
  constructor(rpc) {
    _defineProperty(this, "rpc", void 0);
    this.rpc = rpc;
    this.params = this.params.bind(this);
    this.liquidValidators = this.liquidValidators.bind(this);
    this.states = this.states.bind(this);
  }
  params(request = {}) {
    const data = QueryParamsRequest.encode(request).finish();
    const promise = this.rpc.request("ixo.liquidstake.v1beta1.Query", "Params", data);
    return promise.then(data => QueryParamsResponse.decode(new _m0.Reader(data)));
  }
  liquidValidators(request = {}) {
    const data = QueryLiquidValidatorsRequest.encode(request).finish();
    const promise = this.rpc.request("ixo.liquidstake.v1beta1.Query", "LiquidValidators", data);
    return promise.then(data => QueryLiquidValidatorsResponse.decode(new _m0.Reader(data)));
  }
  states(request = {}) {
    const data = QueryStatesRequest.encode(request).finish();
    const promise = this.rpc.request("ixo.liquidstake.v1beta1.Query", "States", data);
    return promise.then(data => QueryStatesResponse.decode(new _m0.Reader(data)));
  }
}
export const createRpcQueryExtension = base => {
  const rpc = createProtobufRpcClient(base);
  const queryService = new QueryClientImpl(rpc);
  return {
    params(request) {
      return queryService.params(request);
    },
    liquidValidators(request) {
      return queryService.liquidValidators(request);
    },
    states(request) {
      return queryService.states(request);
    }
  };
};