"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _typeof = require("@babel/runtime/helpers/typeof");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.createLCDClient = void 0;
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
var _lcd = require("@cosmology/lcd");
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 createLCDClient = exports.createLCDClient = /*#__PURE__*/function () {
  var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(_ref) {
    var restEndpoint, requestClient;
    return _regenerator["default"].wrap(function _callee$(_context) {
      while (1) switch (_context.prev = _context.next) {
        case 0:
          restEndpoint = _ref.restEndpoint;
          requestClient = new _lcd.LCDClient({
            restEndpoint: restEndpoint
          });
          _context.next = 4;
          return Promise.resolve().then(function () {
            return _interopRequireWildcard(require("./query.lcd"));
          });
        case 4:
          _context.t0 = _context.sent.LCDQueryClient;
          _context.t1 = {
            requestClient: requestClient
          };
          _context.t2 = new _context.t0(_context.t1);
          _context.next = 9;
          return Promise.resolve().then(function () {
            return _interopRequireWildcard(require("../rewards/query.lcd"));
          });
        case 9:
          _context.t3 = _context.sent.LCDQueryClient;
          _context.t4 = {
            requestClient: requestClient
          };
          _context.t5 = new _context.t3(_context.t4);
          _context.t6 = {
            gitopia: _context.t2,
            rewards: _context.t5
          };
          _context.t7 = {
            gitopia: _context.t6
          };
          _context.next = 16;
          return Promise.resolve().then(function () {
            return _interopRequireWildcard(require("../cosmos/auth/v1beta1/query.lcd"));
          });
        case 16:
          _context.t8 = _context.sent.LCDQueryClient;
          _context.t9 = {
            requestClient: requestClient
          };
          _context.t10 = new _context.t8(_context.t9);
          _context.t11 = {
            v1beta1: _context.t10
          };
          _context.next = 22;
          return Promise.resolve().then(function () {
            return _interopRequireWildcard(require("../cosmos/authz/v1beta1/query.lcd"));
          });
        case 22:
          _context.t12 = _context.sent.LCDQueryClient;
          _context.t13 = {
            requestClient: requestClient
          };
          _context.t14 = new _context.t12(_context.t13);
          _context.t15 = {
            v1beta1: _context.t14
          };
          _context.next = 28;
          return Promise.resolve().then(function () {
            return _interopRequireWildcard(require("../cosmos/bank/v1beta1/query.lcd"));
          });
        case 28:
          _context.t16 = _context.sent.LCDQueryClient;
          _context.t17 = {
            requestClient: requestClient
          };
          _context.t18 = new _context.t16(_context.t17);
          _context.t19 = {
            v1beta1: _context.t18
          };
          _context.next = 34;
          return Promise.resolve().then(function () {
            return _interopRequireWildcard(require("../cosmos/base/node/v1beta1/query.lcd"));
          });
        case 34:
          _context.t20 = _context.sent.LCDQueryClient;
          _context.t21 = {
            requestClient: requestClient
          };
          _context.t22 = new _context.t20(_context.t21);
          _context.t23 = {
            v1beta1: _context.t22
          };
          _context.next = 40;
          return Promise.resolve().then(function () {
            return _interopRequireWildcard(require("../cosmos/base/tendermint/v1beta1/query.lcd"));
          });
        case 40:
          _context.t24 = _context.sent.LCDQueryClient;
          _context.t25 = {
            requestClient: requestClient
          };
          _context.t26 = new _context.t24(_context.t25);
          _context.t27 = {
            v1beta1: _context.t26
          };
          _context.t28 = {
            node: _context.t23,
            tendermint: _context.t27
          };
          _context.next = 47;
          return Promise.resolve().then(function () {
            return _interopRequireWildcard(require("../cosmos/distribution/v1beta1/query.lcd"));
          });
        case 47:
          _context.t29 = _context.sent.LCDQueryClient;
          _context.t30 = {
            requestClient: requestClient
          };
          _context.t31 = new _context.t29(_context.t30);
          _context.t32 = {
            v1beta1: _context.t31
          };
          _context.next = 53;
          return Promise.resolve().then(function () {
            return _interopRequireWildcard(require("../cosmos/evidence/v1beta1/query.lcd"));
          });
        case 53:
          _context.t33 = _context.sent.LCDQueryClient;
          _context.t34 = {
            requestClient: requestClient
          };
          _context.t35 = new _context.t33(_context.t34);
          _context.t36 = {
            v1beta1: _context.t35
          };
          _context.next = 59;
          return Promise.resolve().then(function () {
            return _interopRequireWildcard(require("../cosmos/feegrant/v1beta1/query.lcd"));
          });
        case 59:
          _context.t37 = _context.sent.LCDQueryClient;
          _context.t38 = {
            requestClient: requestClient
          };
          _context.t39 = new _context.t37(_context.t38);
          _context.t40 = {
            v1beta1: _context.t39
          };
          _context.next = 65;
          return Promise.resolve().then(function () {
            return _interopRequireWildcard(require("../cosmos/gov/v1/query.lcd"));
          });
        case 65:
          _context.t41 = _context.sent.LCDQueryClient;
          _context.t42 = {
            requestClient: requestClient
          };
          _context.t43 = new _context.t41(_context.t42);
          _context.next = 70;
          return Promise.resolve().then(function () {
            return _interopRequireWildcard(require("../cosmos/gov/v1beta1/query.lcd"));
          });
        case 70:
          _context.t44 = _context.sent.LCDQueryClient;
          _context.t45 = {
            requestClient: requestClient
          };
          _context.t46 = new _context.t44(_context.t45);
          _context.t47 = {
            v1: _context.t43,
            v1beta1: _context.t46
          };
          _context.next = 76;
          return Promise.resolve().then(function () {
            return _interopRequireWildcard(require("../cosmos/group/v1/query.lcd"));
          });
        case 76:
          _context.t48 = _context.sent.LCDQueryClient;
          _context.t49 = {
            requestClient: requestClient
          };
          _context.t50 = new _context.t48(_context.t49);
          _context.t51 = {
            v1: _context.t50
          };
          _context.next = 82;
          return Promise.resolve().then(function () {
            return _interopRequireWildcard(require("../cosmos/mint/v1beta1/query.lcd"));
          });
        case 82:
          _context.t52 = _context.sent.LCDQueryClient;
          _context.t53 = {
            requestClient: requestClient
          };
          _context.t54 = new _context.t52(_context.t53);
          _context.t55 = {
            v1beta1: _context.t54
          };
          _context.next = 88;
          return Promise.resolve().then(function () {
            return _interopRequireWildcard(require("../cosmos/nft/v1beta1/query.lcd"));
          });
        case 88:
          _context.t56 = _context.sent.LCDQueryClient;
          _context.t57 = {
            requestClient: requestClient
          };
          _context.t58 = new _context.t56(_context.t57);
          _context.t59 = {
            v1beta1: _context.t58
          };
          _context.next = 94;
          return Promise.resolve().then(function () {
            return _interopRequireWildcard(require("../cosmos/params/v1beta1/query.lcd"));
          });
        case 94:
          _context.t60 = _context.sent.LCDQueryClient;
          _context.t61 = {
            requestClient: requestClient
          };
          _context.t62 = new _context.t60(_context.t61);
          _context.t63 = {
            v1beta1: _context.t62
          };
          _context.next = 100;
          return Promise.resolve().then(function () {
            return _interopRequireWildcard(require("../cosmos/slashing/v1beta1/query.lcd"));
          });
        case 100:
          _context.t64 = _context.sent.LCDQueryClient;
          _context.t65 = {
            requestClient: requestClient
          };
          _context.t66 = new _context.t64(_context.t65);
          _context.t67 = {
            v1beta1: _context.t66
          };
          _context.next = 106;
          return Promise.resolve().then(function () {
            return _interopRequireWildcard(require("../cosmos/staking/v1beta1/query.lcd"));
          });
        case 106:
          _context.t68 = _context.sent.LCDQueryClient;
          _context.t69 = {
            requestClient: requestClient
          };
          _context.t70 = new _context.t68(_context.t69);
          _context.t71 = {
            v1beta1: _context.t70
          };
          _context.next = 112;
          return Promise.resolve().then(function () {
            return _interopRequireWildcard(require("../cosmos/tx/v1beta1/service.lcd"));
          });
        case 112:
          _context.t72 = _context.sent.LCDQueryClient;
          _context.t73 = {
            requestClient: requestClient
          };
          _context.t74 = new _context.t72(_context.t73);
          _context.t75 = {
            v1beta1: _context.t74
          };
          _context.next = 118;
          return Promise.resolve().then(function () {
            return _interopRequireWildcard(require("../cosmos/upgrade/v1beta1/query.lcd"));
          });
        case 118:
          _context.t76 = _context.sent.LCDQueryClient;
          _context.t77 = {
            requestClient: requestClient
          };
          _context.t78 = new _context.t76(_context.t77);
          _context.t79 = {
            v1beta1: _context.t78
          };
          _context.t80 = {
            auth: _context.t11,
            authz: _context.t15,
            bank: _context.t19,
            base: _context.t28,
            distribution: _context.t32,
            evidence: _context.t36,
            feegrant: _context.t40,
            gov: _context.t47,
            group: _context.t51,
            mint: _context.t55,
            nft: _context.t59,
            params: _context.t63,
            slashing: _context.t67,
            staking: _context.t71,
            tx: _context.t75,
            upgrade: _context.t79
          };
          return _context.abrupt("return", {
            gitopia: _context.t7,
            cosmos: _context.t80
          });
        case 124:
        case "end":
          return _context.stop();
      }
    }, _callee);
  }));
  return function createLCDClient(_x) {
    return _ref2.apply(this, arguments);
  };
}();