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

import * as _m0 from "protobufjs/minimal";
import { createProtobufRpcClient } from "@cosmjs/stargate";
import { QueryIidDocumentsRequest, QueryIidDocumentsResponse, QueryIidDocumentRequest, QueryIidDocumentResponse } from "./query";
/** Query defines the gRPC querier service. */

export class QueryClientImpl {
  constructor(rpc) {
    _defineProperty(this, "rpc", void 0);
    this.rpc = rpc;
    this.iidDocuments = this.iidDocuments.bind(this);
    this.iidDocument = this.iidDocument.bind(this);
  }
  iidDocuments(request = {
    pagination: undefined
  }) {
    const data = QueryIidDocumentsRequest.encode(request).finish();
    const promise = this.rpc.request("ixo.iid.v1beta1.Query", "IidDocuments", data);
    return promise.then(data => QueryIidDocumentsResponse.decode(new _m0.Reader(data)));
  }
  iidDocument(request) {
    const data = QueryIidDocumentRequest.encode(request).finish();
    const promise = this.rpc.request("ixo.iid.v1beta1.Query", "IidDocument", data);
    return promise.then(data => QueryIidDocumentResponse.decode(new _m0.Reader(data)));
  }
}
export const createRpcQueryExtension = base => {
  const rpc = createProtobufRpcClient(base);
  const queryService = new QueryClientImpl(rpc);
  return {
    iidDocuments(request) {
      return queryService.iidDocuments(request);
    },
    iidDocument(request) {
      return queryService.iidDocument(request);
    }
  };
};