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

import * as _m0 from "protobufjs/minimal";
import { createProtobufRpcClient } from "@cosmjs/stargate";
import { QueryParamsRequest, QueryParamsResponse, GetAuthenticatorRequest, GetAuthenticatorResponse, GetAuthenticatorsRequest, GetAuthenticatorsResponse } from "./query";
/** Query defines the gRPC querier service. */

export class QueryClientImpl {
  constructor(rpc) {
    _defineProperty(this, "rpc", void 0);
    this.rpc = rpc;
    this.params = this.params.bind(this);
    this.getAuthenticator = this.getAuthenticator.bind(this);
    this.getAuthenticators = this.getAuthenticators.bind(this);
  }
  params(request = {}) {
    const data = QueryParamsRequest.encode(request).finish();
    const promise = this.rpc.request("ixo.smartaccount.v1beta1.Query", "Params", data);
    return promise.then(data => QueryParamsResponse.decode(new _m0.Reader(data)));
  }
  getAuthenticator(request) {
    const data = GetAuthenticatorRequest.encode(request).finish();
    const promise = this.rpc.request("ixo.smartaccount.v1beta1.Query", "GetAuthenticator", data);
    return promise.then(data => GetAuthenticatorResponse.decode(new _m0.Reader(data)));
  }
  getAuthenticators(request) {
    const data = GetAuthenticatorsRequest.encode(request).finish();
    const promise = this.rpc.request("ixo.smartaccount.v1beta1.Query", "GetAuthenticators", data);
    return promise.then(data => GetAuthenticatorsResponse.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);
    },
    getAuthenticator(request) {
      return queryService.getAuthenticator(request);
    },
    getAuthenticators(request) {
      return queryService.getAuthenticators(request);
    }
  };
};