@fileverse-dev/formulajs 4.4.11-mod-41-patch-2 → 4.4.11-mod-43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- /* @fileverse-dev/formulajs v4.4.11-mod-41-patch-2 */
1
+ /* @fileverse-dev/formulajs v4.4.11-mod-43 */
2
2
  var _excluded = [ "confirmations", "dataDecoded" ];
3
3
 
4
4
  function _objectWithoutProperties(e, t) {
@@ -10999,16 +10999,16 @@ function _typeof(o) {
10999
10999
  return _fromEnsNameToAddress.apply(this, arguments);
11000
11000
  }
11001
11001
  function _fromEnsNameToAddress() {
11002
- _fromEnsNameToAddress = _asyncToGenerator(_regeneratorRuntime().mark((function _callee2(name) {
11002
+ _fromEnsNameToAddress = _asyncToGenerator(_regeneratorRuntime().mark((function _callee3(name) {
11003
11003
  var ALCHEMY_KEY, provider, resolved;
11004
- return _regeneratorRuntime().wrap((function _callee2$(_context2) {
11005
- while (1) switch (_context2.prev = _context2.next) {
11004
+ return _regeneratorRuntime().wrap((function _callee3$(_context3) {
11005
+ while (1) switch (_context3.prev = _context3.next) {
11006
11006
  case 0:
11007
11007
  if (!(typeof ethers === "undefined")) {
11008
- _context2.next = 3;
11008
+ _context3.next = 3;
11009
11009
  break;
11010
11010
  }
11011
- _context2.next = 3;
11011
+ _context3.next = 3;
11012
11012
  return new Promise((function(resolve, reject) {
11013
11013
  var script = document.createElement("script");
11014
11014
  script.src = "https://cdn.jsdelivr.net/npm/ethers@6.10.0/dist/ethers.umd.min.js";
@@ -11020,33 +11020,33 @@ function _typeof(o) {
11020
11020
  case 3:
11021
11021
  ALCHEMY_KEY = window.localStorage.getItem(UTILITY.ALCHEMY_API_KEY);
11022
11022
  if (ALCHEMY_KEY) {
11023
- _context2.next = 7;
11023
+ _context3.next = 7;
11024
11024
  break;
11025
11025
  }
11026
11026
  console.error("alchemy api key missing");
11027
- return _context2.abrupt("return", null);
11027
+ return _context3.abrupt("return", null);
11028
11028
 
11029
11029
  case 7:
11030
11030
  provider = new ethers.AlchemyProvider("mainnet", ALCHEMY_KEY);
11031
- _context2.prev = 8;
11032
- _context2.next = 11;
11031
+ _context3.prev = 8;
11032
+ _context3.next = 11;
11033
11033
  return provider.resolveName(name);
11034
11034
 
11035
11035
  case 11:
11036
- resolved = _context2.sent;
11037
- return _context2.abrupt("return", resolved || null);
11036
+ resolved = _context3.sent;
11037
+ return _context3.abrupt("return", resolved || null);
11038
11038
 
11039
11039
  case 15:
11040
- _context2.prev = 15;
11041
- _context2.t0 = _context2["catch"](8);
11042
- console.error("ENS resolution failed:", _context2.t0.message);
11043
- return _context2.abrupt("return", null);
11040
+ _context3.prev = 15;
11041
+ _context3.t0 = _context3["catch"](8);
11042
+ console.error("ENS resolution failed:", _context3.t0.message);
11043
+ return _context3.abrupt("return", null);
11044
11044
 
11045
11045
  case 19:
11046
11046
  case "end":
11047
- return _context2.stop();
11047
+ return _context3.stop();
11048
11048
  }
11049
- }), _callee2, null, [ [ 8, 15 ] ]);
11049
+ }), _callee3, null, [ [ 8, 15 ] ]);
11050
11050
  })));
11051
11051
  return _fromEnsNameToAddress.apply(this, arguments);
11052
11052
  }
@@ -11054,53 +11054,53 @@ function _typeof(o) {
11054
11054
  return _handleScanRequest.apply(this, arguments);
11055
11055
  }
11056
11056
  function _handleScanRequest() {
11057
- _handleScanRequest = _asyncToGenerator(_regeneratorRuntime().mark((function _callee3(_ref2) {
11057
+ _handleScanRequest = _asyncToGenerator(_regeneratorRuntime().mark((function _callee4(_ref2) {
11058
11058
  var scanKey, baseUrl, type, chain, address, startDate, endDate, _ref2$page, page, _ref2$offset, offset, API_KEY, chainId, ACTION_MAP, action, url, _yield$Promise$all, _yield$Promise$all2, startBlock, endBlock, res, json;
11059
- return _regeneratorRuntime().wrap((function _callee3$(_context3) {
11060
- while (1) switch (_context3.prev = _context3.next) {
11059
+ return _regeneratorRuntime().wrap((function _callee4$(_context4) {
11060
+ while (1) switch (_context4.prev = _context4.next) {
11061
11061
  case 0:
11062
11062
  scanKey = _ref2.scanKey, baseUrl = _ref2.baseUrl, type = _ref2.type, chain = _ref2.chain,
11063
11063
  address = _ref2.address, startDate = _ref2.startDate, endDate = _ref2.endDate, _ref2$page = _ref2.page,
11064
11064
  page = _ref2$page === void 0 ? 1 : _ref2$page, _ref2$offset = _ref2.offset, offset = _ref2$offset === void 0 ? 10 : _ref2$offset;
11065
11065
  API_KEY = window.localStorage.getItem(scanKey);
11066
11066
  if (API_KEY) {
11067
- _context3.next = 4;
11067
+ _context4.next = 4;
11068
11068
  break;
11069
11069
  }
11070
- return _context3.abrupt("return", "".concat(scanKey).concat(ERROR_MESSAGES_FLAG.MISSING_KEY));
11070
+ return _context4.abrupt("return", "".concat(scanKey).concat(ERROR_MESSAGES_FLAG.MISSING_KEY));
11071
11071
 
11072
11072
  case 4:
11073
11073
  if (!(API_KEY === "xxxx")) {
11074
- _context3.next = 6;
11074
+ _context4.next = 6;
11075
11075
  break;
11076
11076
  }
11077
- return _context3.abrupt("return", "".concat(scanKey).concat(ERROR_MESSAGES_FLAG.RATE_LIMIT));
11077
+ return _context4.abrupt("return", "".concat(scanKey).concat(ERROR_MESSAGES_FLAG.RATE_LIMIT));
11078
11078
 
11079
11079
  case 6:
11080
11080
  chainId = CHAIN_ID_MAP[chain === null || chain === void 0 ? void 0 : chain.toLowerCase()];
11081
11081
  if (chainId) {
11082
- _context3.next = 9;
11082
+ _context4.next = 9;
11083
11083
  break;
11084
11084
  }
11085
- return _context3.abrupt("return", "".concat(scanKey).concat(ERROR_MESSAGES_FLAG.INVALID_CHAIN));
11085
+ return _context4.abrupt("return", "".concat(scanKey).concat(ERROR_MESSAGES_FLAG.INVALID_CHAIN));
11086
11086
 
11087
11087
  case 9:
11088
11088
  if (isAddress(address)) {
11089
- _context3.next = 13;
11089
+ _context4.next = 13;
11090
11090
  break;
11091
11091
  }
11092
- _context3.next = 12;
11092
+ _context4.next = 12;
11093
11093
  return fromEnsNameToAddress(address);
11094
11094
 
11095
11095
  case 12:
11096
- address = _context3.sent;
11096
+ address = _context4.sent;
11097
11097
 
11098
11098
  case 13:
11099
11099
  if (address) {
11100
- _context3.next = 15;
11100
+ _context4.next = 15;
11101
11101
  break;
11102
11102
  }
11103
- return _context3.abrupt("return", "".concat(address).concat(ERROR_MESSAGES_FLAG.INVALID_PARAM));
11103
+ return _context4.abrupt("return", "".concat(address).concat(ERROR_MESSAGES_FLAG.INVALID_PARAM));
11104
11104
 
11105
11105
  case 15:
11106
11106
  ACTION_MAP = {
@@ -11111,36 +11111,36 @@ function _typeof(o) {
11111
11111
  };
11112
11112
  action = ACTION_MAP[type];
11113
11113
  if (action) {
11114
- _context3.next = 19;
11114
+ _context4.next = 19;
11115
11115
  break;
11116
11116
  }
11117
- return _context3.abrupt("return", "".concat(scanKey).concat(ERROR_MESSAGES_FLAG.INVALID_TYPE));
11117
+ return _context4.abrupt("return", "".concat(scanKey).concat(ERROR_MESSAGES_FLAG.INVALID_TYPE));
11118
11118
 
11119
11119
  case 19:
11120
11120
  if (scanKey === SERVICE_API_KEY.Basescan) chainId = "base";
11121
11121
  if (scanKey === SERVICE_API_KEY.Gnosisscan) chainId = "gnosis";
11122
11122
  url = "".concat(baseUrl, "?chainid=").concat(chainId, "&module=account&action=").concat(action, "&apikey=").concat(API_KEY);
11123
11123
  if (![ "all-txns", "token-txns", "nft-txns" ].includes(type)) {
11124
- _context3.next = 35;
11124
+ _context4.next = 35;
11125
11125
  break;
11126
11126
  }
11127
11127
  if (address) {
11128
- _context3.next = 25;
11128
+ _context4.next = 25;
11129
11129
  break;
11130
11130
  }
11131
- return _context3.abrupt("return", "".concat(scanKey).concat(ERROR_MESSAGES_FLAG.INVALID_ADDRESS));
11131
+ return _context4.abrupt("return", "".concat(scanKey).concat(ERROR_MESSAGES_FLAG.INVALID_ADDRESS));
11132
11132
 
11133
11133
  case 25:
11134
11134
  url += "&address=".concat(address, "&startblock=0&endblock=99999999&sort=asc");
11135
11135
  if (!(!isNaN(startDate) && !isNaN(endDate))) {
11136
- _context3.next = 34;
11136
+ _context4.next = 34;
11137
11137
  break;
11138
11138
  }
11139
- _context3.next = 29;
11139
+ _context4.next = 29;
11140
11140
  return Promise.all([ fromTimeStampToBlock(toTimestamp(startDate), chain, API_KEY), fromTimeStampToBlock(toTimestamp(endDate), chain, API_KEY) ]);
11141
11141
 
11142
11142
  case 29:
11143
- _yield$Promise$all = _context3.sent;
11143
+ _yield$Promise$all = _context4.sent;
11144
11144
  _yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 2);
11145
11145
  startBlock = _yield$Promise$all2[0];
11146
11146
  endBlock = _yield$Promise$all2[1];
@@ -11150,78 +11150,128 @@ function _typeof(o) {
11150
11150
  url += "&page=".concat(page, "&offset=").concat(offset);
11151
11151
 
11152
11152
  case 35:
11153
- _context3.prev = 35;
11154
- _context3.next = 38;
11153
+ _context4.prev = 35;
11154
+ _context4.next = 38;
11155
11155
  return fetch(url);
11156
11156
 
11157
11157
  case 38:
11158
- res = _context3.sent;
11158
+ res = _context4.sent;
11159
11159
  if (res.ok) {
11160
- _context3.next = 41;
11160
+ _context4.next = 41;
11161
11161
  break;
11162
11162
  }
11163
11163
  throw new Error("HTTP error: ".concat(res.status));
11164
11164
 
11165
11165
  case 41:
11166
- _context3.next = 43;
11166
+ _context4.next = 43;
11167
11167
  return res.json();
11168
11168
 
11169
11169
  case 43:
11170
- json = _context3.sent;
11170
+ json = _context4.sent;
11171
11171
  if (!(typeof json.result === "string")) {
11172
- _context3.next = 49;
11172
+ _context4.next = 49;
11173
11173
  break;
11174
11174
  }
11175
11175
  if (!json.result.includes("Invalid API Key")) {
11176
- _context3.next = 47;
11176
+ _context4.next = 47;
11177
11177
  break;
11178
11178
  }
11179
- return _context3.abrupt("return", "".concat(scanKey).concat(ERROR_MESSAGES_FLAG.INVALID_API_KEY));
11179
+ return _context4.abrupt("return", "".concat(scanKey).concat(ERROR_MESSAGES_FLAG.INVALID_API_KEY));
11180
11180
 
11181
11181
  case 47:
11182
11182
  if (!json.result.includes("Max rate limit reached")) {
11183
- _context3.next = 49;
11183
+ _context4.next = 49;
11184
11184
  break;
11185
11185
  }
11186
- return _context3.abrupt("return", "".concat(scanKey).concat(ERROR_MESSAGES_FLAG.RATE_LIMIT));
11186
+ return _context4.abrupt("return", "".concat(scanKey).concat(ERROR_MESSAGES_FLAG.RATE_LIMIT));
11187
11187
 
11188
11188
  case 49:
11189
- return _context3.abrupt("return", json.result);
11189
+ return _context4.abrupt("return", json.result);
11190
11190
 
11191
11191
  case 52:
11192
- _context3.prev = 52;
11193
- _context3.t0 = _context3["catch"](35);
11194
- console.error("[".concat(scanKey, "]"), _context3.t0);
11195
- return _context3.abrupt("return", ERROR_MESSAGES_FLAG.DEFAULT);
11192
+ _context4.prev = 52;
11193
+ _context4.t0 = _context4["catch"](35);
11194
+ console.error("[".concat(scanKey, "]"), _context4.t0);
11195
+ return _context4.abrupt("return", ERROR_MESSAGES_FLAG.DEFAULT);
11196
11196
 
11197
11197
  case 56:
11198
11198
  case "end":
11199
- return _context3.stop();
11199
+ return _context4.stop();
11200
11200
  }
11201
- }), _callee3, null, [ [ 35, 52 ] ]);
11201
+ }), _callee4, null, [ [ 35, 52 ] ]);
11202
11202
  })));
11203
11203
  return _handleScanRequest.apply(this, arguments);
11204
11204
  }
11205
- function FIREFLY(_x6, _x7, _x8) {
11205
+ var fromUsernameToFid = function() {
11206
+ var _ref3 = _asyncToGenerator(_regeneratorRuntime().mark((function _callee2(username) {
11207
+ var url, res, json, users, user;
11208
+ return _regeneratorRuntime().wrap((function _callee2$(_context2) {
11209
+ while (1) switch (_context2.prev = _context2.next) {
11210
+ case 0:
11211
+ if (username) {
11212
+ _context2.next = 2;
11213
+ break;
11214
+ }
11215
+ return _context2.abrupt("return", null);
11216
+
11217
+ case 2:
11218
+ url = "https://api.neynar.com/v2/farcaster/user/search/";
11219
+ _context2.next = 5;
11220
+ return fetch(url, {
11221
+ query: {
11222
+ q: username
11223
+ },
11224
+ headers: {
11225
+ "x-api-key": API_KEY,
11226
+ "x-neynar-experimental": "false"
11227
+ }
11228
+ });
11229
+
11230
+ case 5:
11231
+ res = _context2.sent;
11232
+ _context2.next = 8;
11233
+ return res.json();
11234
+
11235
+ case 8:
11236
+ json = _context2.sent;
11237
+ users = json.result && json.result.users;
11238
+ user = users.find((function(user) {
11239
+ return user.username === username;
11240
+ }));
11241
+ return _context2.abrupt("return", user && user.fid || null);
11242
+
11243
+ case 12:
11244
+ case "end":
11245
+ return _context2.stop();
11246
+ }
11247
+ }), _callee2);
11248
+ })));
11249
+ return function fromUsernameToFid(_x6) {
11250
+ return _ref3.apply(this, arguments);
11251
+ };
11252
+ }();
11253
+ function FIREFLY() {
11206
11254
  return _FIREFLY.apply(this, arguments);
11207
11255
  }
11208
11256
  function _FIREFLY() {
11209
- _FIREFLY = _asyncToGenerator(_regeneratorRuntime().mark((function _callee4(platform, contentType, identifier) {
11257
+ _FIREFLY = _asyncToGenerator(_regeneratorRuntime().mark((function _callee5() {
11210
11258
  var _typeMap$platform;
11211
- var start, end, API_KEY, baseUrl, headers, typeMap, platformType, query, url, res, json, _args4 = arguments;
11212
- return _regeneratorRuntime().wrap((function _callee4$(_context4) {
11213
- while (1) switch (_context4.prev = _context4.next) {
11259
+ var _argsToArray3, _argsToArray4, platform, contentType, identifier, _argsToArray4$, start, _argsToArray4$2, end, API_KEY, baseUrl, headers, typeMap, platformType, query, url, res, json, _args5 = arguments;
11260
+ return _regeneratorRuntime().wrap((function _callee5$(_context5) {
11261
+ while (1) switch (_context5.prev = _context5.next) {
11214
11262
  case 0:
11215
- start = _args4.length > 3 && _args4[3] !== undefined ? _args4[3] : 0;
11216
- end = _args4.length > 4 && _args4[4] !== undefined ? _args4[4] : 10;
11263
+ _argsToArray3 = argsToArray(_args5), _argsToArray4 = _slicedToArray(_argsToArray3, 5),
11264
+ platform = _argsToArray4[0], contentType = _argsToArray4[1], identifier = _argsToArray4[2],
11265
+ _argsToArray4$ = _argsToArray4[3], start = _argsToArray4$ === void 0 ? 0 : _argsToArray4$,
11266
+ _argsToArray4$2 = _argsToArray4[4], end = _argsToArray4$2 === void 0 ? 10 : _argsToArray4$2;
11217
11267
  API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Firefly);
11218
11268
  if (API_KEY) {
11219
- _context4.next = 5;
11269
+ _context5.next = 4;
11220
11270
  break;
11221
11271
  }
11222
- return _context4.abrupt("return", "".concat(SERVICE_API_KEY.Firefly).concat(ERROR_MESSAGES_FLAG.MISSING_KEY));
11272
+ return _context5.abrupt("return", "".concat(SERVICE_API_KEY.Firefly).concat(ERROR_MESSAGES_FLAG.MISSING_KEY));
11223
11273
 
11224
- case 5:
11274
+ case 4:
11225
11275
  baseUrl = "https://openapi.firefly.land/v1/fileverse/fetch";
11226
11276
  headers = {
11227
11277
  "x-api-key": API_KEY
@@ -11239,12 +11289,12 @@ function _typeof(o) {
11239
11289
  };
11240
11290
  platformType = (_typeMap$platform = typeMap[platform]) === null || _typeMap$platform === void 0 ? void 0 : _typeMap$platform[contentType];
11241
11291
  if (platformType) {
11242
- _context4.next = 11;
11292
+ _context5.next = 10;
11243
11293
  break;
11244
11294
  }
11245
- return _context4.abrupt("return", "".concat(SERVICE_API_KEY.Firefly).concat(ERROR_MESSAGES_FLAG.INVALID_TYPE));
11295
+ return _context5.abrupt("return", "".concat(SERVICE_API_KEY.Firefly).concat(ERROR_MESSAGES_FLAG.INVALID_TYPE));
11246
11296
 
11247
- case 11:
11297
+ case 10:
11248
11298
  query = identifier.split(",").map((function(s) {
11249
11299
  return s.trim();
11250
11300
  })).filter(Boolean).join(",");
@@ -11253,34 +11303,34 @@ function _typeof(o) {
11253
11303
  url.searchParams.set("type", platformType);
11254
11304
  url.searchParams.set("start", String(start));
11255
11305
  url.searchParams.set("end", String(end));
11256
- _context4.prev = 17;
11257
- _context4.next = 20;
11306
+ _context5.prev = 16;
11307
+ _context5.next = 19;
11258
11308
  return fetch(url.toString(), {
11259
11309
  headers: headers
11260
11310
  });
11261
11311
 
11262
- case 20:
11263
- res = _context4.sent;
11312
+ case 19:
11313
+ res = _context5.sent;
11264
11314
  if (res.ok) {
11265
- _context4.next = 23;
11315
+ _context5.next = 22;
11266
11316
  break;
11267
11317
  }
11268
11318
  throw new Error("HTTP ".concat(res.status));
11269
11319
 
11270
- case 23:
11271
- _context4.next = 25;
11320
+ case 22:
11321
+ _context5.next = 24;
11272
11322
  return res.json();
11273
11323
 
11274
- case 25:
11275
- json = _context4.sent;
11324
+ case 24:
11325
+ json = _context5.sent;
11276
11326
  if (Array.isArray(json === null || json === void 0 ? void 0 : json.data)) {
11277
- _context4.next = 28;
11327
+ _context5.next = 27;
11278
11328
  break;
11279
11329
  }
11280
- return _context4.abrupt("return", []);
11330
+ return _context5.abrupt("return", []);
11281
11331
 
11282
- case 28:
11283
- return _context4.abrupt("return", json.data.map((function(item) {
11332
+ case 27:
11333
+ return _context5.abrupt("return", json.data.map((function(item) {
11284
11334
  var flat = {};
11285
11335
  for (var _i10 = 0, _Object$entries = Object.entries(item); _i10 < _Object$entries.length; _i10++) {
11286
11336
  var _Object$entries$_i = _slicedToArray(_Object$entries[_i10], 2), key = _Object$entries$_i[0], _value5 = _Object$entries$_i[1];
@@ -11292,39 +11342,42 @@ function _typeof(o) {
11292
11342
  return flat;
11293
11343
  })));
11294
11344
 
11295
- case 31:
11296
- _context4.prev = 31;
11297
- _context4.t0 = _context4["catch"](17);
11298
- console.error("FIREFLY fetch error:", _context4.t0);
11299
- return _context4.abrupt("return", ERROR_MESSAGES_FLAG.DEFAULT);
11345
+ case 30:
11346
+ _context5.prev = 30;
11347
+ _context5.t0 = _context5["catch"](16);
11348
+ console.error("FIREFLY fetch error:", _context5.t0);
11349
+ return _context5.abrupt("return", ERROR_MESSAGES_FLAG.DEFAULT);
11300
11350
 
11301
- case 35:
11351
+ case 34:
11302
11352
  case "end":
11303
- return _context4.stop();
11353
+ return _context5.stop();
11304
11354
  }
11305
- }), _callee4, null, [ [ 17, 31 ] ]);
11355
+ }), _callee5, null, [ [ 16, 30 ] ]);
11306
11356
  })));
11307
11357
  return _FIREFLY.apply(this, arguments);
11308
11358
  }
11309
- function BLOCKSCOUT(_x9, _x0, _x1, _x10, _x11, _x12, _x13) {
11359
+ function BLOCKSCOUT() {
11310
11360
  return _BLOCKSCOUT.apply(this, arguments);
11311
11361
  }
11312
11362
  function _BLOCKSCOUT() {
11313
- _BLOCKSCOUT = _asyncToGenerator(_regeneratorRuntime().mark((function _callee5(address, type, chain, startTimestamp, endTimestamp, page, offset) {
11314
- var currentTimestamp, hostname, requestUrl, _json$result, _json$result2, response, json;
11315
- return _regeneratorRuntime().wrap((function _callee5$(_context5) {
11316
- while (1) switch (_context5.prev = _context5.next) {
11363
+ _BLOCKSCOUT = _asyncToGenerator(_regeneratorRuntime().mark((function _callee6() {
11364
+ var _argsToArray5, _argsToArray6, address, type, chain, startTimestamp, endTimestamp, page, offset, currentTimestamp, hostname, requestUrl, _json$result, _json$result2, response, json, _args6 = arguments;
11365
+ return _regeneratorRuntime().wrap((function _callee6$(_context6) {
11366
+ while (1) switch (_context6.prev = _context6.next) {
11317
11367
  case 0:
11368
+ _argsToArray5 = argsToArray(_args6), _argsToArray6 = _slicedToArray(_argsToArray5, 7),
11369
+ address = _argsToArray6[0], type = _argsToArray6[1], chain = _argsToArray6[2], startTimestamp = _argsToArray6[3],
11370
+ endTimestamp = _argsToArray6[4], page = _argsToArray6[5], offset = _argsToArray6[6];
11318
11371
  if (!chain) {
11319
11372
  chain = "ethereum";
11320
11373
  }
11321
11374
  if (type) {
11322
- _context5.next = 3;
11375
+ _context6.next = 4;
11323
11376
  break;
11324
11377
  }
11325
- return _context5.abrupt("return", "TYPE_MISSING");
11378
+ return _context6.abrupt("return", "TYPE_MISSING");
11326
11379
 
11327
- case 3:
11380
+ case 4:
11328
11381
  if (!startTimestamp) {
11329
11382
  currentTimestamp = Date.now();
11330
11383
  startTimestamp = currentTimestamp - 30 * 24 * 60 * 60 * 1e3;
@@ -11337,96 +11390,96 @@ function _typeof(o) {
11337
11390
  endTimestamp = toTimestamp(endTimestamp);
11338
11391
  }
11339
11392
  if (isAddress(address)) {
11340
- _context5.next = 10;
11393
+ _context6.next = 11;
11341
11394
  break;
11342
11395
  }
11343
- _context5.next = 9;
11396
+ _context6.next = 10;
11344
11397
  return fromEnsNameToAddress(address);
11345
11398
 
11346
- case 9:
11347
- address = _context5.sent;
11348
-
11349
11399
  case 10:
11400
+ address = _context6.sent;
11401
+
11402
+ case 11:
11350
11403
  if (address) {
11351
- _context5.next = 12;
11404
+ _context6.next = 13;
11352
11405
  break;
11353
11406
  }
11354
- return _context5.abrupt("return", "".concat(address).concat(ERROR_MESSAGES_FLAG.INVALID_PARAM));
11407
+ return _context6.abrupt("return", "".concat(address).concat(ERROR_MESSAGES_FLAG.INVALID_PARAM));
11355
11408
 
11356
- case 12:
11409
+ case 13:
11357
11410
  hostname = BLOCKSCOUT_CHAINS_MAP[chain];
11358
- _context5.t0 = type;
11359
- _context5.next = _context5.t0 === "stat" ? 16 : _context5.t0 === "txns" ? 18 : _context5.t0 === "tokens" ? 20 : 22;
11411
+ _context6.t0 = type;
11412
+ _context6.next = _context6.t0 === "stat" ? 17 : _context6.t0 === "txns" ? 19 : _context6.t0 === "tokens" ? 21 : 23;
11360
11413
  break;
11361
11414
 
11362
- case 16:
11415
+ case 17:
11363
11416
  requestUrl = "".concat(hostname, "/api/v2/addresses/").concat(address, "/counters");
11364
- return _context5.abrupt("break", 23);
11417
+ return _context6.abrupt("break", 24);
11365
11418
 
11366
- case 18:
11419
+ case 19:
11367
11420
  requestUrl = "".concat(hostname, "/api?module=account&action=txlist&address=").concat(address, "&start_timestamp=").concat(startTimestamp, "&end_timestamp=").concat(endTimestamp, "&page=").concat(page, "&offset=").concat(offset, "&sort=asc");
11368
- return _context5.abrupt("break", 23);
11421
+ return _context6.abrupt("break", 24);
11369
11422
 
11370
- case 20:
11423
+ case 21:
11371
11424
  requestUrl = "".concat(hostname, "/api?module=account&action=tokenlist&address=").concat(address);
11372
- return _context5.abrupt("break", 23);
11373
-
11374
- case 22:
11375
- return _context5.abrupt("return", "INVALID_TYPE");
11425
+ return _context6.abrupt("break", 24);
11376
11426
 
11377
11427
  case 23:
11378
- _context5.prev = 23;
11379
- _context5.next = 26;
11428
+ return _context6.abrupt("return", "INVALID_TYPE");
11429
+
11430
+ case 24:
11431
+ _context6.prev = 24;
11432
+ _context6.next = 27;
11380
11433
  return fetch(requestUrl);
11381
11434
 
11382
- case 26:
11383
- response = _context5.sent;
11435
+ case 27:
11436
+ response = _context6.sent;
11384
11437
  if (response.ok) {
11385
- _context5.next = 29;
11438
+ _context6.next = 30;
11386
11439
  break;
11387
11440
  }
11388
11441
  throw new Error("HTTP error! Status: ".concat(response.status));
11389
11442
 
11390
- case 29:
11391
- _context5.next = 31;
11443
+ case 30:
11444
+ _context6.next = 32;
11392
11445
  return response.json();
11393
11446
 
11394
- case 31:
11395
- json = _context5.sent;
11447
+ case 32:
11448
+ json = _context6.sent;
11396
11449
  console.log(json);
11397
11450
  if (!(json !== null && json !== void 0 && (_json$result = json.result) !== null && _json$result !== void 0 && _json$result.includes("Invalid parameter(s)"))) {
11398
- _context5.next = 35;
11451
+ _context6.next = 36;
11399
11452
  break;
11400
11453
  }
11401
- return _context5.abrupt("return", "INVALID_REQUEST_PARAMS");
11454
+ return _context6.abrupt("return", "INVALID_REQUEST_PARAMS");
11402
11455
 
11403
- case 35:
11456
+ case 36:
11404
11457
  if (!(json !== null && json !== void 0 && (_json$result2 = json.result) !== null && _json$result2 !== void 0 && _json$result2.includes("Not found"))) {
11405
- _context5.next = 37;
11458
+ _context6.next = 38;
11406
11459
  break;
11407
11460
  }
11408
- return _context5.abrupt("return", "ADDRESS_NOT_FOUND");
11461
+ return _context6.abrupt("return", "ADDRESS_NOT_FOUND");
11409
11462
 
11410
- case 37:
11463
+ case 38:
11411
11464
  if (!(type === "stat")) {
11412
- _context5.next = 39;
11465
+ _context6.next = 40;
11413
11466
  break;
11414
11467
  }
11415
- return _context5.abrupt("return", [ json ]);
11468
+ return _context6.abrupt("return", [ json ]);
11416
11469
 
11417
- case 39:
11418
- return _context5.abrupt("return", json.result);
11470
+ case 40:
11471
+ return _context6.abrupt("return", json.result);
11419
11472
 
11420
- case 42:
11421
- _context5.prev = 42;
11422
- _context5.t1 = _context5["catch"](23);
11423
- return _context5.abrupt("return", "ERROR IN FETCHING");
11473
+ case 43:
11474
+ _context6.prev = 43;
11475
+ _context6.t1 = _context6["catch"](24);
11476
+ return _context6.abrupt("return", "ERROR IN FETCHING");
11424
11477
 
11425
- case 45:
11478
+ case 46:
11426
11479
  case "end":
11427
- return _context5.stop();
11480
+ return _context6.stop();
11428
11481
  }
11429
- }), _callee5, null, [ [ 23, 42 ] ]);
11482
+ }), _callee6, null, [ [ 24, 43 ] ]);
11430
11483
  })));
11431
11484
  return _BLOCKSCOUT.apply(this, arguments);
11432
11485
  }
@@ -11434,17 +11487,15 @@ function _typeof(o) {
11434
11487
  return _GNOSIS.apply(this, arguments);
11435
11488
  }
11436
11489
  function _GNOSIS() {
11437
- _GNOSIS = _asyncToGenerator(_regeneratorRuntime().mark((function _callee6() {
11438
- var _len2, args, _key2, type, chain, address, startDate, endDate, page, limit, _args6 = arguments;
11439
- return _regeneratorRuntime().wrap((function _callee6$(_context6) {
11440
- while (1) switch (_context6.prev = _context6.next) {
11490
+ _GNOSIS = _asyncToGenerator(_regeneratorRuntime().mark((function _callee7() {
11491
+ var _argsToArray7, _argsToArray8, type, chain, address, startDate, endDate, page, limit, _args7 = arguments;
11492
+ return _regeneratorRuntime().wrap((function _callee7$(_context7) {
11493
+ while (1) switch (_context7.prev = _context7.next) {
11441
11494
  case 0:
11442
- for (_len2 = _args6.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
11443
- args[_key2] = _args6[_key2];
11444
- }
11445
- type = args[0], chain = args[1], address = args[2], startDate = args[3], endDate = args[4],
11446
- page = args[5], limit = args[6];
11447
- return _context6.abrupt("return", handleScanRequest({
11495
+ _argsToArray7 = argsToArray(_args7), _argsToArray8 = _slicedToArray(_argsToArray7, 7),
11496
+ type = _argsToArray8[0], chain = _argsToArray8[1], address = _argsToArray8[2], startDate = _argsToArray8[3],
11497
+ endDate = _argsToArray8[4], page = _argsToArray8[5], limit = _argsToArray8[6];
11498
+ return _context7.abrupt("return", handleScanRequest({
11448
11499
  scanKey: SERVICE_API_KEY.Gnosisscan,
11449
11500
  baseUrl: "https://api.gnosisscan.io/api",
11450
11501
  type: type,
@@ -11456,70 +11507,86 @@ function _typeof(o) {
11456
11507
  offset: limit
11457
11508
  }));
11458
11509
 
11459
- case 3:
11510
+ case 2:
11460
11511
  case "end":
11461
- return _context6.stop();
11512
+ return _context7.stop();
11462
11513
  }
11463
- }), _callee6);
11514
+ }), _callee7);
11464
11515
  })));
11465
11516
  return _GNOSIS.apply(this, arguments);
11466
11517
  }
11467
- function NEYNAR(_x14, _x15, _x16, _x17, _x18) {
11518
+ function NEYNAR() {
11468
11519
  return _NEYNAR.apply(this, arguments);
11469
11520
  }
11470
11521
  function _NEYNAR() {
11471
- _NEYNAR = _asyncToGenerator(_regeneratorRuntime().mark((function _callee7(fid, viewerFid, sortType, limit, cursor) {
11472
- var API_KEY, url, _json$users, response, json;
11473
- return _regeneratorRuntime().wrap((function _callee7$(_context7) {
11474
- while (1) switch (_context7.prev = _context7.next) {
11522
+ _NEYNAR = _asyncToGenerator(_regeneratorRuntime().mark((function _callee8() {
11523
+ var _argsToArray9, _argsToArray0, username, API_KEY, fid, url, _json$users, response, json, _args8 = arguments;
11524
+ return _regeneratorRuntime().wrap((function _callee8$(_context8) {
11525
+ while (1) switch (_context8.prev = _context8.next) {
11475
11526
  case 0:
11527
+ _argsToArray9 = argsToArray(_args8), _argsToArray0 = _slicedToArray(_argsToArray9, 1),
11528
+ username = _argsToArray0[0];
11476
11529
  API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Neynar);
11477
11530
  if (API_KEY) {
11478
- _context7.next = 3;
11531
+ _context8.next = 4;
11479
11532
  break;
11480
11533
  }
11481
- return _context7.abrupt("return", "".concat(SERVICE_API_KEY.Neynar).concat(ERROR_MESSAGES_FLAG.MISSING_KEY));
11534
+ return _context8.abrupt("return", "".concat(SERVICE_API_KEY.Neynar).concat(ERROR_MESSAGES_FLAG.MISSING_KEY));
11482
11535
 
11483
- case 3:
11484
- url = new URL("https://api.neynar.com/v2/farcaster/followers");
11485
- url.searchParams.set("fid", fid.toString());
11486
- url.searchParams.set("sort_type", sortType);
11487
- url.searchParams.set("limit", limit.toString());
11488
- if (viewerFid !== null) url.searchParams.set("viewer_fid", viewerFid.toString());
11489
- if (cursor) url.searchParams.set("cursor", cursor);
11490
- _context7.prev = 9;
11491
- _context7.next = 12;
11492
- return fetch(url.toString(), {
11536
+ case 4:
11537
+ if (username) {
11538
+ _context8.next = 6;
11539
+ break;
11540
+ }
11541
+ return _context8.abrupt("return", "".concat(SERVICE_API_KEY.Neynar).concat(ERROR_MESSAGES_FLAG.INVALID_PARAM));
11542
+
11543
+ case 6:
11544
+ _context8.next = 8;
11545
+ return fromUsernameToFid(username);
11546
+
11547
+ case 8:
11548
+ fid = _context8.sent;
11549
+ if (fid) {
11550
+ _context8.next = 11;
11551
+ break;
11552
+ }
11553
+ return _context8.abrupt("return", "".concat(SERVICE_API_KEY.Neynar).concat(ERROR_MESSAGES_FLAG.INVALID_PARAM));
11554
+
11555
+ case 11:
11556
+ url = "https://api.neynar.com/v2/farcaster/followers?fid=".concat(fid);
11557
+ _context8.prev = 12;
11558
+ _context8.next = 15;
11559
+ return fetch(url, {
11493
11560
  headers: {
11494
11561
  "x-api-key": API_KEY,
11495
11562
  "x-neynar-experimental": "false"
11496
11563
  }
11497
11564
  });
11498
11565
 
11499
- case 12:
11500
- response = _context7.sent;
11566
+ case 15:
11567
+ response = _context8.sent;
11501
11568
  if (response.ok) {
11502
- _context7.next = 15;
11569
+ _context8.next = 18;
11503
11570
  break;
11504
11571
  }
11505
11572
  throw new Error("HTTP ".concat(response.status));
11506
11573
 
11507
- case 15:
11508
- _context7.next = 17;
11574
+ case 18:
11575
+ _context8.next = 20;
11509
11576
  return response.json();
11510
11577
 
11511
- case 17:
11512
- json = _context7.sent;
11578
+ case 20:
11579
+ json = _context8.sent;
11513
11580
  if (json !== null && json !== void 0 && (_json$users = json.users) !== null && _json$users !== void 0 && _json$users.length) {
11514
- _context7.next = 20;
11581
+ _context8.next = 23;
11515
11582
  break;
11516
11583
  }
11517
- return _context7.abrupt("return", []);
11584
+ return _context8.abrupt("return", []);
11518
11585
 
11519
- case 20:
11520
- return _context7.abrupt("return", json.users.map((function(_ref4) {
11586
+ case 23:
11587
+ return _context8.abrupt("return", json.users.map((function(_ref5) {
11521
11588
  var _user$profile, _user$profile2;
11522
- var user = _ref4.user;
11589
+ var user = _ref5.user;
11523
11590
  return {
11524
11591
  username: user.username,
11525
11592
  custody_address: user.custody_address,
@@ -11529,46 +11596,46 @@ function _typeof(o) {
11529
11596
  };
11530
11597
  })));
11531
11598
 
11532
- case 23:
11533
- _context7.prev = 23;
11534
- _context7.t0 = _context7["catch"](9);
11535
- console.error("NEYNAR_FETCH_FOLLOWERS error:", _context7.t0);
11536
- return _context7.abrupt("return", ERROR_MESSAGES_FLAG.DEFAULT);
11599
+ case 26:
11600
+ _context8.prev = 26;
11601
+ _context8.t0 = _context8["catch"](12);
11602
+ console.error("NEYNAR_FETCH_FOLLOWERS error:", _context8.t0);
11603
+ return _context8.abrupt("return", ERROR_MESSAGES_FLAG.DEFAULT);
11537
11604
 
11538
- case 27:
11605
+ case 30:
11539
11606
  case "end":
11540
- return _context7.stop();
11607
+ return _context8.stop();
11541
11608
  }
11542
- }), _callee7, null, [ [ 9, 23 ] ]);
11609
+ }), _callee8, null, [ [ 12, 26 ] ]);
11543
11610
  })));
11544
11611
  return _NEYNAR.apply(this, arguments);
11545
11612
  }
11546
- function GNOSISPAY(_x19) {
11613
+ function GNOSISPAY(_x7) {
11547
11614
  return _GNOSISPAY.apply(this, arguments);
11548
11615
  }
11549
11616
  function _GNOSISPAY() {
11550
- _GNOSISPAY = _asyncToGenerator(_regeneratorRuntime().mark((function _callee8(_ref3) {
11551
- var cardId, startDate, endDate, _ref3$limit, limit, _ref3$offset, offset, apiKeyKey, API_KEY, url, res, json;
11552
- return _regeneratorRuntime().wrap((function _callee8$(_context8) {
11553
- while (1) switch (_context8.prev = _context8.next) {
11617
+ _GNOSISPAY = _asyncToGenerator(_regeneratorRuntime().mark((function _callee9(_ref4) {
11618
+ var cardId, startDate, endDate, _ref4$limit, limit, _ref4$offset, offset, apiKeyKey, API_KEY, url, res, json;
11619
+ return _regeneratorRuntime().wrap((function _callee9$(_context9) {
11620
+ while (1) switch (_context9.prev = _context9.next) {
11554
11621
  case 0:
11555
- cardId = _ref3.cardId, startDate = _ref3.startDate, endDate = _ref3.endDate, _ref3$limit = _ref3.limit,
11556
- limit = _ref3$limit === void 0 ? 20 : _ref3$limit, _ref3$offset = _ref3.offset,
11557
- offset = _ref3$offset === void 0 ? 0 : _ref3$offset;
11622
+ cardId = _ref4.cardId, startDate = _ref4.startDate, endDate = _ref4.endDate, _ref4$limit = _ref4.limit,
11623
+ limit = _ref4$limit === void 0 ? 20 : _ref4$limit, _ref4$offset = _ref4.offset,
11624
+ offset = _ref4$offset === void 0 ? 0 : _ref4$offset;
11558
11625
  apiKeyKey = SERVICE_API_KEY.GnosisPay;
11559
11626
  API_KEY = window.localStorage.getItem(apiKeyKey);
11560
11627
  if (API_KEY) {
11561
- _context8.next = 5;
11628
+ _context9.next = 5;
11562
11629
  break;
11563
11630
  }
11564
- return _context8.abrupt("return", "".concat(apiKeyKey).concat(ERROR_MESSAGES_FLAG.MISSING_KEY));
11631
+ return _context9.abrupt("return", "".concat(apiKeyKey).concat(ERROR_MESSAGES_FLAG.MISSING_KEY));
11565
11632
 
11566
11633
  case 5:
11567
11634
  if (cardId) {
11568
- _context8.next = 7;
11635
+ _context9.next = 7;
11569
11636
  break;
11570
11637
  }
11571
- return _context8.abrupt("return", "".concat(apiKeyKey).concat(ERROR_MESSAGES_FLAG.INVALID_PARAM));
11638
+ return _context9.abrupt("return", "".concat(apiKeyKey).concat(ERROR_MESSAGES_FLAG.INVALID_PARAM));
11572
11639
 
11573
11640
  case 7:
11574
11641
  url = new URL("https://api.gnosispay.com/cards/".concat(cardId, "/transactions"));
@@ -11580,8 +11647,8 @@ function _typeof(o) {
11580
11647
  if (!isNaN(toTimestamp(endDate))) {
11581
11648
  url.searchParams.set("endDate", new Date(endDate * 1e3).toISOString());
11582
11649
  }
11583
- _context8.prev = 12;
11584
- _context8.next = 15;
11650
+ _context9.prev = 12;
11651
+ _context9.next = 15;
11585
11652
  return fetch(url.toString(), {
11586
11653
  headers: {
11587
11654
  Authorization: "Bearer ".concat(API_KEY),
@@ -11590,27 +11657,27 @@ function _typeof(o) {
11590
11657
  });
11591
11658
 
11592
11659
  case 15:
11593
- res = _context8.sent;
11660
+ res = _context9.sent;
11594
11661
  if (res.ok) {
11595
- _context8.next = 18;
11662
+ _context9.next = 18;
11596
11663
  break;
11597
11664
  }
11598
11665
  throw new Error("HTTP error! Status: ".concat(res.status));
11599
11666
 
11600
11667
  case 18:
11601
- _context8.next = 20;
11668
+ _context9.next = 20;
11602
11669
  return res.json();
11603
11670
 
11604
11671
  case 20:
11605
- json = _context8.sent;
11672
+ json = _context9.sent;
11606
11673
  if (Array.isArray(json)) {
11607
- _context8.next = 23;
11674
+ _context9.next = 23;
11608
11675
  break;
11609
11676
  }
11610
- return _context8.abrupt("return", []);
11677
+ return _context9.abrupt("return", []);
11611
11678
 
11612
11679
  case 23:
11613
- return _context8.abrupt("return", json.map((function(tx) {
11680
+ return _context9.abrupt("return", json.map((function(tx) {
11614
11681
  return {
11615
11682
  createdAt: tx.createdAt,
11616
11683
  clearedAt: tx.clearedAt,
@@ -11628,16 +11695,16 @@ function _typeof(o) {
11628
11695
  })));
11629
11696
 
11630
11697
  case 26:
11631
- _context8.prev = 26;
11632
- _context8.t0 = _context8["catch"](12);
11633
- console.error("GNOSISPAY_CARD_TXNS error:", _context8.t0);
11634
- return _context8.abrupt("return", ERROR_MESSAGES_FLAG.DEFAULT);
11698
+ _context9.prev = 26;
11699
+ _context9.t0 = _context9["catch"](12);
11700
+ console.error("GNOSISPAY_CARD_TXNS error:", _context9.t0);
11701
+ return _context9.abrupt("return", ERROR_MESSAGES_FLAG.DEFAULT);
11635
11702
 
11636
11703
  case 30:
11637
11704
  case "end":
11638
- return _context8.stop();
11705
+ return _context9.stop();
11639
11706
  }
11640
- }), _callee8, null, [ [ 12, 26 ] ]);
11707
+ }), _callee9, null, [ [ 12, 26 ] ]);
11641
11708
  })));
11642
11709
  return _GNOSISPAY.apply(this, arguments);
11643
11710
  }
@@ -11645,17 +11712,17 @@ function _typeof(o) {
11645
11712
  return _ETHERSCAN.apply(this, arguments);
11646
11713
  }
11647
11714
  function _ETHERSCAN() {
11648
- _ETHERSCAN = _asyncToGenerator(_regeneratorRuntime().mark((function _callee9() {
11649
- var _len3, args, _key3, type, chain, address, startDate, endDate, page, limit, _args9 = arguments;
11650
- return _regeneratorRuntime().wrap((function _callee9$(_context9) {
11651
- while (1) switch (_context9.prev = _context9.next) {
11715
+ _ETHERSCAN = _asyncToGenerator(_regeneratorRuntime().mark((function _callee0() {
11716
+ var _len2, args, _key2, type, chain, address, startDate, endDate, page, limit, _args0 = arguments;
11717
+ return _regeneratorRuntime().wrap((function _callee0$(_context0) {
11718
+ while (1) switch (_context0.prev = _context0.next) {
11652
11719
  case 0:
11653
- for (_len3 = _args9.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
11654
- args[_key3] = _args9[_key3];
11720
+ for (_len2 = _args0.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
11721
+ args[_key2] = _args0[_key2];
11655
11722
  }
11656
11723
  type = args[0], chain = args[1], address = args[2], startDate = args[3], endDate = args[4],
11657
11724
  page = args[5], limit = args[6];
11658
- return _context9.abrupt("return", handleScanRequest({
11725
+ return _context0.abrupt("return", handleScanRequest({
11659
11726
  scanKey: SERVICE_API_KEY.Etherscan,
11660
11727
  baseUrl: "https://api.etherscan.io/v2/api",
11661
11728
  type: type,
@@ -11669,55 +11736,53 @@ function _typeof(o) {
11669
11736
 
11670
11737
  case 3:
11671
11738
  case "end":
11672
- return _context9.stop();
11739
+ return _context0.stop();
11673
11740
  }
11674
- }), _callee9);
11741
+ }), _callee0);
11675
11742
  })));
11676
11743
  return _ETHERSCAN.apply(this, arguments);
11677
11744
  }
11678
- function COINGECKO(_x20, _x21, _x22) {
11745
+ function COINGECKO(_x8, _x9, _x0) {
11679
11746
  return _COINGECKO.apply(this, arguments);
11680
11747
  }
11681
11748
  function _COINGECKO() {
11682
- _COINGECKO = _asyncToGenerator(_regeneratorRuntime().mark((function _callee0(category, param1, param2) {
11683
- var page, perPage, API_KEY, headers, url, lowerCategory, vsCurrencies, token, ecosystemMap, key, categoryVal, trend, _category, _trend, exchange, response, json, _json$status, message, output, _i11, _Object$entries2, _Object$entries2$_i, _token, prices, _i12, _Object$entries3, _Object$entries3$_i, currency, _value6, _key4, _data, flatArray, _args0 = arguments;
11684
- return _regeneratorRuntime().wrap((function _callee0$(_context0) {
11685
- while (1) switch (_context0.prev = _context0.next) {
11749
+ _COINGECKO = _asyncToGenerator(_regeneratorRuntime().mark((function _callee1(category, param1, param2) {
11750
+ var API_KEY, headers, url, lowerCategory, vsCurrencies, token, ecosystemMap, key, categoryVal, trend, _category, _trend, exchange, response, json, _json$status, message, output, _i11, _Object$entries2, _Object$entries2$_i, _token, prices, _i12, _Object$entries3, _Object$entries3$_i, currency, _value6, _key3, _data, flatArray;
11751
+ return _regeneratorRuntime().wrap((function _callee1$(_context1) {
11752
+ while (1) switch (_context1.prev = _context1.next) {
11686
11753
  case 0:
11687
- page = _args0.length > 3 && _args0[3] !== undefined ? _args0[3] : 1;
11688
- perPage = _args0.length > 4 && _args0[4] !== undefined ? _args0[4] : 2;
11689
11754
  API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Coingecko);
11690
11755
  if (API_KEY) {
11691
- _context0.next = 5;
11756
+ _context1.next = 3;
11692
11757
  break;
11693
11758
  }
11694
- return _context0.abrupt("return", "".concat(SERVICE_API_KEY.Coingecko).concat(ERROR_MESSAGES_FLAG.MISSING_KEY));
11759
+ return _context1.abrupt("return", "".concat(SERVICE_API_KEY.Coingecko).concat(ERROR_MESSAGES_FLAG.MISSING_KEY));
11695
11760
 
11696
- case 5:
11761
+ case 3:
11697
11762
  headers = {
11698
11763
  accept: "application/json",
11699
11764
  "x-cg-demo-api-key": API_KEY
11700
11765
  };
11701
11766
  url = "";
11702
11767
  lowerCategory = (category || "").toLowerCase();
11703
- _context0.t0 = lowerCategory;
11704
- _context0.next = _context0.t0 === "price" ? 11 : _context0.t0 === "market" ? 17 : _context0.t0 === "stablecoins" ? 27 : _context0.t0 === "derivatives" ? 31 : 34;
11768
+ _context1.t0 = lowerCategory;
11769
+ _context1.next = _context1.t0 === "price" ? 9 : _context1.t0 === "market" ? 15 : _context1.t0 === "stablecoins" ? 25 : _context1.t0 === "derivatives" ? 29 : 32;
11705
11770
  break;
11706
11771
 
11707
- case 11:
11772
+ case 9:
11708
11773
  vsCurrencies = param1;
11709
11774
  token = param2;
11710
11775
  if (!(!token || !vsCurrencies)) {
11711
- _context0.next = 15;
11776
+ _context1.next = 13;
11712
11777
  break;
11713
11778
  }
11714
- return _context0.abrupt("return", "".concat(SERVICE_API_KEY.Coingecko).concat(ERROR_MESSAGES_FLAG.INVALID_PARAM));
11779
+ return _context1.abrupt("return", "".concat(SERVICE_API_KEY.Coingecko).concat(ERROR_MESSAGES_FLAG.INVALID_PARAM));
11715
11780
 
11716
- case 15:
11781
+ case 13:
11717
11782
  url = "https://api.coingecko.com/api/v3/simple/price?vs_currencies=".concat(vsCurrencies ? vsCurrencies : "usd", "&symbols=").concat(token);
11718
- return _context0.abrupt("break", 35);
11783
+ return _context1.abrupt("break", 33);
11719
11784
 
11720
- case 17:
11785
+ case 15:
11721
11786
  ecosystemMap = {
11722
11787
  all: "",
11723
11788
  ethereum: "ethereum-ecosystem",
@@ -11733,72 +11798,72 @@ function _typeof(o) {
11733
11798
  key = param1 === null || param1 === void 0 ? void 0 : param1.toLowerCase();
11734
11799
  categoryVal = ecosystemMap[key] || "";
11735
11800
  trend = param2 ? "&price_change_percentage=".concat(param2) : "";
11736
- url = "https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&include_tokens=top&page=".concat(page, "&per_page=").concat(perPage);
11801
+ url = "https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&include_tokens=top&page=1&per_page=100";
11737
11802
  if (!(key && !categoryVal)) {
11738
- _context0.next = 24;
11803
+ _context1.next = 22;
11739
11804
  break;
11740
11805
  }
11741
- return _context0.abrupt("return", "".concat(SERVICE_API_KEY.Coingecko).concat(ERROR_MESSAGES_FLAG.INVALID_PARAM));
11806
+ return _context1.abrupt("return", "".concat(SERVICE_API_KEY.Coingecko).concat(ERROR_MESSAGES_FLAG.INVALID_PARAM));
11742
11807
 
11743
- case 24:
11808
+ case 22:
11744
11809
  if (categoryVal) url += "&category=".concat(categoryVal);
11745
11810
  if (trend) url += trend;
11746
- return _context0.abrupt("break", 35);
11811
+ return _context1.abrupt("break", 33);
11747
11812
 
11748
- case 27:
11813
+ case 25:
11749
11814
  _category = !param1 || param1.toLowerCase() === "all" ? "stablecoins" : param1.toLowerCase();
11750
11815
  _trend = param2 ? "&price_change_percentage=".concat(param2) : "";
11751
- url = "https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&category=".concat(_category, "&order=market_cap_desc&page=").concat(page, "&per_page=").concat(perPage).concat(_trend);
11752
- return _context0.abrupt("break", 35);
11816
+ url = "https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&category=".concat(_category, "&order=market_cap_desc&page=1&per_page=100").concat(_trend);
11817
+ return _context1.abrupt("break", 33);
11753
11818
 
11754
- case 31:
11819
+ case 29:
11755
11820
  exchange = param1;
11756
11821
  if (!exchange || exchange === "all") {
11757
11822
  url = "https://api.coingecko.com/api/v3/derivatives";
11758
11823
  } else {
11759
11824
  url = "https://api.coingecko.com/api/v3/derivatives/exchanges/".concat(exchange, "?include_tickers=all");
11760
11825
  }
11761
- return _context0.abrupt("break", 35);
11826
+ return _context1.abrupt("break", 33);
11762
11827
 
11763
- case 34:
11764
- return _context0.abrupt("return", "".concat(SERVICE_API_KEY.Coingecko).concat(ERROR_MESSAGES_FLAG.INVALID_PARAMS));
11828
+ case 32:
11829
+ return _context1.abrupt("return", "".concat(SERVICE_API_KEY.Coingecko).concat(ERROR_MESSAGES_FLAG.INVALID_PARAM));
11765
11830
 
11766
- case 35:
11767
- _context0.prev = 35;
11768
- _context0.next = 38;
11831
+ case 33:
11832
+ _context1.prev = 33;
11833
+ _context1.next = 36;
11769
11834
  return fetch(url, {
11770
11835
  method: "GET",
11771
11836
  headers: headers
11772
11837
  });
11773
11838
 
11774
- case 38:
11775
- response = _context0.sent;
11776
- _context0.next = 41;
11839
+ case 36:
11840
+ response = _context1.sent;
11841
+ _context1.next = 39;
11777
11842
  return response.json();
11778
11843
 
11779
- case 41:
11780
- json = _context0.sent;
11844
+ case 39:
11845
+ json = _context1.sent;
11781
11846
  if (response.ok) {
11782
- _context0.next = 48;
11847
+ _context1.next = 46;
11783
11848
  break;
11784
11849
  }
11785
11850
  message = (json === null || json === void 0 || (_json$status = json.status) === null || _json$status === void 0 ? void 0 : _json$status.error_message) || "";
11786
11851
  if (!message.includes("API Key Missing")) {
11787
- _context0.next = 46;
11852
+ _context1.next = 44;
11788
11853
  break;
11789
11854
  }
11790
- return _context0.abrupt("return", "".concat(SERVICE_API_KEY.Coingecko).concat(ERROR_MESSAGES_FLAG.INVALID_API_KEY));
11855
+ return _context1.abrupt("return", "".concat(SERVICE_API_KEY.Coingecko).concat(ERROR_MESSAGES_FLAG.INVALID_API_KEY));
11791
11856
 
11792
- case 46:
11857
+ case 44:
11793
11858
  if (!(response.status === 429)) {
11794
- _context0.next = 48;
11859
+ _context1.next = 46;
11795
11860
  break;
11796
11861
  }
11797
- return _context0.abrupt("return", "".concat(SERVICE_API_KEY.Coingecko).concat(ERROR_MESSAGES_FLAG.RATE_LIMIT));
11862
+ return _context1.abrupt("return", "".concat(SERVICE_API_KEY.Coingecko).concat(ERROR_MESSAGES_FLAG.RATE_LIMIT));
11798
11863
 
11799
- case 48:
11864
+ case 46:
11800
11865
  if (!(lowerCategory === "price")) {
11801
- _context0.next = 52;
11866
+ _context1.next = 50;
11802
11867
  break;
11803
11868
  }
11804
11869
  output = {};
@@ -11808,13 +11873,13 @@ function _typeof(o) {
11808
11873
  for (_i12 = 0, _Object$entries3 = Object.entries(prices); _i12 < _Object$entries3.length; _i12++) {
11809
11874
  _Object$entries3$_i = _slicedToArray(_Object$entries3[_i12], 2), currency = _Object$entries3$_i[0],
11810
11875
  _value6 = _Object$entries3$_i[1];
11811
- _key4 = "".concat(_token.charAt(0).toUpperCase() + _token.slice(1), "_").concat(currency.toUpperCase());
11812
- output[_key4] = _value6;
11876
+ _key3 = "".concat(_token.charAt(0).toUpperCase() + _token.slice(1), "_").concat(currency.toUpperCase());
11877
+ output[_key3] = _value6;
11813
11878
  }
11814
11879
  }
11815
- return _context0.abrupt("return", [ output ]);
11880
+ return _context1.abrupt("return", [ output ]);
11816
11881
 
11817
- case 52:
11882
+ case 50:
11818
11883
  _data = json;
11819
11884
  if (lowerCategory === "derivatives") {
11820
11885
  if (json && json.tickers && json.tickers.tickers) {
@@ -11822,113 +11887,116 @@ function _typeof(o) {
11822
11887
  }
11823
11888
  }
11824
11889
  flatArray = Array.isArray(_data) ? _data : [ _data ];
11825
- return _context0.abrupt("return", flatArray.map((function(item) {
11890
+ return _context1.abrupt("return", flatArray.map((function(item) {
11826
11891
  var flat = {};
11827
11892
  for (var _i13 = 0, _Object$entries4 = Object.entries(item); _i13 < _Object$entries4.length; _i13++) {
11828
- var _Object$entries4$_i = _slicedToArray(_Object$entries4[_i13], 2), _key5 = _Object$entries4$_i[0], _value7 = _Object$entries4$_i[1];
11893
+ var _Object$entries4$_i = _slicedToArray(_Object$entries4[_i13], 2), _key4 = _Object$entries4$_i[0], _value7 = _Object$entries4$_i[1];
11829
11894
  if (_typeof(_value7) !== "object" || _value7 === null) {
11830
- flat[_key5] = _value7;
11895
+ flat[_key4] = _value7;
11831
11896
  }
11832
11897
  }
11833
11898
  return flat;
11834
11899
  })));
11835
11900
 
11836
- case 58:
11837
- _context0.prev = 58;
11838
- _context0.t1 = _context0["catch"](35);
11839
- console.error(_context0.t1);
11840
- return _context0.abrupt("return", ERROR_MESSAGES_FLAG.DEFAULT);
11901
+ case 56:
11902
+ _context1.prev = 56;
11903
+ _context1.t1 = _context1["catch"](33);
11904
+ console.error(_context1.t1);
11905
+ return _context1.abrupt("return", ERROR_MESSAGES_FLAG.DEFAULT);
11841
11906
 
11842
- case 62:
11907
+ case 60:
11843
11908
  case "end":
11844
- return _context0.stop();
11909
+ return _context1.stop();
11845
11910
  }
11846
- }), _callee0, null, [ [ 35, 58 ] ]);
11911
+ }), _callee1, null, [ [ 33, 56 ] ]);
11847
11912
  })));
11848
11913
  return _COINGECKO.apply(this, arguments);
11849
11914
  }
11850
- function EOA(_x23, _x24, _x25, _x26, _x27) {
11915
+ function EOA() {
11851
11916
  return _EOA.apply(this, arguments);
11852
11917
  }
11853
11918
  function _EOA() {
11854
- _EOA = _asyncToGenerator(_regeneratorRuntime().mark((function _callee10(addresses, category, chains, startTime, endTime) {
11855
- var page, offset, API_KEY, INPUTS, CHAINS, out, ADDRESS_MAP, _iterator, _step, input, resolved, ADDRS, _iterator2, _step2, _loop, _ret, fetchJSON, _fetchJSON, _args12 = arguments;
11856
- return _regeneratorRuntime().wrap((function _callee10$(_context12) {
11857
- while (1) switch (_context12.prev = _context12.next) {
11919
+ _EOA = _asyncToGenerator(_regeneratorRuntime().mark((function _callee11() {
11920
+ var API_KEY, _argsToArray1, _argsToArray10, addresses, category, chains, startTime, endTime, _argsToArray10$, page, _argsToArray10$2, offset, INPUTS, CHAINS, out, ADDRESS_MAP, _iterator, _step, input, resolved, ADDRS, _iterator2, _step2, _loop, _ret, fetchJSON, _fetchJSON, _args13 = arguments;
11921
+ return _regeneratorRuntime().wrap((function _callee11$(_context13) {
11922
+ while (1) switch (_context13.prev = _context13.next) {
11858
11923
  case 0:
11859
11924
  _fetchJSON = function _fetchJSON3() {
11860
- _fetchJSON = _asyncToGenerator(_regeneratorRuntime().mark((function _callee1(url) {
11925
+ _fetchJSON = _asyncToGenerator(_regeneratorRuntime().mark((function _callee10(url) {
11861
11926
  var _json$result3, _json$result3$include, _json$result4, _json$result4$include, res, json;
11862
- return _regeneratorRuntime().wrap((function _callee1$(_context11) {
11863
- while (1) switch (_context11.prev = _context11.next) {
11927
+ return _regeneratorRuntime().wrap((function _callee10$(_context12) {
11928
+ while (1) switch (_context12.prev = _context12.next) {
11864
11929
  case 0:
11865
- _context11.prev = 0;
11866
- _context11.next = 3;
11930
+ _context12.prev = 0;
11931
+ _context12.next = 3;
11867
11932
  return fetch(url);
11868
11933
 
11869
11934
  case 3:
11870
- res = _context11.sent;
11935
+ res = _context12.sent;
11871
11936
  if (res.ok) {
11872
- _context11.next = 6;
11937
+ _context12.next = 6;
11873
11938
  break;
11874
11939
  }
11875
- return _context11.abrupt("return", "HTTP_".concat(res.status));
11940
+ return _context12.abrupt("return", "HTTP_".concat(res.status));
11876
11941
 
11877
11942
  case 6:
11878
- _context11.next = 8;
11943
+ _context12.next = 8;
11879
11944
  return res.json();
11880
11945
 
11881
11946
  case 8:
11882
- json = _context11.sent;
11947
+ json = _context12.sent;
11883
11948
  if (!((_json$result3 = json.result) !== null && _json$result3 !== void 0 && (_json$result3$include = _json$result3.includes) !== null && _json$result3$include !== void 0 && _json$result3$include.call(_json$result3, "Invalid API Key"))) {
11884
- _context11.next = 11;
11949
+ _context12.next = 11;
11885
11950
  break;
11886
11951
  }
11887
- return _context11.abrupt("return", "".concat(SERVICE_API_KEY.Etherscan).concat(ERROR_MESSAGES_FLAG.INVALID_API_KEY));
11952
+ return _context12.abrupt("return", "".concat(SERVICE_API_KEY.Etherscan).concat(ERROR_MESSAGES_FLAG.INVALID_API_KEY));
11888
11953
 
11889
11954
  case 11:
11890
11955
  if (!((_json$result4 = json.result) !== null && _json$result4 !== void 0 && (_json$result4$include = _json$result4.includes) !== null && _json$result4$include !== void 0 && _json$result4$include.call(_json$result4, "Max rate limit reached"))) {
11891
- _context11.next = 13;
11956
+ _context12.next = 13;
11892
11957
  break;
11893
11958
  }
11894
- return _context11.abrupt("return", "".concat(SERVICE_API_KEY.Etherscan).concat(ERROR_MESSAGES_FLAG.RATE_LIMIT));
11959
+ return _context12.abrupt("return", "".concat(SERVICE_API_KEY.Etherscan).concat(ERROR_MESSAGES_FLAG.RATE_LIMIT));
11895
11960
 
11896
11961
  case 13:
11897
11962
  if (!(json.status === "0" && json.message !== "No transactions found")) {
11898
- _context11.next = 15;
11963
+ _context12.next = 15;
11899
11964
  break;
11900
11965
  }
11901
- return _context11.abrupt("return", ERROR_MESSAGES_FLAG.DEFAULT);
11966
+ return _context12.abrupt("return", ERROR_MESSAGES_FLAG.DEFAULT);
11902
11967
 
11903
11968
  case 15:
11904
- return _context11.abrupt("return", json.result);
11969
+ return _context12.abrupt("return", json.result);
11905
11970
 
11906
11971
  case 18:
11907
- _context11.prev = 18;
11908
- _context11.t0 = _context11["catch"](0);
11909
- return _context11.abrupt("return", ERROR_MESSAGES_FLAG.DEFAULT);
11972
+ _context12.prev = 18;
11973
+ _context12.t0 = _context12["catch"](0);
11974
+ return _context12.abrupt("return", ERROR_MESSAGES_FLAG.DEFAULT);
11910
11975
 
11911
11976
  case 21:
11912
11977
  case "end":
11913
- return _context11.stop();
11978
+ return _context12.stop();
11914
11979
  }
11915
- }), _callee1, null, [ [ 0, 18 ] ]);
11980
+ }), _callee10, null, [ [ 0, 18 ] ]);
11916
11981
  })));
11917
11982
  return _fetchJSON.apply(this, arguments);
11918
11983
  };
11919
- fetchJSON = function _fetchJSON2(_x35) {
11984
+ fetchJSON = function _fetchJSON2(_x11) {
11920
11985
  return _fetchJSON.apply(this, arguments);
11921
11986
  };
11922
- page = _args12.length > 5 && _args12[5] !== undefined ? _args12[5] : 1;
11923
- offset = _args12.length > 6 && _args12[6] !== undefined ? _args12[6] : 10;
11924
11987
  API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Etherscan);
11925
11988
  if (API_KEY) {
11926
- _context12.next = 7;
11989
+ _context13.next = 5;
11927
11990
  break;
11928
11991
  }
11929
- return _context12.abrupt("return", "".concat(SERVICE_API_KEY.Etherscan).concat(ERROR_MESSAGES_FLAG.MISSING_KEY));
11992
+ return _context13.abrupt("return", "".concat(SERVICE_API_KEY.Etherscan).concat(ERROR_MESSAGES_FLAG.MISSING_KEY));
11930
11993
 
11931
- case 7:
11994
+ case 5:
11995
+ _argsToArray1 = argsToArray(_args13), _argsToArray10 = _slicedToArray(_argsToArray1, 7),
11996
+ addresses = _argsToArray10[0], category = _argsToArray10[1], chains = _argsToArray10[2],
11997
+ startTime = _argsToArray10[3], endTime = _argsToArray10[4], _argsToArray10$ = _argsToArray10[5],
11998
+ page = _argsToArray10$ === void 0 ? 1 : _argsToArray10$, _argsToArray10$2 = _argsToArray10[6],
11999
+ offset = _argsToArray10$2 === void 0 ? 10 : _argsToArray10$2;
11932
12000
  INPUTS = addresses.split(",").map((function(a) {
11933
12001
  return a.trim();
11934
12002
  })).filter(Boolean);
@@ -11938,101 +12006,101 @@ function _typeof(o) {
11938
12006
  out = [];
11939
12007
  ADDRESS_MAP = {};
11940
12008
  _iterator = _createForOfIteratorHelper(INPUTS);
11941
- _context12.prev = 12;
12009
+ _context13.prev = 11;
11942
12010
  _iterator.s();
11943
12011
 
11944
- case 14:
12012
+ case 13:
11945
12013
  if ((_step = _iterator.n()).done) {
11946
- _context12.next = 32;
12014
+ _context13.next = 31;
11947
12015
  break;
11948
12016
  }
11949
12017
  input = _step.value;
11950
12018
  if (!isAddress(input)) {
11951
- _context12.next = 20;
12019
+ _context13.next = 19;
11952
12020
  break;
11953
12021
  }
11954
12022
  ADDRESS_MAP[input.toLowerCase()] = null;
11955
- _context12.next = 30;
12023
+ _context13.next = 29;
11956
12024
  break;
11957
12025
 
11958
- case 20:
11959
- _context12.prev = 20;
11960
- _context12.next = 23;
12026
+ case 19:
12027
+ _context13.prev = 19;
12028
+ _context13.next = 22;
11961
12029
  return fromEnsNameToAddress(input);
11962
12030
 
11963
- case 23:
11964
- resolved = _context12.sent;
12031
+ case 22:
12032
+ resolved = _context13.sent;
11965
12033
  if (resolved) ADDRESS_MAP[resolved.toLowerCase()] = input;
11966
- _context12.next = 30;
12034
+ _context13.next = 29;
11967
12035
  break;
11968
12036
 
11969
- case 27:
11970
- _context12.prev = 27;
11971
- _context12.t0 = _context12["catch"](20);
11972
- return _context12.abrupt("return", "".concat(input).concat(ERROR_MESSAGES_FLAG.INVALID_PARAM));
12037
+ case 26:
12038
+ _context13.prev = 26;
12039
+ _context13.t0 = _context13["catch"](19);
12040
+ return _context13.abrupt("return", "".concat(input).concat(ERROR_MESSAGES_FLAG.INVALID_PARAM));
11973
12041
 
11974
- case 30:
11975
- _context12.next = 14;
12042
+ case 29:
12043
+ _context13.next = 13;
11976
12044
  break;
11977
12045
 
11978
- case 32:
11979
- _context12.next = 37;
12046
+ case 31:
12047
+ _context13.next = 36;
11980
12048
  break;
11981
12049
 
11982
- case 34:
11983
- _context12.prev = 34;
11984
- _context12.t1 = _context12["catch"](12);
11985
- _iterator.e(_context12.t1);
12050
+ case 33:
12051
+ _context13.prev = 33;
12052
+ _context13.t1 = _context13["catch"](11);
12053
+ _iterator.e(_context13.t1);
11986
12054
 
11987
- case 37:
11988
- _context12.prev = 37;
12055
+ case 36:
12056
+ _context13.prev = 36;
11989
12057
  _iterator.f();
11990
- return _context12.finish(37);
12058
+ return _context13.finish(36);
11991
12059
 
11992
- case 40:
12060
+ case 39:
11993
12061
  ADDRS = Object.keys(ADDRESS_MAP);
11994
12062
  _iterator2 = _createForOfIteratorHelper(CHAINS);
11995
- _context12.prev = 42;
12063
+ _context13.prev = 41;
11996
12064
  _loop = _regeneratorRuntime().mark((function _loop() {
11997
12065
  var chain, chainId, i, slice, action, url, _data2, startBlock, endBlock, _loop2, _ret2, _i14, _ADDRS;
11998
- return _regeneratorRuntime().wrap((function _loop$(_context10) {
11999
- while (1) switch (_context10.prev = _context10.next) {
12066
+ return _regeneratorRuntime().wrap((function _loop$(_context11) {
12067
+ while (1) switch (_context11.prev = _context11.next) {
12000
12068
  case 0:
12001
12069
  chain = _step2.value;
12002
12070
  chainId = CHAIN_ID_MAP[chain];
12003
12071
  if (chainId) {
12004
- _context10.next = 4;
12072
+ _context11.next = 4;
12005
12073
  break;
12006
12074
  }
12007
- return _context10.abrupt("return", {
12075
+ return _context11.abrupt("return", {
12008
12076
  v: ERROR_MESSAGES_FLAG.UNSUPPORTED_CHAIN
12009
12077
  });
12010
12078
 
12011
12079
  case 4:
12012
12080
  if (!(category === "balance")) {
12013
- _context10.next = 20;
12081
+ _context11.next = 20;
12014
12082
  break;
12015
12083
  }
12016
12084
  i = 0;
12017
12085
 
12018
12086
  case 6:
12019
12087
  if (!(i < ADDRS.length)) {
12020
- _context10.next = 19;
12088
+ _context11.next = 19;
12021
12089
  break;
12022
12090
  }
12023
12091
  slice = ADDRS.slice(i, i + 20).join(",");
12024
12092
  action = ADDRS.length > 1 ? "balancemulti" : "balance";
12025
12093
  url = "https://api.etherscan.io/v2/api?chainid=".concat(chainId) + "&module=account&action=".concat(action, "&address=").concat(slice) + "&tag=latest&apikey=".concat(API_KEY);
12026
- _context10.next = 12;
12094
+ _context11.next = 12;
12027
12095
  return fetchJSON(url);
12028
12096
 
12029
12097
  case 12:
12030
- _data2 = _context10.sent;
12098
+ _data2 = _context11.sent;
12031
12099
  if (!(typeof _data2 === "string")) {
12032
- _context10.next = 15;
12100
+ _context11.next = 15;
12033
12101
  break;
12034
12102
  }
12035
- return _context10.abrupt("return", {
12103
+ return _context11.abrupt("return", {
12036
12104
  v: _data2
12037
12105
  });
12038
12106
 
@@ -12047,44 +12115,44 @@ function _typeof(o) {
12047
12115
 
12048
12116
  case 16:
12049
12117
  i += 20;
12050
- _context10.next = 6;
12118
+ _context11.next = 6;
12051
12119
  break;
12052
12120
 
12053
12121
  case 19:
12054
- return _context10.abrupt("return", 0);
12122
+ return _context11.abrupt("return", 0);
12055
12123
 
12056
12124
  case 20:
12057
12125
  if (!(category === "txns")) {
12058
- _context10.next = 38;
12126
+ _context11.next = 38;
12059
12127
  break;
12060
12128
  }
12061
- _context10.next = 23;
12129
+ _context11.next = 23;
12062
12130
  return fromTimeStampToBlock(toTimestamp(startTime), chain, API_KEY);
12063
12131
 
12064
12132
  case 23:
12065
- startBlock = _context10.sent;
12066
- _context10.next = 26;
12133
+ startBlock = _context11.sent;
12134
+ _context11.next = 26;
12067
12135
  return fromTimeStampToBlock(toTimestamp(endTime), chain, API_KEY);
12068
12136
 
12069
12137
  case 26:
12070
- endBlock = _context10.sent;
12138
+ endBlock = _context11.sent;
12071
12139
  _loop2 = _regeneratorRuntime().mark((function _loop2() {
12072
12140
  var addr, url, data;
12073
- return _regeneratorRuntime().wrap((function _loop2$(_context1) {
12074
- while (1) switch (_context1.prev = _context1.next) {
12141
+ return _regeneratorRuntime().wrap((function _loop2$(_context10) {
12142
+ while (1) switch (_context10.prev = _context10.next) {
12075
12143
  case 0:
12076
12144
  addr = _ADDRS[_i14];
12077
12145
  url = "https://api.etherscan.io/v2/api?chainid=".concat(chainId) + "&module=account&action=txlist&address=".concat(addr) + "&startblock=".concat(startBlock, "&endblock=").concat(endBlock) + "&page=".concat(page, "&offset=").concat(offset, "&sort=asc&apikey=").concat(API_KEY);
12078
- _context1.next = 4;
12146
+ _context10.next = 4;
12079
12147
  return fetchJSON(url);
12080
12148
 
12081
12149
  case 4:
12082
- data = _context1.sent;
12150
+ data = _context10.sent;
12083
12151
  if (!(typeof data === "string")) {
12084
- _context1.next = 7;
12152
+ _context10.next = 7;
12085
12153
  break;
12086
12154
  }
12087
- return _context1.abrupt("return", {
12155
+ return _context10.abrupt("return", {
12088
12156
  v: {
12089
12157
  v: data
12090
12158
  }
@@ -12101,7 +12169,7 @@ function _typeof(o) {
12101
12169
 
12102
12170
  case 8:
12103
12171
  case "end":
12104
- return _context1.stop();
12172
+ return _context10.stop();
12105
12173
  }
12106
12174
  }), _loop2);
12107
12175
  }));
@@ -12109,100 +12177,100 @@ function _typeof(o) {
12109
12177
 
12110
12178
  case 29:
12111
12179
  if (!(_i14 < _ADDRS.length)) {
12112
- _context10.next = 37;
12180
+ _context11.next = 37;
12113
12181
  break;
12114
12182
  }
12115
- return _context10.delegateYield(_loop2(), "t0", 31);
12183
+ return _context11.delegateYield(_loop2(), "t0", 31);
12116
12184
 
12117
12185
  case 31:
12118
- _ret2 = _context10.t0;
12186
+ _ret2 = _context11.t0;
12119
12187
  if (!_ret2) {
12120
- _context10.next = 34;
12188
+ _context11.next = 34;
12121
12189
  break;
12122
12190
  }
12123
- return _context10.abrupt("return", _ret2.v);
12191
+ return _context11.abrupt("return", _ret2.v);
12124
12192
 
12125
12193
  case 34:
12126
12194
  _i14++;
12127
- _context10.next = 29;
12195
+ _context11.next = 29;
12128
12196
  break;
12129
12197
 
12130
12198
  case 37:
12131
- return _context10.abrupt("return", 0);
12199
+ return _context11.abrupt("return", 0);
12132
12200
 
12133
12201
  case 38:
12134
- return _context10.abrupt("return", {
12202
+ return _context11.abrupt("return", {
12135
12203
  v: ERROR_MESSAGES_FLAG.INVALID_CATEGORY
12136
12204
  });
12137
12205
 
12138
12206
  case 39:
12139
12207
  case "end":
12140
- return _context10.stop();
12208
+ return _context11.stop();
12141
12209
  }
12142
12210
  }), _loop);
12143
12211
  }));
12144
12212
  _iterator2.s();
12145
12213
 
12146
- case 45:
12214
+ case 44:
12147
12215
  if ((_step2 = _iterator2.n()).done) {
12148
- _context12.next = 54;
12216
+ _context13.next = 53;
12149
12217
  break;
12150
12218
  }
12151
- return _context12.delegateYield(_loop(), "t2", 47);
12219
+ return _context13.delegateYield(_loop(), "t2", 46);
12152
12220
 
12153
- case 47:
12154
- _ret = _context12.t2;
12221
+ case 46:
12222
+ _ret = _context13.t2;
12155
12223
  if (!(_ret === 0)) {
12156
- _context12.next = 50;
12224
+ _context13.next = 49;
12157
12225
  break;
12158
12226
  }
12159
- return _context12.abrupt("continue", 52);
12227
+ return _context13.abrupt("continue", 51);
12160
12228
 
12161
- case 50:
12229
+ case 49:
12162
12230
  if (!_ret) {
12163
- _context12.next = 52;
12231
+ _context13.next = 51;
12164
12232
  break;
12165
12233
  }
12166
- return _context12.abrupt("return", _ret.v);
12234
+ return _context13.abrupt("return", _ret.v);
12167
12235
 
12168
- case 52:
12169
- _context12.next = 45;
12236
+ case 51:
12237
+ _context13.next = 44;
12170
12238
  break;
12171
12239
 
12172
- case 54:
12173
- _context12.next = 59;
12240
+ case 53:
12241
+ _context13.next = 58;
12174
12242
  break;
12175
12243
 
12176
- case 56:
12177
- _context12.prev = 56;
12178
- _context12.t3 = _context12["catch"](42);
12179
- _iterator2.e(_context12.t3);
12244
+ case 55:
12245
+ _context13.prev = 55;
12246
+ _context13.t3 = _context13["catch"](41);
12247
+ _iterator2.e(_context13.t3);
12180
12248
 
12181
- case 59:
12182
- _context12.prev = 59;
12249
+ case 58:
12250
+ _context13.prev = 58;
12183
12251
  _iterator2.f();
12184
- return _context12.finish(59);
12252
+ return _context13.finish(58);
12185
12253
 
12186
- case 62:
12187
- return _context12.abrupt("return", out);
12254
+ case 61:
12255
+ return _context13.abrupt("return", out);
12188
12256
 
12189
- case 63:
12257
+ case 62:
12190
12258
  case "end":
12191
- return _context12.stop();
12259
+ return _context13.stop();
12192
12260
  }
12193
- }), _callee10, null, [ [ 12, 34, 37, 40 ], [ 20, 27 ], [ 42, 56, 59, 62 ] ]);
12261
+ }), _callee11, null, [ [ 11, 33, 36, 39 ], [ 19, 26 ], [ 41, 55, 58, 61 ] ]);
12194
12262
  })));
12195
12263
  return _EOA.apply(this, arguments);
12196
12264
  }
12197
- function FLVURL(_x28, _x29) {
12265
+ function FLVURL(_x1, _x10) {
12198
12266
  return _FLVURL.apply(this, arguments);
12199
12267
  }
12200
12268
  function _FLVURL() {
12201
- _FLVURL = _asyncToGenerator(_regeneratorRuntime().mark((function _callee11(token, vs_currencies) {
12202
- return _regeneratorRuntime().wrap((function _callee11$(_context13) {
12203
- while (1) switch (_context13.prev = _context13.next) {
12269
+ _FLVURL = _asyncToGenerator(_regeneratorRuntime().mark((function _callee12(token, vs_currencies) {
12270
+ return _regeneratorRuntime().wrap((function _callee12$(_context14) {
12271
+ while (1) switch (_context14.prev = _context14.next) {
12204
12272
  case 0:
12205
- return _context13.abrupt("return", new Promise((function(resolve) {
12273
+ return _context14.abrupt("return", new Promise((function(resolve) {
12206
12274
  setTimeout((function() {
12207
12275
  resolve([ {
12208
12276
  Yoo: "gotcha"
@@ -12212,122 +12280,125 @@ function _typeof(o) {
12212
12280
 
12213
12281
  case 1:
12214
12282
  case "end":
12215
- return _context13.stop();
12283
+ return _context14.stop();
12216
12284
  }
12217
- }), _callee11);
12285
+ }), _callee12);
12218
12286
  })));
12219
12287
  return _FLVURL.apply(this, arguments);
12220
12288
  }
12221
- function SAFE(_x30, _x31, _x32, _x33, _x34) {
12289
+ function SAFE() {
12222
12290
  return _SAFE.apply(this, arguments);
12223
12291
  }
12224
12292
  function _SAFE() {
12225
- _SAFE = _asyncToGenerator(_regeneratorRuntime().mark((function _callee12(address, utility, chain, limit, offset) {
12226
- var apiKey, chainIdentifier, url, response, json;
12227
- return _regeneratorRuntime().wrap((function _callee12$(_context14) {
12228
- while (1) switch (_context14.prev = _context14.next) {
12293
+ _SAFE = _asyncToGenerator(_regeneratorRuntime().mark((function _callee13() {
12294
+ var _argsToArray11, _argsToArray12, address, utility, chain, limit, offset, apiKey, chainIdentifier, url, response, json, _args15 = arguments;
12295
+ return _regeneratorRuntime().wrap((function _callee13$(_context15) {
12296
+ while (1) switch (_context15.prev = _context15.next) {
12229
12297
  case 0:
12298
+ _argsToArray11 = argsToArray(_args15), _argsToArray12 = _slicedToArray(_argsToArray11, 5),
12299
+ address = _argsToArray12[0], utility = _argsToArray12[1], chain = _argsToArray12[2],
12300
+ limit = _argsToArray12[3], offset = _argsToArray12[4];
12230
12301
  if (!(typeof limit !== "number" || limit < 0)) {
12231
- _context14.next = 2;
12302
+ _context15.next = 3;
12232
12303
  break;
12233
12304
  }
12234
- return _context14.abrupt("return", "INVALID_LIMIT");
12305
+ return _context15.abrupt("return", "INVALID_LIMIT");
12235
12306
 
12236
- case 2:
12307
+ case 3:
12237
12308
  if (!(typeof offset !== "number" || offset < 0)) {
12238
- _context14.next = 4;
12309
+ _context15.next = 5;
12239
12310
  break;
12240
12311
  }
12241
- return _context14.abrupt("return", "INVALID_OFFSET");
12312
+ return _context15.abrupt("return", "INVALID_OFFSET");
12242
12313
 
12243
- case 4:
12314
+ case 5:
12244
12315
  if (!(utility !== "txns")) {
12245
- _context14.next = 6;
12316
+ _context15.next = 7;
12246
12317
  break;
12247
12318
  }
12248
- return _context14.abrupt("return", "UTILITY IS NOT SUPPORTED");
12319
+ return _context15.abrupt("return", "UTILITY IS NOT SUPPORTED");
12249
12320
 
12250
- case 6:
12321
+ case 7:
12251
12322
  apiKey = window.localStorage.getItem(SERVICE_API_KEY.Safe);
12252
12323
  chainIdentifier = SAFE_CHAIN_MAP[chain];
12253
12324
  if (apiKey) {
12254
- _context14.next = 10;
12325
+ _context15.next = 11;
12255
12326
  break;
12256
12327
  }
12257
- return _context14.abrupt("return", "".concat(SERVICE_API_KEY.Safe, "_MISSING"));
12328
+ return _context15.abrupt("return", "".concat(SERVICE_API_KEY.Safe, "_MISSING"));
12258
12329
 
12259
- case 10:
12330
+ case 11:
12260
12331
  if (chainIdentifier) {
12261
- _context14.next = 12;
12332
+ _context15.next = 13;
12262
12333
  break;
12263
12334
  }
12264
- return _context14.abrupt("return", "CHAIN IS NOT SUPPORTED");
12335
+ return _context15.abrupt("return", "CHAIN IS NOT SUPPORTED");
12265
12336
 
12266
- case 12:
12337
+ case 13:
12267
12338
  if (isAddress(address)) {
12268
- _context14.next = 16;
12339
+ _context15.next = 17;
12269
12340
  break;
12270
12341
  }
12271
- _context14.next = 15;
12342
+ _context15.next = 16;
12272
12343
  return fromEnsNameToAddress(address);
12273
12344
 
12274
- case 15:
12275
- address = _context14.sent;
12276
-
12277
12345
  case 16:
12346
+ address = _context15.sent;
12347
+
12348
+ case 17:
12278
12349
  if (address) {
12279
- _context14.next = 18;
12350
+ _context15.next = 19;
12280
12351
  break;
12281
12352
  }
12282
- return _context14.abrupt("return", "".concat(address).concat(ERROR_MESSAGES_FLAG.INVALID_PARAM));
12353
+ return _context15.abrupt("return", "".concat(address).concat(ERROR_MESSAGES_FLAG.INVALID_PARAM));
12283
12354
 
12284
- case 18:
12355
+ case 19:
12285
12356
  url = "https://api.safe.global/tx-service/".concat(chainIdentifier, "/api/v2/safes/").concat(address, "/multisig-transactions?limit=").concat(limit, "&offset=").concat(offset);
12286
- _context14.prev = 19;
12287
- _context14.next = 22;
12357
+ _context15.prev = 20;
12358
+ _context15.next = 23;
12288
12359
  return fetch(url, {
12289
12360
  headers: {
12290
12361
  Authorization: "Bearer ".concat(apiKey)
12291
12362
  }
12292
12363
  });
12293
12364
 
12294
- case 22:
12295
- response = _context14.sent;
12365
+ case 23:
12366
+ response = _context15.sent;
12296
12367
  if (response.ok) {
12297
- _context14.next = 25;
12368
+ _context15.next = 26;
12298
12369
  break;
12299
12370
  }
12300
12371
  throw new Error("HTTP error! Status: ".concat(response.status));
12301
12372
 
12302
- case 25:
12303
- _context14.next = 27;
12373
+ case 26:
12374
+ _context15.next = 28;
12304
12375
  return response.json();
12305
12376
 
12306
- case 27:
12307
- json = _context14.sent;
12377
+ case 28:
12378
+ json = _context15.sent;
12308
12379
  if (Array.isArray(json.results)) {
12309
- _context14.next = 30;
12380
+ _context15.next = 31;
12310
12381
  break;
12311
12382
  }
12312
- return _context14.abrupt("return", "INVALID API RESPONSE");
12383
+ return _context15.abrupt("return", "INVALID API RESPONSE");
12313
12384
 
12314
- case 30:
12315
- return _context14.abrupt("return", json.results.map((function(_ref5) {
12316
- var confirmations = _ref5.confirmations, dataDecoded = _ref5.dataDecoded, rest = _objectWithoutProperties(_ref5, _excluded);
12385
+ case 31:
12386
+ return _context15.abrupt("return", json.results.map((function(_ref6) {
12387
+ var confirmations = _ref6.confirmations, dataDecoded = _ref6.dataDecoded, rest = _objectWithoutProperties(_ref6, _excluded);
12317
12388
  return rest;
12318
12389
  })));
12319
12390
 
12320
- case 33:
12321
- _context14.prev = 33;
12322
- _context14.t0 = _context14["catch"](19);
12323
- console.log(_context14.t0);
12324
- return _context14.abrupt("return", "ERROR IN FETCHING");
12391
+ case 34:
12392
+ _context15.prev = 34;
12393
+ _context15.t0 = _context15["catch"](20);
12394
+ console.log(_context15.t0);
12395
+ return _context15.abrupt("return", "ERROR IN FETCHING");
12325
12396
 
12326
- case 37:
12397
+ case 38:
12327
12398
  case "end":
12328
- return _context14.stop();
12399
+ return _context15.stop();
12329
12400
  }
12330
- }), _callee12, null, [ [ 19, 33 ] ]);
12401
+ }), _callee13, null, [ [ 20, 34 ] ]);
12331
12402
  })));
12332
12403
  return _SAFE.apply(this, arguments);
12333
12404
  }