"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 _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
var QueryClientImpl = /*#__PURE__*/function () {
  function QueryClientImpl(rpc) {
    (0, _classCallCheck2["default"])(this, QueryClientImpl);
    (0, _defineProperty2["default"])(this, "rpc", void 0);
    this.rpc = rpc;
    this.queryExchangeParams = this.queryExchangeParams.bind(this);
    this.subaccountDeposits = this.subaccountDeposits.bind(this);
    this.subaccountDeposit = this.subaccountDeposit.bind(this);
    this.exchangeBalances = this.exchangeBalances.bind(this);
    this.spotMarkets = this.spotMarkets.bind(this);
    this.spotMarket = this.spotMarket.bind(this);
    this.spotOrderbook = this.spotOrderbook.bind(this);
    this.traderSpotOrders = this.traderSpotOrders.bind(this);
    this.spotOrdersByHashes = this.spotOrdersByHashes.bind(this);
    this.subaccountOrders = this.subaccountOrders.bind(this);
    this.traderSpotTransientOrders = this.traderSpotTransientOrders.bind(this);
    this.spotMidPriceAndTOB = this.spotMidPriceAndTOB.bind(this);
    this.derivativeMidPriceAndTOB = this.derivativeMidPriceAndTOB.bind(this);
    this.derivativeOrderbook = this.derivativeOrderbook.bind(this);
    this.traderDerivativeOrders = this.traderDerivativeOrders.bind(this);
    this.derivativeOrdersByHashes = this.derivativeOrdersByHashes.bind(this);
    this.traderDerivativeTransientOrders = this.traderDerivativeTransientOrders.bind(this);
    this.derivativeMarkets = this.derivativeMarkets.bind(this);
    this.derivativeMarket = this.derivativeMarket.bind(this);
    this.derivativeMarketAddress = this.derivativeMarketAddress.bind(this);
    this.subaccountTradeNonce = this.subaccountTradeNonce.bind(this);
    this.exchangeModuleState = this.exchangeModuleState.bind(this);
    this.positions = this.positions.bind(this);
    this.subaccountPositions = this.subaccountPositions.bind(this);
    this.subaccountPositionInMarket = this.subaccountPositionInMarket.bind(this);
    this.subaccountEffectivePositionInMarket = this.subaccountEffectivePositionInMarket.bind(this);
    this.perpetualMarketInfo = this.perpetualMarketInfo.bind(this);
    this.expiryFuturesMarketInfo = this.expiryFuturesMarketInfo.bind(this);
    this.perpetualMarketFunding = this.perpetualMarketFunding.bind(this);
    this.subaccountOrderMetadata = this.subaccountOrderMetadata.bind(this);
    this.tradeRewardPoints = this.tradeRewardPoints.bind(this);
    this.pendingTradeRewardPoints = this.pendingTradeRewardPoints.bind(this);
    this.tradeRewardCampaign = this.tradeRewardCampaign.bind(this);
    this.feeDiscountAccountInfo = this.feeDiscountAccountInfo.bind(this);
    this.feeDiscountSchedule = this.feeDiscountSchedule.bind(this);
    this.balanceMismatches = this.balanceMismatches.bind(this);
    this.balanceWithBalanceHolds = this.balanceWithBalanceHolds.bind(this);
    this.feeDiscountTierStatistics = this.feeDiscountTierStatistics.bind(this);
    this.ninjaVaultInfos = this.ninjaVaultInfos.bind(this);
    this.queryMarketIDFromVault = this.queryMarketIDFromVault.bind(this);
    this.historicalTradeRecords = this.historicalTradeRecords.bind(this);
    this.isOptedOutOfRewards = this.isOptedOutOfRewards.bind(this);
    this.optedOutOfRewardsAccounts = this.optedOutOfRewardsAccounts.bind(this);
    this.marketVolatility = this.marketVolatility.bind(this);
    this.binaryOptionsMarkets = this.binaryOptionsMarkets.bind(this);
    this.traderDerivativeConditionalOrders = this.traderDerivativeConditionalOrders.bind(this);
  }
  (0, _createClass2["default"])(QueryClientImpl, [{
    key: "queryExchangeParams",
    value: function queryExchangeParams() {
      var request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
      var data = _query.QueryExchangeParamsRequest.encode(request).finish();
      var promise = this.rpc.request("injective.exchange.v1beta1.Query", "QueryExchangeParams", data);
      return promise.then(function (data) {
        return _query.QueryExchangeParamsResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "subaccountDeposits",
    value: function subaccountDeposits(request) {
      var data = _query.QuerySubaccountDepositsRequest.encode(request).finish();
      var promise = this.rpc.request("injective.exchange.v1beta1.Query", "SubaccountDeposits", data);
      return promise.then(function (data) {
        return _query.QuerySubaccountDepositsResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "subaccountDeposit",
    value: function subaccountDeposit(request) {
      var data = _query.QuerySubaccountDepositRequest.encode(request).finish();
      var promise = this.rpc.request("injective.exchange.v1beta1.Query", "SubaccountDeposit", data);
      return promise.then(function (data) {
        return _query.QuerySubaccountDepositResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "exchangeBalances",
    value: function exchangeBalances() {
      var request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
      var data = _query.QueryExchangeBalancesRequest.encode(request).finish();
      var promise = this.rpc.request("injective.exchange.v1beta1.Query", "ExchangeBalances", data);
      return promise.then(function (data) {
        return _query.QueryExchangeBalancesResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "spotMarkets",
    value: function spotMarkets(request) {
      var data = _query.QuerySpotMarketsRequest.encode(request).finish();
      var promise = this.rpc.request("injective.exchange.v1beta1.Query", "SpotMarkets", data);
      return promise.then(function (data) {
        return _query.QuerySpotMarketsResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "spotMarket",
    value: function spotMarket(request) {
      var data = _query.QuerySpotMarketRequest.encode(request).finish();
      var promise = this.rpc.request("injective.exchange.v1beta1.Query", "SpotMarket", data);
      return promise.then(function (data) {
        return _query.QuerySpotMarketResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "spotOrderbook",
    value: function spotOrderbook(request) {
      var data = _query.QuerySpotOrderbookRequest.encode(request).finish();
      var promise = this.rpc.request("injective.exchange.v1beta1.Query", "SpotOrderbook", data);
      return promise.then(function (data) {
        return _query.QuerySpotOrderbookResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "traderSpotOrders",
    value: function traderSpotOrders(request) {
      var data = _query.QueryTraderSpotOrdersRequest.encode(request).finish();
      var promise = this.rpc.request("injective.exchange.v1beta1.Query", "TraderSpotOrders", data);
      return promise.then(function (data) {
        return _query.QueryTraderSpotOrdersResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "spotOrdersByHashes",
    value: function spotOrdersByHashes(request) {
      var data = _query.QuerySpotOrdersByHashesRequest.encode(request).finish();
      var promise = this.rpc.request("injective.exchange.v1beta1.Query", "SpotOrdersByHashes", data);
      return promise.then(function (data) {
        return _query.QuerySpotOrdersByHashesResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "subaccountOrders",
    value: function subaccountOrders(request) {
      var data = _query.QuerySubaccountOrdersRequest.encode(request).finish();
      var promise = this.rpc.request("injective.exchange.v1beta1.Query", "SubaccountOrders", data);
      return promise.then(function (data) {
        return _query.QuerySubaccountOrdersResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "traderSpotTransientOrders",
    value: function traderSpotTransientOrders(request) {
      var data = _query.QueryTraderSpotOrdersRequest.encode(request).finish();
      var promise = this.rpc.request("injective.exchange.v1beta1.Query", "TraderSpotTransientOrders", data);
      return promise.then(function (data) {
        return _query.QueryTraderSpotOrdersResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "spotMidPriceAndTOB",
    value: function spotMidPriceAndTOB(request) {
      var data = _query.QuerySpotMidPriceAndTOBRequest.encode(request).finish();
      var promise = this.rpc.request("injective.exchange.v1beta1.Query", "SpotMidPriceAndTOB", data);
      return promise.then(function (data) {
        return _query.QuerySpotMidPriceAndTOBResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "derivativeMidPriceAndTOB",
    value: function derivativeMidPriceAndTOB(request) {
      var data = _query.QueryDerivativeMidPriceAndTOBRequest.encode(request).finish();
      var promise = this.rpc.request("injective.exchange.v1beta1.Query", "DerivativeMidPriceAndTOB", data);
      return promise.then(function (data) {
        return _query.QueryDerivativeMidPriceAndTOBResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "derivativeOrderbook",
    value: function derivativeOrderbook(request) {
      var data = _query.QueryDerivativeOrderbookRequest.encode(request).finish();
      var promise = this.rpc.request("injective.exchange.v1beta1.Query", "DerivativeOrderbook", data);
      return promise.then(function (data) {
        return _query.QueryDerivativeOrderbookResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "traderDerivativeOrders",
    value: function traderDerivativeOrders(request) {
      var data = _query.QueryTraderDerivativeOrdersRequest.encode(request).finish();
      var promise = this.rpc.request("injective.exchange.v1beta1.Query", "TraderDerivativeOrders", data);
      return promise.then(function (data) {
        return _query.QueryTraderDerivativeOrdersResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "derivativeOrdersByHashes",
    value: function derivativeOrdersByHashes(request) {
      var data = _query.QueryDerivativeOrdersByHashesRequest.encode(request).finish();
      var promise = this.rpc.request("injective.exchange.v1beta1.Query", "DerivativeOrdersByHashes", data);
      return promise.then(function (data) {
        return _query.QueryDerivativeOrdersByHashesResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "traderDerivativeTransientOrders",
    value: function traderDerivativeTransientOrders(request) {
      var data = _query.QueryTraderDerivativeOrdersRequest.encode(request).finish();
      var promise = this.rpc.request("injective.exchange.v1beta1.Query", "TraderDerivativeTransientOrders", data);
      return promise.then(function (data) {
        return _query.QueryTraderDerivativeOrdersResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "derivativeMarkets",
    value: function derivativeMarkets(request) {
      var data = _query.QueryDerivativeMarketsRequest.encode(request).finish();
      var promise = this.rpc.request("injective.exchange.v1beta1.Query", "DerivativeMarkets", data);
      return promise.then(function (data) {
        return _query.QueryDerivativeMarketsResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "derivativeMarket",
    value: function derivativeMarket(request) {
      var data = _query.QueryDerivativeMarketRequest.encode(request).finish();
      var promise = this.rpc.request("injective.exchange.v1beta1.Query", "DerivativeMarket", data);
      return promise.then(function (data) {
        return _query.QueryDerivativeMarketResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "derivativeMarketAddress",
    value: function derivativeMarketAddress(request) {
      var data = _query.QueryDerivativeMarketAddressRequest.encode(request).finish();
      var promise = this.rpc.request("injective.exchange.v1beta1.Query", "DerivativeMarketAddress", data);
      return promise.then(function (data) {
        return _query.QueryDerivativeMarketAddressResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "subaccountTradeNonce",
    value: function subaccountTradeNonce(request) {
      var data = _query.QuerySubaccountTradeNonceRequest.encode(request).finish();
      var promise = this.rpc.request("injective.exchange.v1beta1.Query", "SubaccountTradeNonce", data);
      return promise.then(function (data) {
        return _query.QuerySubaccountTradeNonceResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "exchangeModuleState",
    value: function exchangeModuleState() {
      var request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
      var data = _query.QueryModuleStateRequest.encode(request).finish();
      var promise = this.rpc.request("injective.exchange.v1beta1.Query", "ExchangeModuleState", data);
      return promise.then(function (data) {
        return _query.QueryModuleStateResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "positions",
    value: function positions() {
      var request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
      var data = _query.QueryPositionsRequest.encode(request).finish();
      var promise = this.rpc.request("injective.exchange.v1beta1.Query", "Positions", data);
      return promise.then(function (data) {
        return _query.QueryPositionsResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "subaccountPositions",
    value: function subaccountPositions(request) {
      var data = _query.QuerySubaccountPositionsRequest.encode(request).finish();
      var promise = this.rpc.request("injective.exchange.v1beta1.Query", "SubaccountPositions", data);
      return promise.then(function (data) {
        return _query.QuerySubaccountPositionsResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "subaccountPositionInMarket",
    value: function subaccountPositionInMarket(request) {
      var data = _query.QuerySubaccountPositionInMarketRequest.encode(request).finish();
      var promise = this.rpc.request("injective.exchange.v1beta1.Query", "SubaccountPositionInMarket", data);
      return promise.then(function (data) {
        return _query.QuerySubaccountPositionInMarketResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "subaccountEffectivePositionInMarket",
    value: function subaccountEffectivePositionInMarket(request) {
      var data = _query.QuerySubaccountEffectivePositionInMarketRequest.encode(request).finish();
      var promise = this.rpc.request("injective.exchange.v1beta1.Query", "SubaccountEffectivePositionInMarket", data);
      return promise.then(function (data) {
        return _query.QuerySubaccountEffectivePositionInMarketResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "perpetualMarketInfo",
    value: function perpetualMarketInfo(request) {
      var data = _query.QueryPerpetualMarketInfoRequest.encode(request).finish();
      var promise = this.rpc.request("injective.exchange.v1beta1.Query", "PerpetualMarketInfo", data);
      return promise.then(function (data) {
        return _query.QueryPerpetualMarketInfoResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "expiryFuturesMarketInfo",
    value: function expiryFuturesMarketInfo(request) {
      var data = _query.QueryExpiryFuturesMarketInfoRequest.encode(request).finish();
      var promise = this.rpc.request("injective.exchange.v1beta1.Query", "ExpiryFuturesMarketInfo", data);
      return promise.then(function (data) {
        return _query.QueryExpiryFuturesMarketInfoResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "perpetualMarketFunding",
    value: function perpetualMarketFunding(request) {
      var data = _query.QueryPerpetualMarketFundingRequest.encode(request).finish();
      var promise = this.rpc.request("injective.exchange.v1beta1.Query", "PerpetualMarketFunding", data);
      return promise.then(function (data) {
        return _query.QueryPerpetualMarketFundingResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "subaccountOrderMetadata",
    value: function subaccountOrderMetadata(request) {
      var data = _query.QuerySubaccountOrderMetadataRequest.encode(request).finish();
      var promise = this.rpc.request("injective.exchange.v1beta1.Query", "SubaccountOrderMetadata", data);
      return promise.then(function (data) {
        return _query.QuerySubaccountOrderMetadataResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "tradeRewardPoints",
    value: function tradeRewardPoints(request) {
      var data = _query.QueryTradeRewardPointsRequest.encode(request).finish();
      var promise = this.rpc.request("injective.exchange.v1beta1.Query", "TradeRewardPoints", data);
      return promise.then(function (data) {
        return _query.QueryTradeRewardPointsResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "pendingTradeRewardPoints",
    value: function pendingTradeRewardPoints(request) {
      var data = _query.QueryTradeRewardPointsRequest.encode(request).finish();
      var promise = this.rpc.request("injective.exchange.v1beta1.Query", "PendingTradeRewardPoints", data);
      return promise.then(function (data) {
        return _query.QueryTradeRewardPointsResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "tradeRewardCampaign",
    value: function tradeRewardCampaign() {
      var request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
      var data = _query.QueryTradeRewardCampaignRequest.encode(request).finish();
      var promise = this.rpc.request("injective.exchange.v1beta1.Query", "TradeRewardCampaign", data);
      return promise.then(function (data) {
        return _query.QueryTradeRewardCampaignResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "feeDiscountAccountInfo",
    value: function feeDiscountAccountInfo(request) {
      var data = _query.QueryFeeDiscountAccountInfoRequest.encode(request).finish();
      var promise = this.rpc.request("injective.exchange.v1beta1.Query", "FeeDiscountAccountInfo", data);
      return promise.then(function (data) {
        return _query.QueryFeeDiscountAccountInfoResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "feeDiscountSchedule",
    value: function feeDiscountSchedule() {
      var request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
      var data = _query.QueryFeeDiscountScheduleRequest.encode(request).finish();
      var promise = this.rpc.request("injective.exchange.v1beta1.Query", "FeeDiscountSchedule", data);
      return promise.then(function (data) {
        return _query.QueryFeeDiscountScheduleResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "balanceMismatches",
    value: function balanceMismatches(request) {
      var data = _query.QueryBalanceMismatchesRequest.encode(request).finish();
      var promise = this.rpc.request("injective.exchange.v1beta1.Query", "BalanceMismatches", data);
      return promise.then(function (data) {
        return _query.QueryBalanceMismatchesResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "balanceWithBalanceHolds",
    value: function balanceWithBalanceHolds() {
      var request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
      var data = _query.QueryBalanceWithBalanceHoldsRequest.encode(request).finish();
      var promise = this.rpc.request("injective.exchange.v1beta1.Query", "BalanceWithBalanceHolds", data);
      return promise.then(function (data) {
        return _query.QueryBalanceWithBalanceHoldsResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "feeDiscountTierStatistics",
    value: function feeDiscountTierStatistics() {
      var request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
      var data = _query.QueryFeeDiscountTierStatisticsRequest.encode(request).finish();
      var promise = this.rpc.request("injective.exchange.v1beta1.Query", "FeeDiscountTierStatistics", data);
      return promise.then(function (data) {
        return _query.QueryFeeDiscountTierStatisticsResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "ninjaVaultInfos",
    value: function ninjaVaultInfos() {
      var request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
      var data = _query.NinjaVaultInfosRequest.encode(request).finish();
      var promise = this.rpc.request("injective.exchange.v1beta1.Query", "NinjaVaultInfos", data);
      return promise.then(function (data) {
        return _query.NinjaVaultInfosResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "queryMarketIDFromVault",
    value: function queryMarketIDFromVault(request) {
      var data = _query.QueryMarketIDFromVaultRequest.encode(request).finish();
      var promise = this.rpc.request("injective.exchange.v1beta1.Query", "QueryMarketIDFromVault", data);
      return promise.then(function (data) {
        return _query.QueryMarketIDFromVaultResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "historicalTradeRecords",
    value: function historicalTradeRecords(request) {
      var data = _query.QueryHistoricalTradeRecordsRequest.encode(request).finish();
      var promise = this.rpc.request("injective.exchange.v1beta1.Query", "HistoricalTradeRecords", data);
      return promise.then(function (data) {
        return _query.QueryHistoricalTradeRecordsResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "isOptedOutOfRewards",
    value: function isOptedOutOfRewards(request) {
      var data = _query.QueryIsOptedOutOfRewardsRequest.encode(request).finish();
      var promise = this.rpc.request("injective.exchange.v1beta1.Query", "IsOptedOutOfRewards", data);
      return promise.then(function (data) {
        return _query.QueryIsOptedOutOfRewardsResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "optedOutOfRewardsAccounts",
    value: function optedOutOfRewardsAccounts() {
      var request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
      var data = _query.QueryOptedOutOfRewardsAccountsRequest.encode(request).finish();
      var promise = this.rpc.request("injective.exchange.v1beta1.Query", "OptedOutOfRewardsAccounts", data);
      return promise.then(function (data) {
        return _query.QueryOptedOutOfRewardsAccountsResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "marketVolatility",
    value: function marketVolatility(request) {
      var data = _query.QueryMarketVolatilityRequest.encode(request).finish();
      var promise = this.rpc.request("injective.exchange.v1beta1.Query", "MarketVolatility", data);
      return promise.then(function (data) {
        return _query.QueryMarketVolatilityResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "binaryOptionsMarkets",
    value: function binaryOptionsMarkets(request) {
      var data = _query.QueryBinaryMarketsRequest.encode(request).finish();
      var promise = this.rpc.request("injective.exchange.v1beta1.Query", "BinaryOptionsMarkets", data);
      return promise.then(function (data) {
        return _query.QueryBinaryMarketsResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "traderDerivativeConditionalOrders",
    value: function traderDerivativeConditionalOrders(request) {
      var data = _query.QueryTraderDerivativeConditionalOrdersRequest.encode(request).finish();
      var promise = this.rpc.request("injective.exchange.v1beta1.Query", "TraderDerivativeConditionalOrders", data);
      return promise.then(function (data) {
        return _query.QueryTraderDerivativeConditionalOrdersResponse.decode(new _m0.Reader(data));
      });
    }
  }]);
  return QueryClientImpl;
}();
exports.QueryClientImpl = QueryClientImpl;
var createRpcQueryExtension = function createRpcQueryExtension(base) {
  var rpc = (0, _stargate.createProtobufRpcClient)(base);
  var queryService = new QueryClientImpl(rpc);
  return {
    queryExchangeParams: function queryExchangeParams(request) {
      return queryService.queryExchangeParams(request);
    },
    subaccountDeposits: function subaccountDeposits(request) {
      return queryService.subaccountDeposits(request);
    },
    subaccountDeposit: function subaccountDeposit(request) {
      return queryService.subaccountDeposit(request);
    },
    exchangeBalances: function exchangeBalances(request) {
      return queryService.exchangeBalances(request);
    },
    spotMarkets: function spotMarkets(request) {
      return queryService.spotMarkets(request);
    },
    spotMarket: function spotMarket(request) {
      return queryService.spotMarket(request);
    },
    spotOrderbook: function spotOrderbook(request) {
      return queryService.spotOrderbook(request);
    },
    traderSpotOrders: function traderSpotOrders(request) {
      return queryService.traderSpotOrders(request);
    },
    spotOrdersByHashes: function spotOrdersByHashes(request) {
      return queryService.spotOrdersByHashes(request);
    },
    subaccountOrders: function subaccountOrders(request) {
      return queryService.subaccountOrders(request);
    },
    traderSpotTransientOrders: function traderSpotTransientOrders(request) {
      return queryService.traderSpotTransientOrders(request);
    },
    spotMidPriceAndTOB: function spotMidPriceAndTOB(request) {
      return queryService.spotMidPriceAndTOB(request);
    },
    derivativeMidPriceAndTOB: function derivativeMidPriceAndTOB(request) {
      return queryService.derivativeMidPriceAndTOB(request);
    },
    derivativeOrderbook: function derivativeOrderbook(request) {
      return queryService.derivativeOrderbook(request);
    },
    traderDerivativeOrders: function traderDerivativeOrders(request) {
      return queryService.traderDerivativeOrders(request);
    },
    derivativeOrdersByHashes: function derivativeOrdersByHashes(request) {
      return queryService.derivativeOrdersByHashes(request);
    },
    traderDerivativeTransientOrders: function traderDerivativeTransientOrders(request) {
      return queryService.traderDerivativeTransientOrders(request);
    },
    derivativeMarkets: function derivativeMarkets(request) {
      return queryService.derivativeMarkets(request);
    },
    derivativeMarket: function derivativeMarket(request) {
      return queryService.derivativeMarket(request);
    },
    derivativeMarketAddress: function derivativeMarketAddress(request) {
      return queryService.derivativeMarketAddress(request);
    },
    subaccountTradeNonce: function subaccountTradeNonce(request) {
      return queryService.subaccountTradeNonce(request);
    },
    exchangeModuleState: function exchangeModuleState(request) {
      return queryService.exchangeModuleState(request);
    },
    positions: function positions(request) {
      return queryService.positions(request);
    },
    subaccountPositions: function subaccountPositions(request) {
      return queryService.subaccountPositions(request);
    },
    subaccountPositionInMarket: function subaccountPositionInMarket(request) {
      return queryService.subaccountPositionInMarket(request);
    },
    subaccountEffectivePositionInMarket: function subaccountEffectivePositionInMarket(request) {
      return queryService.subaccountEffectivePositionInMarket(request);
    },
    perpetualMarketInfo: function perpetualMarketInfo(request) {
      return queryService.perpetualMarketInfo(request);
    },
    expiryFuturesMarketInfo: function expiryFuturesMarketInfo(request) {
      return queryService.expiryFuturesMarketInfo(request);
    },
    perpetualMarketFunding: function perpetualMarketFunding(request) {
      return queryService.perpetualMarketFunding(request);
    },
    subaccountOrderMetadata: function subaccountOrderMetadata(request) {
      return queryService.subaccountOrderMetadata(request);
    },
    tradeRewardPoints: function tradeRewardPoints(request) {
      return queryService.tradeRewardPoints(request);
    },
    pendingTradeRewardPoints: function pendingTradeRewardPoints(request) {
      return queryService.pendingTradeRewardPoints(request);
    },
    tradeRewardCampaign: function tradeRewardCampaign(request) {
      return queryService.tradeRewardCampaign(request);
    },
    feeDiscountAccountInfo: function feeDiscountAccountInfo(request) {
      return queryService.feeDiscountAccountInfo(request);
    },
    feeDiscountSchedule: function feeDiscountSchedule(request) {
      return queryService.feeDiscountSchedule(request);
    },
    balanceMismatches: function balanceMismatches(request) {
      return queryService.balanceMismatches(request);
    },
    balanceWithBalanceHolds: function balanceWithBalanceHolds(request) {
      return queryService.balanceWithBalanceHolds(request);
    },
    feeDiscountTierStatistics: function feeDiscountTierStatistics(request) {
      return queryService.feeDiscountTierStatistics(request);
    },
    ninjaVaultInfos: function ninjaVaultInfos(request) {
      return queryService.ninjaVaultInfos(request);
    },
    queryMarketIDFromVault: function queryMarketIDFromVault(request) {
      return queryService.queryMarketIDFromVault(request);
    },
    historicalTradeRecords: function historicalTradeRecords(request) {
      return queryService.historicalTradeRecords(request);
    },
    isOptedOutOfRewards: function isOptedOutOfRewards(request) {
      return queryService.isOptedOutOfRewards(request);
    },
    optedOutOfRewardsAccounts: function optedOutOfRewardsAccounts(request) {
      return queryService.optedOutOfRewardsAccounts(request);
    },
    marketVolatility: function marketVolatility(request) {
      return queryService.marketVolatility(request);
    },
    binaryOptionsMarkets: function binaryOptionsMarkets(request) {
      return queryService.binaryOptionsMarkets(request);
    },
    traderDerivativeConditionalOrders: function traderDerivativeConditionalOrders(request) {
      return queryService.traderDerivativeConditionalOrders(request);
    }
  };
};
exports.createRpcQueryExtension = createRpcQueryExtension;