"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.params = this.params.bind(this);
    this.collection = this.collection.bind(this);
    this.collectionList = this.collectionList.bind(this);
    this.claim = this.claim.bind(this);
    this.claimList = this.claimList.bind(this);
    this.dispute = this.dispute.bind(this);
    this.disputeList = this.disputeList.bind(this);
    this.intent = this.intent.bind(this);
    this.intentList = this.intentList.bind(this);
  }
  return (0, _createClass2["default"])(QueryClientImpl, [{
    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.claims.v1beta1.Query", "Params", data);
      return promise.then(function (data) {
        return _query.QueryParamsResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "collection",
    value: function collection(request) {
      var data = _query.QueryCollectionRequest.encode(request).finish();
      var promise = this.rpc.request("ixo.claims.v1beta1.Query", "Collection", data);
      return promise.then(function (data) {
        return _query.QueryCollectionResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "collectionList",
    value: function collectionList() {
      var request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
        pagination: undefined
      };
      var data = _query.QueryCollectionListRequest.encode(request).finish();
      var promise = this.rpc.request("ixo.claims.v1beta1.Query", "CollectionList", data);
      return promise.then(function (data) {
        return _query.QueryCollectionListResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "claim",
    value: function claim(request) {
      var data = _query.QueryClaimRequest.encode(request).finish();
      var promise = this.rpc.request("ixo.claims.v1beta1.Query", "Claim", data);
      return promise.then(function (data) {
        return _query.QueryClaimResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "claimList",
    value: function claimList() {
      var request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
        pagination: undefined
      };
      var data = _query.QueryClaimListRequest.encode(request).finish();
      var promise = this.rpc.request("ixo.claims.v1beta1.Query", "ClaimList", data);
      return promise.then(function (data) {
        return _query.QueryClaimListResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "dispute",
    value: function dispute(request) {
      var data = _query.QueryDisputeRequest.encode(request).finish();
      var promise = this.rpc.request("ixo.claims.v1beta1.Query", "Dispute", data);
      return promise.then(function (data) {
        return _query.QueryDisputeResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "disputeList",
    value: function disputeList() {
      var request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
        pagination: undefined
      };
      var data = _query.QueryDisputeListRequest.encode(request).finish();
      var promise = this.rpc.request("ixo.claims.v1beta1.Query", "DisputeList", data);
      return promise.then(function (data) {
        return _query.QueryDisputeListResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "intent",
    value: function intent(request) {
      var data = _query.QueryIntentRequest.encode(request).finish();
      var promise = this.rpc.request("ixo.claims.v1beta1.Query", "Intent", data);
      return promise.then(function (data) {
        return _query.QueryIntentResponse.decode(new _m0.Reader(data));
      });
    }
  }, {
    key: "intentList",
    value: function intentList() {
      var request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
        pagination: undefined
      };
      var data = _query.QueryIntentListRequest.encode(request).finish();
      var promise = this.rpc.request("ixo.claims.v1beta1.Query", "IntentList", data);
      return promise.then(function (data) {
        return _query.QueryIntentListResponse.decode(new _m0.Reader(data));
      });
    }
  }]);
}();
var createRpcQueryExtension = exports.createRpcQueryExtension = function createRpcQueryExtension(base) {
  var rpc = (0, _stargate.createProtobufRpcClient)(base);
  var queryService = new QueryClientImpl(rpc);
  return {
    params: function params(request) {
      return queryService.params(request);
    },
    collection: function collection(request) {
      return queryService.collection(request);
    },
    collectionList: function collectionList(request) {
      return queryService.collectionList(request);
    },
    claim: function claim(request) {
      return queryService.claim(request);
    },
    claimList: function claimList(request) {
      return queryService.claimList(request);
    },
    dispute: function dispute(request) {
      return queryService.dispute(request);
    },
    disputeList: function disputeList(request) {
      return queryService.disputeList(request);
    },
    intent: function intent(request) {
      return queryService.intent(request);
    },
    intentList: function intentList(request) {
      return queryService.intentList(request);
    }
  };
};