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

import * as _m0 from "protobufjs/minimal";
import { createProtobufRpcClient } from "@cosmjs/stargate";
import { QueryParamsRequest, QueryParamsResponse, QueryEntityRequest, QueryEntityResponse, QueryEntityMetadataRequest, QueryEntityMetadataResponse, QueryEntityIidDocumentRequest, QueryEntityIidDocumentResponse, QueryEntityVerifiedRequest, QueryEntityVerifiedResponse, QueryEntityListRequest, QueryEntityListResponse } 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.entity = this.entity.bind(this);
    this.entityMetaData = this.entityMetaData.bind(this);
    this.entityIidDocument = this.entityIidDocument.bind(this);
    this.entityVerified = this.entityVerified.bind(this);
    this.entityList = this.entityList.bind(this);
  }
  params(request = {}) {
    const data = QueryParamsRequest.encode(request).finish();
    const promise = this.rpc.request("ixo.entity.v1beta1.Query", "Params", data);
    return promise.then(data => QueryParamsResponse.decode(new _m0.Reader(data)));
  }
  entity(request) {
    const data = QueryEntityRequest.encode(request).finish();
    const promise = this.rpc.request("ixo.entity.v1beta1.Query", "Entity", data);
    return promise.then(data => QueryEntityResponse.decode(new _m0.Reader(data)));
  }
  entityMetaData(request) {
    const data = QueryEntityMetadataRequest.encode(request).finish();
    const promise = this.rpc.request("ixo.entity.v1beta1.Query", "EntityMetaData", data);
    return promise.then(data => QueryEntityMetadataResponse.decode(new _m0.Reader(data)));
  }
  entityIidDocument(request) {
    const data = QueryEntityIidDocumentRequest.encode(request).finish();
    const promise = this.rpc.request("ixo.entity.v1beta1.Query", "EntityIidDocument", data);
    return promise.then(data => QueryEntityIidDocumentResponse.decode(new _m0.Reader(data)));
  }
  entityVerified(request) {
    const data = QueryEntityVerifiedRequest.encode(request).finish();
    const promise = this.rpc.request("ixo.entity.v1beta1.Query", "EntityVerified", data);
    return promise.then(data => QueryEntityVerifiedResponse.decode(new _m0.Reader(data)));
  }
  entityList(request = {
    pagination: undefined
  }) {
    const data = QueryEntityListRequest.encode(request).finish();
    const promise = this.rpc.request("ixo.entity.v1beta1.Query", "EntityList", data);
    return promise.then(data => QueryEntityListResponse.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);
    },
    entity(request) {
      return queryService.entity(request);
    },
    entityMetaData(request) {
      return queryService.entityMetaData(request);
    },
    entityIidDocument(request) {
      return queryService.entityIidDocument(request);
    },
    entityVerified(request) {
      return queryService.entityVerified(request);
    },
    entityList(request) {
      return queryService.entityList(request);
    }
  };
};