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

import * as _m0 from "protobufjs/minimal";
import { createProtobufRpcClient } from "@cosmjs/stargate";
import { QueryParamsRequest, QueryParamsResponse, QueryTokenMetadataRequest, QueryTokenMetadataResponse, QueryTokenListRequest, QueryTokenListResponse, QueryTokenDocRequest, QueryTokenDocResponse } 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.tokenMetadata = this.tokenMetadata.bind(this);
    this.tokenList = this.tokenList.bind(this);
    this.tokenDoc = this.tokenDoc.bind(this);
  }
  params(request = {}) {
    const data = QueryParamsRequest.encode(request).finish();
    const promise = this.rpc.request("ixo.token.v1beta1.Query", "Params", data);
    return promise.then(data => QueryParamsResponse.decode(new _m0.Reader(data)));
  }
  tokenMetadata(request) {
    const data = QueryTokenMetadataRequest.encode(request).finish();
    const promise = this.rpc.request("ixo.token.v1beta1.Query", "TokenMetadata", data);
    return promise.then(data => QueryTokenMetadataResponse.decode(new _m0.Reader(data)));
  }
  tokenList(request) {
    const data = QueryTokenListRequest.encode(request).finish();
    const promise = this.rpc.request("ixo.token.v1beta1.Query", "TokenList", data);
    return promise.then(data => QueryTokenListResponse.decode(new _m0.Reader(data)));
  }
  tokenDoc(request) {
    const data = QueryTokenDocRequest.encode(request).finish();
    const promise = this.rpc.request("ixo.token.v1beta1.Query", "TokenDoc", data);
    return promise.then(data => QueryTokenDocResponse.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);
    },
    tokenMetadata(request) {
      return queryService.tokenMetadata(request);
    },
    tokenList(request) {
      return queryService.tokenList(request);
    },
    tokenDoc(request) {
      return queryService.tokenDoc(request);
    }
  };
};