"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _typeof = require("@babel/runtime/helpers/typeof");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.createRPCQueryClient = void 0;
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
var _tendermintRpc = require("@cosmjs/tendermint-rpc");
var _stargate = require("@cosmjs/stargate");
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
var createRPCQueryClient = exports.createRPCQueryClient = /*#__PURE__*/function () {
  var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(_ref) {
    var rpcEndpoint, tmClient, client;
    return _regenerator["default"].wrap(function _callee$(_context) {
      while (1) switch (_context.prev = _context.next) {
        case 0:
          rpcEndpoint = _ref.rpcEndpoint;
          _context.next = 3;
          return _tendermintRpc.Tendermint34Client.connect(rpcEndpoint);
        case 3:
          tmClient = _context.sent;
          client = new _stargate.QueryClient(tmClient);
          _context.next = 7;
          return Promise.resolve().then(function () {
            return _interopRequireWildcard(require("./query.rpc.Query"));
          });
        case 7:
          _context.t0 = _context.sent.createRpcQueryExtension(client);
          _context.next = 10;
          return Promise.resolve().then(function () {
            return _interopRequireWildcard(require("../rewards/query.rpc.Query"));
          });
        case 10:
          _context.t1 = _context.sent.createRpcQueryExtension(client);
          _context.t2 = {
            gitopia: _context.t0,
            rewards: _context.t1
          };
          _context.t3 = {
            gitopia: _context.t2
          };
          _context.next = 15;
          return Promise.resolve().then(function () {
            return _interopRequireWildcard(require("../cosmos/app/v1alpha1/query.rpc.Query"));
          });
        case 15:
          _context.t4 = _context.sent.createRpcQueryExtension(client);
          _context.t5 = {
            v1alpha1: _context.t4
          };
          _context.next = 19;
          return Promise.resolve().then(function () {
            return _interopRequireWildcard(require("../cosmos/auth/v1beta1/query.rpc.Query"));
          });
        case 19:
          _context.t6 = _context.sent.createRpcQueryExtension(client);
          _context.t7 = {
            v1beta1: _context.t6
          };
          _context.next = 23;
          return Promise.resolve().then(function () {
            return _interopRequireWildcard(require("../cosmos/authz/v1beta1/query.rpc.Query"));
          });
        case 23:
          _context.t8 = _context.sent.createRpcQueryExtension(client);
          _context.t9 = {
            v1beta1: _context.t8
          };
          _context.next = 27;
          return Promise.resolve().then(function () {
            return _interopRequireWildcard(require("../cosmos/bank/v1beta1/query.rpc.Query"));
          });
        case 27:
          _context.t10 = _context.sent.createRpcQueryExtension(client);
          _context.t11 = {
            v1beta1: _context.t10
          };
          _context.next = 31;
          return Promise.resolve().then(function () {
            return _interopRequireWildcard(require("../cosmos/base/node/v1beta1/query.rpc.Service"));
          });
        case 31:
          _context.t12 = _context.sent.createRpcQueryExtension(client);
          _context.t13 = {
            v1beta1: _context.t12
          };
          _context.next = 35;
          return Promise.resolve().then(function () {
            return _interopRequireWildcard(require("../cosmos/base/tendermint/v1beta1/query.rpc.Service"));
          });
        case 35:
          _context.t14 = _context.sent.createRpcQueryExtension(client);
          _context.t15 = {
            v1beta1: _context.t14
          };
          _context.t16 = {
            node: _context.t13,
            tendermint: _context.t15
          };
          _context.next = 40;
          return Promise.resolve().then(function () {
            return _interopRequireWildcard(require("../cosmos/distribution/v1beta1/query.rpc.Query"));
          });
        case 40:
          _context.t17 = _context.sent.createRpcQueryExtension(client);
          _context.t18 = {
            v1beta1: _context.t17
          };
          _context.next = 44;
          return Promise.resolve().then(function () {
            return _interopRequireWildcard(require("../cosmos/evidence/v1beta1/query.rpc.Query"));
          });
        case 44:
          _context.t19 = _context.sent.createRpcQueryExtension(client);
          _context.t20 = {
            v1beta1: _context.t19
          };
          _context.next = 48;
          return Promise.resolve().then(function () {
            return _interopRequireWildcard(require("../cosmos/feegrant/v1beta1/query.rpc.Query"));
          });
        case 48:
          _context.t21 = _context.sent.createRpcQueryExtension(client);
          _context.t22 = {
            v1beta1: _context.t21
          };
          _context.next = 52;
          return Promise.resolve().then(function () {
            return _interopRequireWildcard(require("../cosmos/gov/v1/query.rpc.Query"));
          });
        case 52:
          _context.t23 = _context.sent.createRpcQueryExtension(client);
          _context.next = 55;
          return Promise.resolve().then(function () {
            return _interopRequireWildcard(require("../cosmos/gov/v1beta1/query.rpc.Query"));
          });
        case 55:
          _context.t24 = _context.sent.createRpcQueryExtension(client);
          _context.t25 = {
            v1: _context.t23,
            v1beta1: _context.t24
          };
          _context.next = 59;
          return Promise.resolve().then(function () {
            return _interopRequireWildcard(require("../cosmos/group/v1/query.rpc.Query"));
          });
        case 59:
          _context.t26 = _context.sent.createRpcQueryExtension(client);
          _context.t27 = {
            v1: _context.t26
          };
          _context.next = 63;
          return Promise.resolve().then(function () {
            return _interopRequireWildcard(require("../cosmos/mint/v1beta1/query.rpc.Query"));
          });
        case 63:
          _context.t28 = _context.sent.createRpcQueryExtension(client);
          _context.t29 = {
            v1beta1: _context.t28
          };
          _context.next = 67;
          return Promise.resolve().then(function () {
            return _interopRequireWildcard(require("../cosmos/nft/v1beta1/query.rpc.Query"));
          });
        case 67:
          _context.t30 = _context.sent.createRpcQueryExtension(client);
          _context.t31 = {
            v1beta1: _context.t30
          };
          _context.next = 71;
          return Promise.resolve().then(function () {
            return _interopRequireWildcard(require("../cosmos/params/v1beta1/query.rpc.Query"));
          });
        case 71:
          _context.t32 = _context.sent.createRpcQueryExtension(client);
          _context.t33 = {
            v1beta1: _context.t32
          };
          _context.next = 75;
          return Promise.resolve().then(function () {
            return _interopRequireWildcard(require("../cosmos/slashing/v1beta1/query.rpc.Query"));
          });
        case 75:
          _context.t34 = _context.sent.createRpcQueryExtension(client);
          _context.t35 = {
            v1beta1: _context.t34
          };
          _context.next = 79;
          return Promise.resolve().then(function () {
            return _interopRequireWildcard(require("../cosmos/staking/v1beta1/query.rpc.Query"));
          });
        case 79:
          _context.t36 = _context.sent.createRpcQueryExtension(client);
          _context.t37 = {
            v1beta1: _context.t36
          };
          _context.next = 83;
          return Promise.resolve().then(function () {
            return _interopRequireWildcard(require("../cosmos/tx/v1beta1/service.rpc.Service"));
          });
        case 83:
          _context.t38 = _context.sent.createRpcQueryExtension(client);
          _context.t39 = {
            v1beta1: _context.t38
          };
          _context.next = 87;
          return Promise.resolve().then(function () {
            return _interopRequireWildcard(require("../cosmos/upgrade/v1beta1/query.rpc.Query"));
          });
        case 87:
          _context.t40 = _context.sent.createRpcQueryExtension(client);
          _context.t41 = {
            v1beta1: _context.t40
          };
          _context.t42 = {
            app: _context.t5,
            auth: _context.t7,
            authz: _context.t9,
            bank: _context.t11,
            base: _context.t16,
            distribution: _context.t18,
            evidence: _context.t20,
            feegrant: _context.t22,
            gov: _context.t25,
            group: _context.t27,
            mint: _context.t29,
            nft: _context.t31,
            params: _context.t33,
            slashing: _context.t35,
            staking: _context.t37,
            tx: _context.t39,
            upgrade: _context.t41
          };
          return _context.abrupt("return", {
            gitopia: _context.t3,
            cosmos: _context.t42
          });
        case 91:
        case "end":
          return _context.stop();
      }
    }, _callee);
  }));
  return function createRPCQueryClient(_x) {
    return _ref2.apply(this, arguments);
  };
}();