"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _typeof = require("@babel/runtime/helpers/typeof");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.createRpcQueryExtension = exports.QueryClientImpl = void 0;
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _m0 = _interopRequireWildcard(require("protobufjs/minimal"));
var _stargate = require("@cosmjs/stargate");
var _query = require("./query");
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
//@ts-nocheck
/** Query defines the gRPC querier service. */
var QueryClientImpl = exports.QueryClientImpl = /*#__PURE__*/function () {
  function QueryClientImpl(rpc) {
    (0, _classCallCheck2["default"])(this, QueryClientImpl);
    (0, _defineProperty2["default"])(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);
  }
  return (0, _createClass2["default"])(QueryClientImpl, [{
    key: "bonds",
    value: function bonds() {
      var request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
      var data = _query.QueryBondsRequest.encode(request).finish();
      var promise = this.rpc.request("ixo.bonds.v1beta1.Query", "Bonds", data);
      return promise.then(function (data) {
        return _query.QueryBondsResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "bondsDetailed",
    value: function bondsDetailed() {
      var request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
      var data = _query.QueryBondsDetailedRequest.encode(request).finish();
      var promise = this.rpc.request("ixo.bonds.v1beta1.Query", "BondsDetailed", data);
      return promise.then(function (data) {
        return _query.QueryBondsDetailedResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "params",
    value: function params() {
      var request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
      var data = _query.QueryParamsRequest.encode(request).finish();
      var promise = this.rpc.request("ixo.bonds.v1beta1.Query", "Params", data);
      return promise.then(function (data) {
        return _query.QueryParamsResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "bond",
    value: function bond(request) {
      var data = _query.QueryBondRequest.encode(request).finish();
      var promise = this.rpc.request("ixo.bonds.v1beta1.Query", "Bond", data);
      return promise.then(function (data) {
        return _query.QueryBondResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "batch",
    value: function batch(request) {
      var data = _query.QueryBatchRequest.encode(request).finish();
      var promise = this.rpc.request("ixo.bonds.v1beta1.Query", "Batch", data);
      return promise.then(function (data) {
        return _query.QueryBatchResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "lastBatch",
    value: function lastBatch(request) {
      var data = _query.QueryLastBatchRequest.encode(request).finish();
      var promise = this.rpc.request("ixo.bonds.v1beta1.Query", "LastBatch", data);
      return promise.then(function (data) {
        return _query.QueryLastBatchResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "currentPrice",
    value: function currentPrice(request) {
      var data = _query.QueryCurrentPriceRequest.encode(request).finish();
      var promise = this.rpc.request("ixo.bonds.v1beta1.Query", "CurrentPrice", data);
      return promise.then(function (data) {
        return _query.QueryCurrentPriceResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "currentReserve",
    value: function currentReserve(request) {
      var data = _query.QueryCurrentReserveRequest.encode(request).finish();
      var promise = this.rpc.request("ixo.bonds.v1beta1.Query", "CurrentReserve", data);
      return promise.then(function (data) {
        return _query.QueryCurrentReserveResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "availableReserve",
    value: function availableReserve(request) {
      var data = _query.QueryAvailableReserveRequest.encode(request).finish();
      var promise = this.rpc.request("ixo.bonds.v1beta1.Query", "AvailableReserve", data);
      return promise.then(function (data) {
        return _query.QueryAvailableReserveResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "customPrice",
    value: function customPrice(request) {
      var data = _query.QueryCustomPriceRequest.encode(request).finish();
      var promise = this.rpc.request("ixo.bonds.v1beta1.Query", "CustomPrice", data);
      return promise.then(function (data) {
        return _query.QueryCustomPriceResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "buyPrice",
    value: function buyPrice(request) {
      var data = _query.QueryBuyPriceRequest.encode(request).finish();
      var promise = this.rpc.request("ixo.bonds.v1beta1.Query", "BuyPrice", data);
      return promise.then(function (data) {
        return _query.QueryBuyPriceResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "sellReturn",
    value: function sellReturn(request) {
      var data = _query.QuerySellReturnRequest.encode(request).finish();
      var promise = this.rpc.request("ixo.bonds.v1beta1.Query", "SellReturn", data);
      return promise.then(function (data) {
        return _query.QuerySellReturnResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "swapReturn",
    value: function swapReturn(request) {
      var data = _query.QuerySwapReturnRequest.encode(request).finish();
      var promise = this.rpc.request("ixo.bonds.v1beta1.Query", "SwapReturn", data);
      return promise.then(function (data) {
        return _query.QuerySwapReturnResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "alphaMaximums",
    value: function alphaMaximums(request) {
      var data = _query.QueryAlphaMaximumsRequest.encode(request).finish();
      var promise = this.rpc.request("ixo.bonds.v1beta1.Query", "AlphaMaximums", data);
      return promise.then(function (data) {
        return _query.QueryAlphaMaximumsResponse.decode(new _m0.Reader(data));
      });
    }
  }]);
}();
var createRpcQueryExtension = exports.createRpcQueryExtension = function createRpcQueryExtension(base) {
  var rpc = (0, _stargate.createProtobufRpcClient)(base);
  var queryService = new QueryClientImpl(rpc);
  return {
    bonds: function bonds(request) {
      return queryService.bonds(request);
    },
    bondsDetailed: function bondsDetailed(request) {
      return queryService.bondsDetailed(request);
    },
    params: function params(request) {
      return queryService.params(request);
    },
    bond: function bond(request) {
      return queryService.bond(request);
    },
    batch: function batch(request) {
      return queryService.batch(request);
    },
    lastBatch: function lastBatch(request) {
      return queryService.lastBatch(request);
    },
    currentPrice: function currentPrice(request) {
      return queryService.currentPrice(request);
    },
    currentReserve: function currentReserve(request) {
      return queryService.currentReserve(request);
    },
    availableReserve: function availableReserve(request) {
      return queryService.availableReserve(request);
    },
    customPrice: function customPrice(request) {
      return queryService.customPrice(request);
    },
    buyPrice: function buyPrice(request) {
      return queryService.buyPrice(request);
    },
    sellReturn: function sellReturn(request) {
      return queryService.sellReturn(request);
    },
    swapReturn: function swapReturn(request) {
      return queryService.swapReturn(request);
    },
    alphaMaximums: function alphaMaximums(request) {
      return queryService.alphaMaximums(request);
    }
  };
};