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

import * as _m0 from "protobufjs/minimal";
import { createProtobufRpcClient } from "@cosmjs/stargate";
import { QueryBondsRequest, QueryBondsResponse, QueryBondsDetailedRequest, QueryBondsDetailedResponse, QueryParamsRequest, QueryParamsResponse, QueryBondRequest, QueryBondResponse, QueryBatchRequest, QueryBatchResponse, QueryLastBatchRequest, QueryLastBatchResponse, QueryCurrentPriceRequest, QueryCurrentPriceResponse, QueryCurrentReserveRequest, QueryCurrentReserveResponse, QueryAvailableReserveRequest, QueryAvailableReserveResponse, QueryCustomPriceRequest, QueryCustomPriceResponse, QueryBuyPriceRequest, QueryBuyPriceResponse, QuerySellReturnRequest, QuerySellReturnResponse, QuerySwapReturnRequest, QuerySwapReturnResponse, QueryAlphaMaximumsRequest, QueryAlphaMaximumsResponse } from "./query";
/** Query defines the gRPC querier service. */

export class QueryClientImpl {
  constructor(rpc) {
    _defineProperty(this, "rpc", void 0);
    this.rpc = rpc;
    this.bonds = this.bonds.bind(this);
    this.bondsDetailed = this.bondsDetailed.bind(this);
    this.params = this.params.bind(this);
    this.bond = this.bond.bind(this);
    this.batch = this.batch.bind(this);
    this.lastBatch = this.lastBatch.bind(this);
    this.currentPrice = this.currentPrice.bind(this);
    this.currentReserve = this.currentReserve.bind(this);
    this.availableReserve = this.availableReserve.bind(this);
    this.customPrice = this.customPrice.bind(this);
    this.buyPrice = this.buyPrice.bind(this);
    this.sellReturn = this.sellReturn.bind(this);
    this.swapReturn = this.swapReturn.bind(this);
    this.alphaMaximums = this.alphaMaximums.bind(this);
  }
  bonds(request = {}) {
    const data = QueryBondsRequest.encode(request).finish();
    const promise = this.rpc.request("ixo.bonds.v1beta1.Query", "Bonds", data);
    return promise.then(data => QueryBondsResponse.decode(new _m0.Reader(data)));
  }
  bondsDetailed(request = {}) {
    const data = QueryBondsDetailedRequest.encode(request).finish();
    const promise = this.rpc.request("ixo.bonds.v1beta1.Query", "BondsDetailed", data);
    return promise.then(data => QueryBondsDetailedResponse.decode(new _m0.Reader(data)));
  }
  params(request = {}) {
    const data = QueryParamsRequest.encode(request).finish();
    const promise = this.rpc.request("ixo.bonds.v1beta1.Query", "Params", data);
    return promise.then(data => QueryParamsResponse.decode(new _m0.Reader(data)));
  }
  bond(request) {
    const data = QueryBondRequest.encode(request).finish();
    const promise = this.rpc.request("ixo.bonds.v1beta1.Query", "Bond", data);
    return promise.then(data => QueryBondResponse.decode(new _m0.Reader(data)));
  }
  batch(request) {
    const data = QueryBatchRequest.encode(request).finish();
    const promise = this.rpc.request("ixo.bonds.v1beta1.Query", "Batch", data);
    return promise.then(data => QueryBatchResponse.decode(new _m0.Reader(data)));
  }
  lastBatch(request) {
    const data = QueryLastBatchRequest.encode(request).finish();
    const promise = this.rpc.request("ixo.bonds.v1beta1.Query", "LastBatch", data);
    return promise.then(data => QueryLastBatchResponse.decode(new _m0.Reader(data)));
  }
  currentPrice(request) {
    const data = QueryCurrentPriceRequest.encode(request).finish();
    const promise = this.rpc.request("ixo.bonds.v1beta1.Query", "CurrentPrice", data);
    return promise.then(data => QueryCurrentPriceResponse.decode(new _m0.Reader(data)));
  }
  currentReserve(request) {
    const data = QueryCurrentReserveRequest.encode(request).finish();
    const promise = this.rpc.request("ixo.bonds.v1beta1.Query", "CurrentReserve", data);
    return promise.then(data => QueryCurrentReserveResponse.decode(new _m0.Reader(data)));
  }
  availableReserve(request) {
    const data = QueryAvailableReserveRequest.encode(request).finish();
    const promise = this.rpc.request("ixo.bonds.v1beta1.Query", "AvailableReserve", data);
    return promise.then(data => QueryAvailableReserveResponse.decode(new _m0.Reader(data)));
  }
  customPrice(request) {
    const data = QueryCustomPriceRequest.encode(request).finish();
    const promise = this.rpc.request("ixo.bonds.v1beta1.Query", "CustomPrice", data);
    return promise.then(data => QueryCustomPriceResponse.decode(new _m0.Reader(data)));
  }
  buyPrice(request) {
    const data = QueryBuyPriceRequest.encode(request).finish();
    const promise = this.rpc.request("ixo.bonds.v1beta1.Query", "BuyPrice", data);
    return promise.then(data => QueryBuyPriceResponse.decode(new _m0.Reader(data)));
  }
  sellReturn(request) {
    const data = QuerySellReturnRequest.encode(request).finish();
    const promise = this.rpc.request("ixo.bonds.v1beta1.Query", "SellReturn", data);
    return promise.then(data => QuerySellReturnResponse.decode(new _m0.Reader(data)));
  }
  swapReturn(request) {
    const data = QuerySwapReturnRequest.encode(request).finish();
    const promise = this.rpc.request("ixo.bonds.v1beta1.Query", "SwapReturn", data);
    return promise.then(data => QuerySwapReturnResponse.decode(new _m0.Reader(data)));
  }
  alphaMaximums(request) {
    const data = QueryAlphaMaximumsRequest.encode(request).finish();
    const promise = this.rpc.request("ixo.bonds.v1beta1.Query", "AlphaMaximums", data);
    return promise.then(data => QueryAlphaMaximumsResponse.decode(new _m0.Reader(data)));
  }
}
export const createRpcQueryExtension = base => {
  const rpc = createProtobufRpcClient(base);
  const queryService = new QueryClientImpl(rpc);
  return {
    bonds(request) {
      return queryService.bonds(request);
    },
    bondsDetailed(request) {
      return queryService.bondsDetailed(request);
    },
    params(request) {
      return queryService.params(request);
    },
    bond(request) {
      return queryService.bond(request);
    },
    batch(request) {
      return queryService.batch(request);
    },
    lastBatch(request) {
      return queryService.lastBatch(request);
    },
    currentPrice(request) {
      return queryService.currentPrice(request);
    },
    currentReserve(request) {
      return queryService.currentReserve(request);
    },
    availableReserve(request) {
      return queryService.availableReserve(request);
    },
    customPrice(request) {
      return queryService.customPrice(request);
    },
    buyPrice(request) {
      return queryService.buyPrice(request);
    },
    sellReturn(request) {
      return queryService.sellReturn(request);
    },
    swapReturn(request) {
      return queryService.swapReturn(request);
    },
    alphaMaximums(request) {
      return queryService.alphaMaximums(request);
    }
  };
};