@fileverse-dev/formulajs 4.4.11-mod-45 → 4.4.11-mod-46

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-45 */
1
+ /* @fileverse-dev/formulajs v4.4.11-mod-46 */
2
2
  var _excluded = [ "confirmations", "dataDecoded" ];
3
3
 
4
4
  function _objectWithoutProperties(e, t) {
@@ -10944,7 +10944,8 @@ function _typeof(o) {
10944
10944
  Gnosisscan: "GNOSIS_API_KEY",
10945
10945
  Firefly: "FIRE_FLY_API_KEY",
10946
10946
  GnosisPay: "GNOSIS_API_KEY",
10947
- Neynar: "NEYNAR_API_KEY"
10947
+ Neynar: "NEYNAR_API_KEY",
10948
+ Defillama: "DEFILLAMA_API_KEY"
10948
10949
  };
10949
10950
  var fromTimeStampToBlock = function() {
10950
10951
  var _ref = _asyncToGenerator(_regeneratorRuntime().mark((function _callee(timestamp, chain, apiKey) {
@@ -11246,6 +11247,18 @@ function _typeof(o) {
11246
11247
  return _ref3.apply(this, arguments);
11247
11248
  };
11248
11249
  }();
11250
+ var removeNestedStructure = function removeNestedStructure(json) {
11251
+ return json.map((function(item) {
11252
+ var flat = {};
11253
+ for (var _i10 = 0, _Object$entries = Object.entries(item); _i10 < _Object$entries.length; _i10++) {
11254
+ var _Object$entries$_i = _slicedToArray(_Object$entries[_i10], 2), key = _Object$entries$_i[0], _value5 = _Object$entries$_i[1];
11255
+ if (_typeof(_value5) !== "object" || _value5 === null) {
11256
+ flat[key] = _value5;
11257
+ }
11258
+ }
11259
+ return flat;
11260
+ }));
11261
+ };
11249
11262
  function FIREFLY() {
11250
11263
  return _FIREFLY.apply(this, arguments);
11251
11264
  }
@@ -11328,10 +11341,10 @@ function _typeof(o) {
11328
11341
  case 27:
11329
11342
  return _context5.abrupt("return", json.data.map((function(item) {
11330
11343
  var flat = {};
11331
- for (var _i10 = 0, _Object$entries = Object.entries(item); _i10 < _Object$entries.length; _i10++) {
11332
- var _Object$entries$_i = _slicedToArray(_Object$entries[_i10], 2), key = _Object$entries$_i[0], _value5 = _Object$entries$_i[1];
11333
- if (_typeof(_value5) !== "object" || _value5 === null) {
11334
- flat[key] = _value5;
11344
+ for (var _i11 = 0, _Object$entries2 = Object.entries(item); _i11 < _Object$entries2.length; _i11++) {
11345
+ var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i11], 2), key = _Object$entries2$_i[0], _value6 = _Object$entries2$_i[1];
11346
+ if (_typeof(_value6) !== "object" || _value6 === null) {
11347
+ flat[key] = _value6;
11335
11348
  }
11336
11349
  }
11337
11350
  flat.platform = platform;
@@ -11352,26 +11365,223 @@ function _typeof(o) {
11352
11365
  })));
11353
11366
  return _FIREFLY.apply(this, arguments);
11354
11367
  }
11368
+ function LENS() {
11369
+ return _LENS.apply(this, arguments);
11370
+ }
11371
+ function _LENS() {
11372
+ _LENS = _asyncToGenerator(_regeneratorRuntime().mark((function _callee6() {
11373
+ var _argsToArray5, _argsToArray6, contentType, identifier, _argsToArray6$, start, _argsToArray6$2, end, API_KEY, baseUrl, headers, typeMap, platformType, query, url, res, json, _args6 = arguments;
11374
+ return _regeneratorRuntime().wrap((function _callee6$(_context6) {
11375
+ while (1) switch (_context6.prev = _context6.next) {
11376
+ case 0:
11377
+ _argsToArray5 = argsToArray(_args6), _argsToArray6 = _slicedToArray(_argsToArray5, 4),
11378
+ contentType = _argsToArray6[0], identifier = _argsToArray6[1], _argsToArray6$ = _argsToArray6[2],
11379
+ start = _argsToArray6$ === void 0 ? 0 : _argsToArray6$, _argsToArray6$2 = _argsToArray6[3],
11380
+ end = _argsToArray6$2 === void 0 ? 10 : _argsToArray6$2;
11381
+ API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Firefly);
11382
+ if (API_KEY) {
11383
+ _context6.next = 4;
11384
+ break;
11385
+ }
11386
+ return _context6.abrupt("return", "".concat(SERVICE_API_KEY.Firefly).concat(ERROR_MESSAGES_FLAG.MISSING_KEY));
11387
+
11388
+ case 4:
11389
+ baseUrl = "https://openapi.firefly.land/v1/fileverse/fetch";
11390
+ headers = {
11391
+ "x-api-key": API_KEY
11392
+ };
11393
+ typeMap = {
11394
+ posts: "lensid",
11395
+ replies: "lenspostid"
11396
+ };
11397
+ platformType = typeMap[contentType];
11398
+ if (platformType) {
11399
+ _context6.next = 10;
11400
+ break;
11401
+ }
11402
+ return _context6.abrupt("return", "Lens: ".concat(ERROR_MESSAGES_FLAG.INVALID_TYPE));
11403
+
11404
+ case 10:
11405
+ query = identifier.split(",").map((function(s) {
11406
+ return s.trim();
11407
+ })).filter(Boolean).join(",");
11408
+ url = new URL(baseUrl);
11409
+ url.searchParams.set("query", query);
11410
+ url.searchParams.set("type", platformType);
11411
+ url.searchParams.set("start", String(start));
11412
+ url.searchParams.set("end", String(end));
11413
+ _context6.prev = 16;
11414
+ _context6.next = 19;
11415
+ return fetch(url.toString(), {
11416
+ headers: headers
11417
+ });
11418
+
11419
+ case 19:
11420
+ res = _context6.sent;
11421
+ if (res.ok) {
11422
+ _context6.next = 22;
11423
+ break;
11424
+ }
11425
+ throw new Error("HTTP ".concat(res.status));
11426
+
11427
+ case 22:
11428
+ _context6.next = 24;
11429
+ return res.json();
11430
+
11431
+ case 24:
11432
+ json = _context6.sent;
11433
+ if (Array.isArray(json === null || json === void 0 ? void 0 : json.data)) {
11434
+ _context6.next = 27;
11435
+ break;
11436
+ }
11437
+ return _context6.abrupt("return", []);
11438
+
11439
+ case 27:
11440
+ return _context6.abrupt("return", json.data.map((function(item) {
11441
+ var flat = {};
11442
+ for (var _i12 = 0, _Object$entries3 = Object.entries(item); _i12 < _Object$entries3.length; _i12++) {
11443
+ var _Object$entries3$_i = _slicedToArray(_Object$entries3[_i12], 2), key = _Object$entries3$_i[0], _value7 = _Object$entries3$_i[1];
11444
+ if (_typeof(_value7) !== "object" || _value7 === null) {
11445
+ flat[key] = _value7;
11446
+ }
11447
+ }
11448
+ flat.platform = platform;
11449
+ return flat;
11450
+ })));
11451
+
11452
+ case 30:
11453
+ _context6.prev = 30;
11454
+ _context6.t0 = _context6["catch"](16);
11455
+ console.error("LENS fetch error:", _context6.t0);
11456
+ return _context6.abrupt("return", ERROR_MESSAGES_FLAG.DEFAULT);
11457
+
11458
+ case 34:
11459
+ case "end":
11460
+ return _context6.stop();
11461
+ }
11462
+ }), _callee6, null, [ [ 16, 30 ] ]);
11463
+ })));
11464
+ return _LENS.apply(this, arguments);
11465
+ }
11466
+ function FARCASTER() {
11467
+ return _FARCASTER.apply(this, arguments);
11468
+ }
11469
+ function _FARCASTER() {
11470
+ _FARCASTER = _asyncToGenerator(_regeneratorRuntime().mark((function _callee7() {
11471
+ var _argsToArray7, _argsToArray8, contentType, identifier, _argsToArray8$, start, _argsToArray8$2, end, API_KEY, baseUrl, headers, typeMap, platformType, query, url, res, json, _args7 = arguments;
11472
+ return _regeneratorRuntime().wrap((function _callee7$(_context7) {
11473
+ while (1) switch (_context7.prev = _context7.next) {
11474
+ case 0:
11475
+ _argsToArray7 = argsToArray(_args7), _argsToArray8 = _slicedToArray(_argsToArray7, 4),
11476
+ contentType = _argsToArray8[0], identifier = _argsToArray8[1], _argsToArray8$ = _argsToArray8[2],
11477
+ start = _argsToArray8$ === void 0 ? 0 : _argsToArray8$, _argsToArray8$2 = _argsToArray8[3],
11478
+ end = _argsToArray8$2 === void 0 ? 10 : _argsToArray8$2;
11479
+ API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Firefly);
11480
+ if (API_KEY) {
11481
+ _context7.next = 4;
11482
+ break;
11483
+ }
11484
+ return _context7.abrupt("return", "".concat(SERVICE_API_KEY.Firefly).concat(ERROR_MESSAGES_FLAG.MISSING_KEY));
11485
+
11486
+ case 4:
11487
+ baseUrl = "https://openapi.firefly.land/v1/fileverse/fetch";
11488
+ headers = {
11489
+ "x-api-key": API_KEY
11490
+ };
11491
+ typeMap = {
11492
+ posts: "farcasterid",
11493
+ replies: "farcasterpostid",
11494
+ channels: "farcasterchannels"
11495
+ };
11496
+ platformType = typeMap[contentType];
11497
+ if (platformType) {
11498
+ _context7.next = 10;
11499
+ break;
11500
+ }
11501
+ return _context7.abrupt("return", "Farcaster: ".concat(ERROR_MESSAGES_FLAG.INVALID_TYPE));
11502
+
11503
+ case 10:
11504
+ query = identifier.split(",").map((function(s) {
11505
+ return s.trim();
11506
+ })).filter(Boolean).join(",");
11507
+ url = new URL(baseUrl);
11508
+ url.searchParams.set("query", query);
11509
+ url.searchParams.set("type", platformType);
11510
+ url.searchParams.set("start", String(start));
11511
+ url.searchParams.set("end", String(end));
11512
+ _context7.prev = 16;
11513
+ _context7.next = 19;
11514
+ return fetch(url.toString(), {
11515
+ headers: headers
11516
+ });
11517
+
11518
+ case 19:
11519
+ res = _context7.sent;
11520
+ if (res.ok) {
11521
+ _context7.next = 22;
11522
+ break;
11523
+ }
11524
+ throw new Error("HTTP ".concat(res.status));
11525
+
11526
+ case 22:
11527
+ _context7.next = 24;
11528
+ return res.json();
11529
+
11530
+ case 24:
11531
+ json = _context7.sent;
11532
+ if (Array.isArray(json === null || json === void 0 ? void 0 : json.data)) {
11533
+ _context7.next = 27;
11534
+ break;
11535
+ }
11536
+ return _context7.abrupt("return", []);
11537
+
11538
+ case 27:
11539
+ return _context7.abrupt("return", json.data.map((function(item) {
11540
+ var flat = {};
11541
+ for (var _i13 = 0, _Object$entries4 = Object.entries(item); _i13 < _Object$entries4.length; _i13++) {
11542
+ var _Object$entries4$_i = _slicedToArray(_Object$entries4[_i13], 2), key = _Object$entries4$_i[0], _value8 = _Object$entries4$_i[1];
11543
+ if (_typeof(_value8) !== "object" || _value8 === null) {
11544
+ flat[key] = _value8;
11545
+ }
11546
+ }
11547
+ flat.platform = platform;
11548
+ return flat;
11549
+ })));
11550
+
11551
+ case 30:
11552
+ _context7.prev = 30;
11553
+ _context7.t0 = _context7["catch"](16);
11554
+ console.error("Farcaster fetch error:", _context7.t0);
11555
+ return _context7.abrupt("return", ERROR_MESSAGES_FLAG.DEFAULT);
11556
+
11557
+ case 34:
11558
+ case "end":
11559
+ return _context7.stop();
11560
+ }
11561
+ }), _callee7, null, [ [ 16, 30 ] ]);
11562
+ })));
11563
+ return _FARCASTER.apply(this, arguments);
11564
+ }
11355
11565
  function BLOCKSCOUT() {
11356
11566
  return _BLOCKSCOUT.apply(this, arguments);
11357
11567
  }
11358
11568
  function _BLOCKSCOUT() {
11359
- _BLOCKSCOUT = _asyncToGenerator(_regeneratorRuntime().mark((function _callee6() {
11360
- var _argsToArray5, _argsToArray6, address, type, chain, startTimestamp, endTimestamp, page, offset, currentTimestamp, hostname, requestUrl, _json$result, _json$result2, response, json, _args6 = arguments;
11361
- return _regeneratorRuntime().wrap((function _callee6$(_context6) {
11362
- while (1) switch (_context6.prev = _context6.next) {
11569
+ _BLOCKSCOUT = _asyncToGenerator(_regeneratorRuntime().mark((function _callee8() {
11570
+ var _argsToArray9, _argsToArray0, address, type, chain, startTimestamp, endTimestamp, page, offset, currentTimestamp, hostname, requestUrl, _json$result, _json$result2, response, json, _args8 = arguments;
11571
+ return _regeneratorRuntime().wrap((function _callee8$(_context8) {
11572
+ while (1) switch (_context8.prev = _context8.next) {
11363
11573
  case 0:
11364
- _argsToArray5 = argsToArray(_args6), _argsToArray6 = _slicedToArray(_argsToArray5, 7),
11365
- address = _argsToArray6[0], type = _argsToArray6[1], chain = _argsToArray6[2], startTimestamp = _argsToArray6[3],
11366
- endTimestamp = _argsToArray6[4], page = _argsToArray6[5], offset = _argsToArray6[6];
11574
+ _argsToArray9 = argsToArray(_args8), _argsToArray0 = _slicedToArray(_argsToArray9, 7),
11575
+ address = _argsToArray0[0], type = _argsToArray0[1], chain = _argsToArray0[2], startTimestamp = _argsToArray0[3],
11576
+ endTimestamp = _argsToArray0[4], page = _argsToArray0[5], offset = _argsToArray0[6];
11367
11577
  if (!chain) {
11368
11578
  chain = "ethereum";
11369
11579
  }
11370
11580
  if (type) {
11371
- _context6.next = 4;
11581
+ _context8.next = 4;
11372
11582
  break;
11373
11583
  }
11374
- return _context6.abrupt("return", "TYPE_MISSING");
11584
+ return _context8.abrupt("return", "TYPE_MISSING");
11375
11585
 
11376
11586
  case 4:
11377
11587
  if (!startTimestamp) {
@@ -11386,96 +11596,96 @@ function _typeof(o) {
11386
11596
  endTimestamp = toTimestamp(endTimestamp);
11387
11597
  }
11388
11598
  if (isAddress(address)) {
11389
- _context6.next = 11;
11599
+ _context8.next = 11;
11390
11600
  break;
11391
11601
  }
11392
- _context6.next = 10;
11602
+ _context8.next = 10;
11393
11603
  return fromEnsNameToAddress(address);
11394
11604
 
11395
11605
  case 10:
11396
- address = _context6.sent;
11606
+ address = _context8.sent;
11397
11607
 
11398
11608
  case 11:
11399
11609
  if (address) {
11400
- _context6.next = 13;
11610
+ _context8.next = 13;
11401
11611
  break;
11402
11612
  }
11403
- return _context6.abrupt("return", "".concat(address).concat(ERROR_MESSAGES_FLAG.INVALID_PARAM));
11613
+ return _context8.abrupt("return", "".concat(address).concat(ERROR_MESSAGES_FLAG.INVALID_PARAM));
11404
11614
 
11405
11615
  case 13:
11406
11616
  hostname = BLOCKSCOUT_CHAINS_MAP[chain];
11407
- _context6.t0 = type;
11408
- _context6.next = _context6.t0 === "stat" ? 17 : _context6.t0 === "txns" ? 19 : _context6.t0 === "tokens" ? 21 : 23;
11617
+ _context8.t0 = type;
11618
+ _context8.next = _context8.t0 === "stat" ? 17 : _context8.t0 === "txns" ? 19 : _context8.t0 === "tokens" ? 21 : 23;
11409
11619
  break;
11410
11620
 
11411
11621
  case 17:
11412
11622
  requestUrl = "".concat(hostname, "/api/v2/addresses/").concat(address, "/counters");
11413
- return _context6.abrupt("break", 24);
11623
+ return _context8.abrupt("break", 24);
11414
11624
 
11415
11625
  case 19:
11416
11626
  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");
11417
- return _context6.abrupt("break", 24);
11627
+ return _context8.abrupt("break", 24);
11418
11628
 
11419
11629
  case 21:
11420
11630
  requestUrl = "".concat(hostname, "/api?module=account&action=tokenlist&address=").concat(address);
11421
- return _context6.abrupt("break", 24);
11631
+ return _context8.abrupt("break", 24);
11422
11632
 
11423
11633
  case 23:
11424
- return _context6.abrupt("return", "INVALID_TYPE");
11634
+ return _context8.abrupt("return", "INVALID_TYPE");
11425
11635
 
11426
11636
  case 24:
11427
- _context6.prev = 24;
11428
- _context6.next = 27;
11637
+ _context8.prev = 24;
11638
+ _context8.next = 27;
11429
11639
  return fetch(requestUrl);
11430
11640
 
11431
11641
  case 27:
11432
- response = _context6.sent;
11642
+ response = _context8.sent;
11433
11643
  if (response.ok) {
11434
- _context6.next = 30;
11644
+ _context8.next = 30;
11435
11645
  break;
11436
11646
  }
11437
11647
  throw new Error("HTTP error! Status: ".concat(response.status));
11438
11648
 
11439
11649
  case 30:
11440
- _context6.next = 32;
11650
+ _context8.next = 32;
11441
11651
  return response.json();
11442
11652
 
11443
11653
  case 32:
11444
- json = _context6.sent;
11654
+ json = _context8.sent;
11445
11655
  console.log(json);
11446
11656
  if (!(json !== null && json !== void 0 && (_json$result = json.result) !== null && _json$result !== void 0 && _json$result.includes("Invalid parameter(s)"))) {
11447
- _context6.next = 36;
11657
+ _context8.next = 36;
11448
11658
  break;
11449
11659
  }
11450
- return _context6.abrupt("return", "INVALID_REQUEST_PARAMS");
11660
+ return _context8.abrupt("return", "INVALID_REQUEST_PARAMS");
11451
11661
 
11452
11662
  case 36:
11453
11663
  if (!(json !== null && json !== void 0 && (_json$result2 = json.result) !== null && _json$result2 !== void 0 && _json$result2.includes("Not found"))) {
11454
- _context6.next = 38;
11664
+ _context8.next = 38;
11455
11665
  break;
11456
11666
  }
11457
- return _context6.abrupt("return", "ADDRESS_NOT_FOUND");
11667
+ return _context8.abrupt("return", "ADDRESS_NOT_FOUND");
11458
11668
 
11459
11669
  case 38:
11460
11670
  if (!(type === "stat")) {
11461
- _context6.next = 40;
11671
+ _context8.next = 40;
11462
11672
  break;
11463
11673
  }
11464
- return _context6.abrupt("return", [ json ]);
11674
+ return _context8.abrupt("return", [ json ]);
11465
11675
 
11466
11676
  case 40:
11467
- return _context6.abrupt("return", json.result);
11677
+ return _context8.abrupt("return", json.result);
11468
11678
 
11469
11679
  case 43:
11470
- _context6.prev = 43;
11471
- _context6.t1 = _context6["catch"](24);
11472
- return _context6.abrupt("return", "ERROR IN FETCHING");
11680
+ _context8.prev = 43;
11681
+ _context8.t1 = _context8["catch"](24);
11682
+ return _context8.abrupt("return", "ERROR IN FETCHING");
11473
11683
 
11474
11684
  case 46:
11475
11685
  case "end":
11476
- return _context6.stop();
11686
+ return _context8.stop();
11477
11687
  }
11478
- }), _callee6, null, [ [ 24, 43 ] ]);
11688
+ }), _callee8, null, [ [ 24, 43 ] ]);
11479
11689
  })));
11480
11690
  return _BLOCKSCOUT.apply(this, arguments);
11481
11691
  }
@@ -11483,15 +11693,16 @@ function _typeof(o) {
11483
11693
  return _GNOSIS.apply(this, arguments);
11484
11694
  }
11485
11695
  function _GNOSIS() {
11486
- _GNOSIS = _asyncToGenerator(_regeneratorRuntime().mark((function _callee7() {
11487
- var _argsToArray7, _argsToArray8, type, chain, address, startDate, endDate, page, limit, _args7 = arguments;
11488
- return _regeneratorRuntime().wrap((function _callee7$(_context7) {
11489
- while (1) switch (_context7.prev = _context7.next) {
11696
+ _GNOSIS = _asyncToGenerator(_regeneratorRuntime().mark((function _callee9() {
11697
+ var _argsToArray1, _argsToArray10, type, chain, address, startDate, endDate, page, limit, _args9 = arguments;
11698
+ return _regeneratorRuntime().wrap((function _callee9$(_context9) {
11699
+ while (1) switch (_context9.prev = _context9.next) {
11490
11700
  case 0:
11491
- _argsToArray7 = argsToArray(_args7), _argsToArray8 = _slicedToArray(_argsToArray7, 7),
11492
- type = _argsToArray8[0], chain = _argsToArray8[1], address = _argsToArray8[2], startDate = _argsToArray8[3],
11493
- endDate = _argsToArray8[4], page = _argsToArray8[5], limit = _argsToArray8[6];
11494
- return _context7.abrupt("return", handleScanRequest({
11701
+ _argsToArray1 = argsToArray(_args9), _argsToArray10 = _slicedToArray(_argsToArray1, 7),
11702
+ type = _argsToArray10[0], chain = _argsToArray10[1], address = _argsToArray10[2],
11703
+ startDate = _argsToArray10[3], endDate = _argsToArray10[4], page = _argsToArray10[5],
11704
+ limit = _argsToArray10[6];
11705
+ return _context9.abrupt("return", handleScanRequest({
11495
11706
  scanKey: SERVICE_API_KEY.Gnosisscan,
11496
11707
  baseUrl: "https://api.gnosisscan.io/api",
11497
11708
  type: type,
@@ -11505,9 +11716,9 @@ function _typeof(o) {
11505
11716
 
11506
11717
  case 2:
11507
11718
  case "end":
11508
- return _context7.stop();
11719
+ return _context9.stop();
11509
11720
  }
11510
- }), _callee7);
11721
+ }), _callee9);
11511
11722
  })));
11512
11723
  return _GNOSIS.apply(this, arguments);
11513
11724
  }
@@ -11515,43 +11726,43 @@ function _typeof(o) {
11515
11726
  return _NEYNAR.apply(this, arguments);
11516
11727
  }
11517
11728
  function _NEYNAR() {
11518
- _NEYNAR = _asyncToGenerator(_regeneratorRuntime().mark((function _callee8() {
11519
- var _argsToArray9, _argsToArray0, username, API_KEY, fid, url, _json$users, response, json, _args8 = arguments;
11520
- return _regeneratorRuntime().wrap((function _callee8$(_context8) {
11521
- while (1) switch (_context8.prev = _context8.next) {
11729
+ _NEYNAR = _asyncToGenerator(_regeneratorRuntime().mark((function _callee0() {
11730
+ var _argsToArray11, _argsToArray12, username, API_KEY, fid, url, _json$users, response, json, _args0 = arguments;
11731
+ return _regeneratorRuntime().wrap((function _callee0$(_context0) {
11732
+ while (1) switch (_context0.prev = _context0.next) {
11522
11733
  case 0:
11523
- _argsToArray9 = argsToArray(_args8), _argsToArray0 = _slicedToArray(_argsToArray9, 1),
11524
- username = _argsToArray0[0];
11734
+ _argsToArray11 = argsToArray(_args0), _argsToArray12 = _slicedToArray(_argsToArray11, 1),
11735
+ username = _argsToArray12[0];
11525
11736
  API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Neynar);
11526
11737
  if (API_KEY) {
11527
- _context8.next = 4;
11738
+ _context0.next = 4;
11528
11739
  break;
11529
11740
  }
11530
- return _context8.abrupt("return", "".concat(SERVICE_API_KEY.Neynar).concat(ERROR_MESSAGES_FLAG.MISSING_KEY));
11741
+ return _context0.abrupt("return", "".concat(SERVICE_API_KEY.Neynar).concat(ERROR_MESSAGES_FLAG.MISSING_KEY));
11531
11742
 
11532
11743
  case 4:
11533
11744
  if (username) {
11534
- _context8.next = 6;
11745
+ _context0.next = 6;
11535
11746
  break;
11536
11747
  }
11537
- return _context8.abrupt("return", "".concat(SERVICE_API_KEY.Neynar).concat(ERROR_MESSAGES_FLAG.INVALID_PARAM));
11748
+ return _context0.abrupt("return", "".concat(SERVICE_API_KEY.Neynar).concat(ERROR_MESSAGES_FLAG.INVALID_PARAM));
11538
11749
 
11539
11750
  case 6:
11540
- _context8.next = 8;
11751
+ _context0.next = 8;
11541
11752
  return fromUsernameToFid(username);
11542
11753
 
11543
11754
  case 8:
11544
- fid = _context8.sent;
11755
+ fid = _context0.sent;
11545
11756
  if (fid) {
11546
- _context8.next = 11;
11757
+ _context0.next = 11;
11547
11758
  break;
11548
11759
  }
11549
- return _context8.abrupt("return", "".concat(SERVICE_API_KEY.Neynar).concat(ERROR_MESSAGES_FLAG.INVALID_PARAM));
11760
+ return _context0.abrupt("return", "".concat(SERVICE_API_KEY.Neynar).concat(ERROR_MESSAGES_FLAG.INVALID_PARAM));
11550
11761
 
11551
11762
  case 11:
11552
11763
  url = "https://api.neynar.com/v2/farcaster/followers?fid=".concat(fid);
11553
- _context8.prev = 12;
11554
- _context8.next = 15;
11764
+ _context0.prev = 12;
11765
+ _context0.next = 15;
11555
11766
  return fetch(url, {
11556
11767
  headers: {
11557
11768
  "x-api-key": API_KEY,
@@ -11560,27 +11771,27 @@ function _typeof(o) {
11560
11771
  });
11561
11772
 
11562
11773
  case 15:
11563
- response = _context8.sent;
11774
+ response = _context0.sent;
11564
11775
  if (response.ok) {
11565
- _context8.next = 18;
11776
+ _context0.next = 18;
11566
11777
  break;
11567
11778
  }
11568
11779
  throw new Error("HTTP ".concat(response.status));
11569
11780
 
11570
11781
  case 18:
11571
- _context8.next = 20;
11782
+ _context0.next = 20;
11572
11783
  return response.json();
11573
11784
 
11574
11785
  case 20:
11575
- json = _context8.sent;
11786
+ json = _context0.sent;
11576
11787
  if (json !== null && json !== void 0 && (_json$users = json.users) !== null && _json$users !== void 0 && _json$users.length) {
11577
- _context8.next = 23;
11788
+ _context0.next = 23;
11578
11789
  break;
11579
11790
  }
11580
- return _context8.abrupt("return", []);
11791
+ return _context0.abrupt("return", []);
11581
11792
 
11582
11793
  case 23:
11583
- return _context8.abrupt("return", json.users.map((function(_ref5) {
11794
+ return _context0.abrupt("return", json.users.map((function(_ref5) {
11584
11795
  var _user$profile, _user$profile2;
11585
11796
  var user = _ref5.user;
11586
11797
  return {
@@ -11593,16 +11804,16 @@ function _typeof(o) {
11593
11804
  })));
11594
11805
 
11595
11806
  case 26:
11596
- _context8.prev = 26;
11597
- _context8.t0 = _context8["catch"](12);
11598
- console.error("NEYNAR_FETCH_FOLLOWERS error:", _context8.t0);
11599
- return _context8.abrupt("return", ERROR_MESSAGES_FLAG.DEFAULT);
11807
+ _context0.prev = 26;
11808
+ _context0.t0 = _context0["catch"](12);
11809
+ console.error("NEYNAR_FETCH_FOLLOWERS error:", _context0.t0);
11810
+ return _context0.abrupt("return", ERROR_MESSAGES_FLAG.DEFAULT);
11600
11811
 
11601
11812
  case 30:
11602
11813
  case "end":
11603
- return _context8.stop();
11814
+ return _context0.stop();
11604
11815
  }
11605
- }), _callee8, null, [ [ 12, 26 ] ]);
11816
+ }), _callee0, null, [ [ 12, 26 ] ]);
11606
11817
  })));
11607
11818
  return _NEYNAR.apply(this, arguments);
11608
11819
  }
@@ -11610,10 +11821,10 @@ function _typeof(o) {
11610
11821
  return _GNOSISPAY.apply(this, arguments);
11611
11822
  }
11612
11823
  function _GNOSISPAY() {
11613
- _GNOSISPAY = _asyncToGenerator(_regeneratorRuntime().mark((function _callee9(_ref4) {
11824
+ _GNOSISPAY = _asyncToGenerator(_regeneratorRuntime().mark((function _callee1(_ref4) {
11614
11825
  var cardId, startDate, endDate, _ref4$limit, limit, _ref4$offset, offset, apiKeyKey, API_KEY, url, res, json;
11615
- return _regeneratorRuntime().wrap((function _callee9$(_context9) {
11616
- while (1) switch (_context9.prev = _context9.next) {
11826
+ return _regeneratorRuntime().wrap((function _callee1$(_context1) {
11827
+ while (1) switch (_context1.prev = _context1.next) {
11617
11828
  case 0:
11618
11829
  cardId = _ref4.cardId, startDate = _ref4.startDate, endDate = _ref4.endDate, _ref4$limit = _ref4.limit,
11619
11830
  limit = _ref4$limit === void 0 ? 20 : _ref4$limit, _ref4$offset = _ref4.offset,
@@ -11621,17 +11832,17 @@ function _typeof(o) {
11621
11832
  apiKeyKey = SERVICE_API_KEY.GnosisPay;
11622
11833
  API_KEY = window.localStorage.getItem(apiKeyKey);
11623
11834
  if (API_KEY) {
11624
- _context9.next = 5;
11835
+ _context1.next = 5;
11625
11836
  break;
11626
11837
  }
11627
- return _context9.abrupt("return", "".concat(apiKeyKey).concat(ERROR_MESSAGES_FLAG.MISSING_KEY));
11838
+ return _context1.abrupt("return", "".concat(apiKeyKey).concat(ERROR_MESSAGES_FLAG.MISSING_KEY));
11628
11839
 
11629
11840
  case 5:
11630
11841
  if (cardId) {
11631
- _context9.next = 7;
11842
+ _context1.next = 7;
11632
11843
  break;
11633
11844
  }
11634
- return _context9.abrupt("return", "".concat(apiKeyKey).concat(ERROR_MESSAGES_FLAG.INVALID_PARAM));
11845
+ return _context1.abrupt("return", "".concat(apiKeyKey).concat(ERROR_MESSAGES_FLAG.INVALID_PARAM));
11635
11846
 
11636
11847
  case 7:
11637
11848
  url = new URL("https://api.gnosispay.com/cards/".concat(cardId, "/transactions"));
@@ -11643,8 +11854,8 @@ function _typeof(o) {
11643
11854
  if (!isNaN(toTimestamp(endDate))) {
11644
11855
  url.searchParams.set("endDate", new Date(endDate * 1e3).toISOString());
11645
11856
  }
11646
- _context9.prev = 12;
11647
- _context9.next = 15;
11857
+ _context1.prev = 12;
11858
+ _context1.next = 15;
11648
11859
  return fetch(url.toString(), {
11649
11860
  headers: {
11650
11861
  Authorization: "Bearer ".concat(API_KEY),
@@ -11653,27 +11864,27 @@ function _typeof(o) {
11653
11864
  });
11654
11865
 
11655
11866
  case 15:
11656
- res = _context9.sent;
11867
+ res = _context1.sent;
11657
11868
  if (res.ok) {
11658
- _context9.next = 18;
11869
+ _context1.next = 18;
11659
11870
  break;
11660
11871
  }
11661
11872
  throw new Error("HTTP error! Status: ".concat(res.status));
11662
11873
 
11663
11874
  case 18:
11664
- _context9.next = 20;
11875
+ _context1.next = 20;
11665
11876
  return res.json();
11666
11877
 
11667
11878
  case 20:
11668
- json = _context9.sent;
11879
+ json = _context1.sent;
11669
11880
  if (Array.isArray(json)) {
11670
- _context9.next = 23;
11881
+ _context1.next = 23;
11671
11882
  break;
11672
11883
  }
11673
- return _context9.abrupt("return", []);
11884
+ return _context1.abrupt("return", []);
11674
11885
 
11675
11886
  case 23:
11676
- return _context9.abrupt("return", json.map((function(tx) {
11887
+ return _context1.abrupt("return", json.map((function(tx) {
11677
11888
  return {
11678
11889
  createdAt: tx.createdAt,
11679
11890
  clearedAt: tx.clearedAt,
@@ -11691,16 +11902,16 @@ function _typeof(o) {
11691
11902
  })));
11692
11903
 
11693
11904
  case 26:
11694
- _context9.prev = 26;
11695
- _context9.t0 = _context9["catch"](12);
11696
- console.error("GNOSISPAY_CARD_TXNS error:", _context9.t0);
11697
- return _context9.abrupt("return", ERROR_MESSAGES_FLAG.DEFAULT);
11905
+ _context1.prev = 26;
11906
+ _context1.t0 = _context1["catch"](12);
11907
+ console.error("GNOSISPAY_CARD_TXNS error:", _context1.t0);
11908
+ return _context1.abrupt("return", ERROR_MESSAGES_FLAG.DEFAULT);
11698
11909
 
11699
11910
  case 30:
11700
11911
  case "end":
11701
- return _context9.stop();
11912
+ return _context1.stop();
11702
11913
  }
11703
- }), _callee9, null, [ [ 12, 26 ] ]);
11914
+ }), _callee1, null, [ [ 12, 26 ] ]);
11704
11915
  })));
11705
11916
  return _GNOSISPAY.apply(this, arguments);
11706
11917
  }
@@ -11708,17 +11919,17 @@ function _typeof(o) {
11708
11919
  return _ETHERSCAN.apply(this, arguments);
11709
11920
  }
11710
11921
  function _ETHERSCAN() {
11711
- _ETHERSCAN = _asyncToGenerator(_regeneratorRuntime().mark((function _callee0() {
11712
- var _len2, args, _key2, type, chain, address, startDate, endDate, page, limit, _args0 = arguments;
11713
- return _regeneratorRuntime().wrap((function _callee0$(_context0) {
11714
- while (1) switch (_context0.prev = _context0.next) {
11922
+ _ETHERSCAN = _asyncToGenerator(_regeneratorRuntime().mark((function _callee10() {
11923
+ var _len2, args, _key2, type, chain, address, startDate, endDate, page, limit, _args10 = arguments;
11924
+ return _regeneratorRuntime().wrap((function _callee10$(_context10) {
11925
+ while (1) switch (_context10.prev = _context10.next) {
11715
11926
  case 0:
11716
- for (_len2 = _args0.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
11717
- args[_key2] = _args0[_key2];
11927
+ for (_len2 = _args10.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
11928
+ args[_key2] = _args10[_key2];
11718
11929
  }
11719
11930
  type = args[0], chain = args[1], address = args[2], startDate = args[3], endDate = args[4],
11720
11931
  page = args[5], limit = args[6];
11721
- return _context0.abrupt("return", handleScanRequest({
11932
+ return _context10.abrupt("return", handleScanRequest({
11722
11933
  scanKey: SERVICE_API_KEY.Etherscan,
11723
11934
  baseUrl: "https://api.etherscan.io/v2/api",
11724
11935
  type: type,
@@ -11732,9 +11943,9 @@ function _typeof(o) {
11732
11943
 
11733
11944
  case 3:
11734
11945
  case "end":
11735
- return _context0.stop();
11946
+ return _context10.stop();
11736
11947
  }
11737
- }), _callee0);
11948
+ }), _callee10);
11738
11949
  })));
11739
11950
  return _ETHERSCAN.apply(this, arguments);
11740
11951
  }
@@ -11742,17 +11953,17 @@ function _typeof(o) {
11742
11953
  return _COINGECKO.apply(this, arguments);
11743
11954
  }
11744
11955
  function _COINGECKO() {
11745
- _COINGECKO = _asyncToGenerator(_regeneratorRuntime().mark((function _callee1(category, param1, param2) {
11746
- var API_KEY, headers, url, lowerCategory, token, vsCurrencies, 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;
11747
- return _regeneratorRuntime().wrap((function _callee1$(_context1) {
11748
- while (1) switch (_context1.prev = _context1.next) {
11956
+ _COINGECKO = _asyncToGenerator(_regeneratorRuntime().mark((function _callee11(category, param1, param2) {
11957
+ var API_KEY, headers, url, lowerCategory, token, vsCurrencies, ecosystemMap, key, categoryVal, trend, _category, _trend, exchange, response, json, _json$status, message, output, _i14, _Object$entries5, _Object$entries5$_i, _token, prices, _i15, _Object$entries6, _Object$entries6$_i, currency, _value9, _key3, _data, flatArray;
11958
+ return _regeneratorRuntime().wrap((function _callee11$(_context11) {
11959
+ while (1) switch (_context11.prev = _context11.next) {
11749
11960
  case 0:
11750
11961
  API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Coingecko);
11751
11962
  if (API_KEY) {
11752
- _context1.next = 3;
11963
+ _context11.next = 3;
11753
11964
  break;
11754
11965
  }
11755
- return _context1.abrupt("return", "".concat(SERVICE_API_KEY.Coingecko).concat(ERROR_MESSAGES_FLAG.MISSING_KEY));
11966
+ return _context11.abrupt("return", "".concat(SERVICE_API_KEY.Coingecko).concat(ERROR_MESSAGES_FLAG.MISSING_KEY));
11756
11967
 
11757
11968
  case 3:
11758
11969
  headers = {
@@ -11761,22 +11972,22 @@ function _typeof(o) {
11761
11972
  };
11762
11973
  url = "";
11763
11974
  lowerCategory = (category || "").toLowerCase();
11764
- _context1.t0 = lowerCategory;
11765
- _context1.next = _context1.t0 === "price" ? 9 : _context1.t0 === "market" ? 15 : _context1.t0 === "stablecoins" ? 25 : _context1.t0 === "derivatives" ? 29 : 32;
11975
+ _context11.t0 = lowerCategory;
11976
+ _context11.next = _context11.t0 === "price" ? 9 : _context11.t0 === "market" ? 15 : _context11.t0 === "stablecoins" ? 25 : _context11.t0 === "derivatives" ? 29 : 32;
11766
11977
  break;
11767
11978
 
11768
11979
  case 9:
11769
11980
  token = param1;
11770
11981
  vsCurrencies = param2;
11771
11982
  if (token) {
11772
- _context1.next = 13;
11983
+ _context11.next = 13;
11773
11984
  break;
11774
11985
  }
11775
- return _context1.abrupt("return", "".concat(SERVICE_API_KEY.Coingecko).concat(ERROR_MESSAGES_FLAG.INVALID_PARAM));
11986
+ return _context11.abrupt("return", "".concat(SERVICE_API_KEY.Coingecko).concat(ERROR_MESSAGES_FLAG.INVALID_PARAM));
11776
11987
 
11777
11988
  case 13:
11778
11989
  url = "https://api.coingecko.com/api/v3/simple/price?vs_currencies=".concat(vsCurrencies ? vsCurrencies : "usd", "&symbols=").concat(token);
11779
- return _context1.abrupt("break", 33);
11990
+ return _context11.abrupt("break", 33);
11780
11991
 
11781
11992
  case 15:
11782
11993
  ecosystemMap = {
@@ -11796,21 +12007,21 @@ function _typeof(o) {
11796
12007
  trend = param2 ? "&price_change_percentage=".concat(param2) : "";
11797
12008
  url = "https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&include_tokens=top&page=1&per_page=100";
11798
12009
  if (!(key && !categoryVal)) {
11799
- _context1.next = 22;
12010
+ _context11.next = 22;
11800
12011
  break;
11801
12012
  }
11802
- return _context1.abrupt("return", "".concat(SERVICE_API_KEY.Coingecko).concat(ERROR_MESSAGES_FLAG.INVALID_PARAM));
12013
+ return _context11.abrupt("return", "".concat(SERVICE_API_KEY.Coingecko).concat(ERROR_MESSAGES_FLAG.INVALID_PARAM));
11803
12014
 
11804
12015
  case 22:
11805
12016
  if (categoryVal) url += "&category=".concat(categoryVal);
11806
12017
  if (trend) url += trend;
11807
- return _context1.abrupt("break", 33);
12018
+ return _context11.abrupt("break", 33);
11808
12019
 
11809
12020
  case 25:
11810
12021
  _category = !param1 || param1.toLowerCase() === "all" ? "stablecoins" : param1.toLowerCase();
11811
12022
  _trend = param2 ? "&price_change_percentage=".concat(param2) : "";
11812
12023
  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);
11813
- return _context1.abrupt("break", 33);
12024
+ return _context11.abrupt("break", 33);
11814
12025
 
11815
12026
  case 29:
11816
12027
  exchange = param1;
@@ -11819,61 +12030,61 @@ function _typeof(o) {
11819
12030
  } else {
11820
12031
  url = "https://api.coingecko.com/api/v3/derivatives/exchanges/".concat(exchange, "?include_tickers=all");
11821
12032
  }
11822
- return _context1.abrupt("break", 33);
12033
+ return _context11.abrupt("break", 33);
11823
12034
 
11824
12035
  case 32:
11825
- return _context1.abrupt("return", "".concat(SERVICE_API_KEY.Coingecko).concat(ERROR_MESSAGES_FLAG.INVALID_PARAM));
12036
+ return _context11.abrupt("return", "".concat(SERVICE_API_KEY.Coingecko).concat(ERROR_MESSAGES_FLAG.INVALID_PARAM));
11826
12037
 
11827
12038
  case 33:
11828
- _context1.prev = 33;
11829
- _context1.next = 36;
12039
+ _context11.prev = 33;
12040
+ _context11.next = 36;
11830
12041
  return fetch(url, {
11831
12042
  method: "GET",
11832
12043
  headers: headers
11833
12044
  });
11834
12045
 
11835
12046
  case 36:
11836
- response = _context1.sent;
11837
- _context1.next = 39;
12047
+ response = _context11.sent;
12048
+ _context11.next = 39;
11838
12049
  return response.json();
11839
12050
 
11840
12051
  case 39:
11841
- json = _context1.sent;
12052
+ json = _context11.sent;
11842
12053
  if (response.ok) {
11843
- _context1.next = 46;
12054
+ _context11.next = 46;
11844
12055
  break;
11845
12056
  }
11846
12057
  message = (json === null || json === void 0 || (_json$status = json.status) === null || _json$status === void 0 ? void 0 : _json$status.error_message) || "";
11847
12058
  if (!message.includes("API Key Missing")) {
11848
- _context1.next = 44;
12059
+ _context11.next = 44;
11849
12060
  break;
11850
12061
  }
11851
- return _context1.abrupt("return", "".concat(SERVICE_API_KEY.Coingecko).concat(ERROR_MESSAGES_FLAG.INVALID_API_KEY));
12062
+ return _context11.abrupt("return", "".concat(SERVICE_API_KEY.Coingecko).concat(ERROR_MESSAGES_FLAG.INVALID_API_KEY));
11852
12063
 
11853
12064
  case 44:
11854
12065
  if (!(response.status === 429)) {
11855
- _context1.next = 46;
12066
+ _context11.next = 46;
11856
12067
  break;
11857
12068
  }
11858
- return _context1.abrupt("return", "".concat(SERVICE_API_KEY.Coingecko).concat(ERROR_MESSAGES_FLAG.RATE_LIMIT));
12069
+ return _context11.abrupt("return", "".concat(SERVICE_API_KEY.Coingecko).concat(ERROR_MESSAGES_FLAG.RATE_LIMIT));
11859
12070
 
11860
12071
  case 46:
11861
12072
  if (!(lowerCategory === "price")) {
11862
- _context1.next = 50;
12073
+ _context11.next = 50;
11863
12074
  break;
11864
12075
  }
11865
12076
  output = {};
11866
- for (_i11 = 0, _Object$entries2 = Object.entries(json); _i11 < _Object$entries2.length; _i11++) {
11867
- _Object$entries2$_i = _slicedToArray(_Object$entries2[_i11], 2), _token = _Object$entries2$_i[0],
11868
- prices = _Object$entries2$_i[1];
11869
- for (_i12 = 0, _Object$entries3 = Object.entries(prices); _i12 < _Object$entries3.length; _i12++) {
11870
- _Object$entries3$_i = _slicedToArray(_Object$entries3[_i12], 2), currency = _Object$entries3$_i[0],
11871
- _value6 = _Object$entries3$_i[1];
12077
+ for (_i14 = 0, _Object$entries5 = Object.entries(json); _i14 < _Object$entries5.length; _i14++) {
12078
+ _Object$entries5$_i = _slicedToArray(_Object$entries5[_i14], 2), _token = _Object$entries5$_i[0],
12079
+ prices = _Object$entries5$_i[1];
12080
+ for (_i15 = 0, _Object$entries6 = Object.entries(prices); _i15 < _Object$entries6.length; _i15++) {
12081
+ _Object$entries6$_i = _slicedToArray(_Object$entries6[_i15], 2), currency = _Object$entries6$_i[0],
12082
+ _value9 = _Object$entries6$_i[1];
11872
12083
  _key3 = "".concat(_token.charAt(0).toUpperCase() + _token.slice(1), "_").concat(currency.toUpperCase());
11873
- output[_key3] = _value6;
12084
+ output[_key3] = _value9;
11874
12085
  }
11875
12086
  }
11876
- return _context1.abrupt("return", [ output ]);
12087
+ return _context11.abrupt("return", [ output ]);
11877
12088
 
11878
12089
  case 50:
11879
12090
  _data = json;
@@ -11886,28 +12097,28 @@ function _typeof(o) {
11886
12097
  }
11887
12098
  }
11888
12099
  flatArray = Array.isArray(_data) ? _data : [ _data ];
11889
- return _context1.abrupt("return", flatArray.map((function(item) {
12100
+ return _context11.abrupt("return", flatArray.map((function(item) {
11890
12101
  var flat = {};
11891
- for (var _i13 = 0, _Object$entries4 = Object.entries(item); _i13 < _Object$entries4.length; _i13++) {
11892
- var _Object$entries4$_i = _slicedToArray(_Object$entries4[_i13], 2), _key4 = _Object$entries4$_i[0], _value7 = _Object$entries4$_i[1];
11893
- if (_typeof(_value7) !== "object" || _value7 === null) {
11894
- flat[_key4] = _value7;
12102
+ for (var _i16 = 0, _Object$entries7 = Object.entries(item); _i16 < _Object$entries7.length; _i16++) {
12103
+ var _Object$entries7$_i = _slicedToArray(_Object$entries7[_i16], 2), _key4 = _Object$entries7$_i[0], _value0 = _Object$entries7$_i[1];
12104
+ if (_typeof(_value0) !== "object" || _value0 === null) {
12105
+ flat[_key4] = _value0;
11895
12106
  }
11896
12107
  }
11897
12108
  return flat;
11898
12109
  })));
11899
12110
 
11900
12111
  case 56:
11901
- _context1.prev = 56;
11902
- _context1.t1 = _context1["catch"](33);
11903
- console.error(_context1.t1);
11904
- return _context1.abrupt("return", ERROR_MESSAGES_FLAG.DEFAULT);
12112
+ _context11.prev = 56;
12113
+ _context11.t1 = _context11["catch"](33);
12114
+ console.error(_context11.t1);
12115
+ return _context11.abrupt("return", ERROR_MESSAGES_FLAG.DEFAULT);
11905
12116
 
11906
12117
  case 60:
11907
12118
  case "end":
11908
- return _context1.stop();
12119
+ return _context11.stop();
11909
12120
  }
11910
- }), _callee1, null, [ [ 33, 56 ] ]);
12121
+ }), _callee11, null, [ [ 33, 56 ] ]);
11911
12122
  })));
11912
12123
  return _COINGECKO.apply(this, arguments);
11913
12124
  }
@@ -11915,68 +12126,68 @@ function _typeof(o) {
11915
12126
  return _EOA.apply(this, arguments);
11916
12127
  }
11917
12128
  function _EOA() {
11918
- _EOA = _asyncToGenerator(_regeneratorRuntime().mark((function _callee11() {
11919
- 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;
11920
- return _regeneratorRuntime().wrap((function _callee11$(_context13) {
11921
- while (1) switch (_context13.prev = _context13.next) {
12129
+ _EOA = _asyncToGenerator(_regeneratorRuntime().mark((function _callee13() {
12130
+ var API_KEY, _argsToArray13, _argsToArray14, addresses, category, chains, startTime, endTime, _argsToArray14$, page, _argsToArray14$2, offset, INPUTS, CHAINS, out, ADDRESS_MAP, _iterator, _step, input, resolved, ADDRS, _iterator2, _step2, _loop, _ret, fetchJSON, _fetchJSON, _args15 = arguments;
12131
+ return _regeneratorRuntime().wrap((function _callee13$(_context15) {
12132
+ while (1) switch (_context15.prev = _context15.next) {
11922
12133
  case 0:
11923
12134
  _fetchJSON = function _fetchJSON3() {
11924
- _fetchJSON = _asyncToGenerator(_regeneratorRuntime().mark((function _callee10(url) {
12135
+ _fetchJSON = _asyncToGenerator(_regeneratorRuntime().mark((function _callee12(url) {
11925
12136
  var _json$result3, _json$result3$include, _json$result4, _json$result4$include, res, json;
11926
- return _regeneratorRuntime().wrap((function _callee10$(_context12) {
11927
- while (1) switch (_context12.prev = _context12.next) {
12137
+ return _regeneratorRuntime().wrap((function _callee12$(_context14) {
12138
+ while (1) switch (_context14.prev = _context14.next) {
11928
12139
  case 0:
11929
- _context12.prev = 0;
11930
- _context12.next = 3;
12140
+ _context14.prev = 0;
12141
+ _context14.next = 3;
11931
12142
  return fetch(url);
11932
12143
 
11933
12144
  case 3:
11934
- res = _context12.sent;
12145
+ res = _context14.sent;
11935
12146
  if (res.ok) {
11936
- _context12.next = 6;
12147
+ _context14.next = 6;
11937
12148
  break;
11938
12149
  }
11939
- return _context12.abrupt("return", "HTTP_".concat(res.status));
12150
+ return _context14.abrupt("return", "HTTP_".concat(res.status));
11940
12151
 
11941
12152
  case 6:
11942
- _context12.next = 8;
12153
+ _context14.next = 8;
11943
12154
  return res.json();
11944
12155
 
11945
12156
  case 8:
11946
- json = _context12.sent;
12157
+ json = _context14.sent;
11947
12158
  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"))) {
11948
- _context12.next = 11;
12159
+ _context14.next = 11;
11949
12160
  break;
11950
12161
  }
11951
- return _context12.abrupt("return", "".concat(SERVICE_API_KEY.Etherscan).concat(ERROR_MESSAGES_FLAG.INVALID_API_KEY));
12162
+ return _context14.abrupt("return", "".concat(SERVICE_API_KEY.Etherscan).concat(ERROR_MESSAGES_FLAG.INVALID_API_KEY));
11952
12163
 
11953
12164
  case 11:
11954
12165
  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"))) {
11955
- _context12.next = 13;
12166
+ _context14.next = 13;
11956
12167
  break;
11957
12168
  }
11958
- return _context12.abrupt("return", "".concat(SERVICE_API_KEY.Etherscan).concat(ERROR_MESSAGES_FLAG.RATE_LIMIT));
12169
+ return _context14.abrupt("return", "".concat(SERVICE_API_KEY.Etherscan).concat(ERROR_MESSAGES_FLAG.RATE_LIMIT));
11959
12170
 
11960
12171
  case 13:
11961
12172
  if (!(json.status === "0" && json.message !== "No transactions found")) {
11962
- _context12.next = 15;
12173
+ _context14.next = 15;
11963
12174
  break;
11964
12175
  }
11965
- return _context12.abrupt("return", ERROR_MESSAGES_FLAG.DEFAULT);
12176
+ return _context14.abrupt("return", ERROR_MESSAGES_FLAG.DEFAULT);
11966
12177
 
11967
12178
  case 15:
11968
- return _context12.abrupt("return", json.result);
12179
+ return _context14.abrupt("return", json.result);
11969
12180
 
11970
12181
  case 18:
11971
- _context12.prev = 18;
11972
- _context12.t0 = _context12["catch"](0);
11973
- return _context12.abrupt("return", ERROR_MESSAGES_FLAG.DEFAULT);
12182
+ _context14.prev = 18;
12183
+ _context14.t0 = _context14["catch"](0);
12184
+ return _context14.abrupt("return", ERROR_MESSAGES_FLAG.DEFAULT);
11974
12185
 
11975
12186
  case 21:
11976
12187
  case "end":
11977
- return _context12.stop();
12188
+ return _context14.stop();
11978
12189
  }
11979
- }), _callee10, null, [ [ 0, 18 ] ]);
12190
+ }), _callee12, null, [ [ 0, 18 ] ]);
11980
12191
  })));
11981
12192
  return _fetchJSON.apply(this, arguments);
11982
12193
  };
@@ -11985,17 +12196,17 @@ function _typeof(o) {
11985
12196
  };
11986
12197
  API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Etherscan);
11987
12198
  if (API_KEY) {
11988
- _context13.next = 5;
12199
+ _context15.next = 5;
11989
12200
  break;
11990
12201
  }
11991
- return _context13.abrupt("return", "".concat(SERVICE_API_KEY.Etherscan).concat(ERROR_MESSAGES_FLAG.MISSING_KEY));
12202
+ return _context15.abrupt("return", "".concat(SERVICE_API_KEY.Etherscan).concat(ERROR_MESSAGES_FLAG.MISSING_KEY));
11992
12203
 
11993
12204
  case 5:
11994
- _argsToArray1 = argsToArray(_args13), _argsToArray10 = _slicedToArray(_argsToArray1, 7),
11995
- addresses = _argsToArray10[0], category = _argsToArray10[1], chains = _argsToArray10[2],
11996
- startTime = _argsToArray10[3], endTime = _argsToArray10[4], _argsToArray10$ = _argsToArray10[5],
11997
- page = _argsToArray10$ === void 0 ? 1 : _argsToArray10$, _argsToArray10$2 = _argsToArray10[6],
11998
- offset = _argsToArray10$2 === void 0 ? 10 : _argsToArray10$2;
12205
+ _argsToArray13 = argsToArray(_args15), _argsToArray14 = _slicedToArray(_argsToArray13, 7),
12206
+ addresses = _argsToArray14[0], category = _argsToArray14[1], chains = _argsToArray14[2],
12207
+ startTime = _argsToArray14[3], endTime = _argsToArray14[4], _argsToArray14$ = _argsToArray14[5],
12208
+ page = _argsToArray14$ === void 0 ? 1 : _argsToArray14$, _argsToArray14$2 = _argsToArray14[6],
12209
+ offset = _argsToArray14$2 === void 0 ? 10 : _argsToArray14$2;
11999
12210
  INPUTS = addresses.split(",").map((function(a) {
12000
12211
  return a.trim();
12001
12212
  })).filter(Boolean);
@@ -12005,101 +12216,101 @@ function _typeof(o) {
12005
12216
  out = [];
12006
12217
  ADDRESS_MAP = {};
12007
12218
  _iterator = _createForOfIteratorHelper(INPUTS);
12008
- _context13.prev = 11;
12219
+ _context15.prev = 11;
12009
12220
  _iterator.s();
12010
12221
 
12011
12222
  case 13:
12012
12223
  if ((_step = _iterator.n()).done) {
12013
- _context13.next = 31;
12224
+ _context15.next = 31;
12014
12225
  break;
12015
12226
  }
12016
12227
  input = _step.value;
12017
12228
  if (!isAddress(input)) {
12018
- _context13.next = 19;
12229
+ _context15.next = 19;
12019
12230
  break;
12020
12231
  }
12021
12232
  ADDRESS_MAP[input.toLowerCase()] = null;
12022
- _context13.next = 29;
12233
+ _context15.next = 29;
12023
12234
  break;
12024
12235
 
12025
12236
  case 19:
12026
- _context13.prev = 19;
12027
- _context13.next = 22;
12237
+ _context15.prev = 19;
12238
+ _context15.next = 22;
12028
12239
  return fromEnsNameToAddress(input);
12029
12240
 
12030
12241
  case 22:
12031
- resolved = _context13.sent;
12242
+ resolved = _context15.sent;
12032
12243
  if (resolved) ADDRESS_MAP[resolved.toLowerCase()] = input;
12033
- _context13.next = 29;
12244
+ _context15.next = 29;
12034
12245
  break;
12035
12246
 
12036
12247
  case 26:
12037
- _context13.prev = 26;
12038
- _context13.t0 = _context13["catch"](19);
12039
- return _context13.abrupt("return", "".concat(input).concat(ERROR_MESSAGES_FLAG.INVALID_PARAM));
12248
+ _context15.prev = 26;
12249
+ _context15.t0 = _context15["catch"](19);
12250
+ return _context15.abrupt("return", "".concat(input).concat(ERROR_MESSAGES_FLAG.INVALID_PARAM));
12040
12251
 
12041
12252
  case 29:
12042
- _context13.next = 13;
12253
+ _context15.next = 13;
12043
12254
  break;
12044
12255
 
12045
12256
  case 31:
12046
- _context13.next = 36;
12257
+ _context15.next = 36;
12047
12258
  break;
12048
12259
 
12049
12260
  case 33:
12050
- _context13.prev = 33;
12051
- _context13.t1 = _context13["catch"](11);
12052
- _iterator.e(_context13.t1);
12261
+ _context15.prev = 33;
12262
+ _context15.t1 = _context15["catch"](11);
12263
+ _iterator.e(_context15.t1);
12053
12264
 
12054
12265
  case 36:
12055
- _context13.prev = 36;
12266
+ _context15.prev = 36;
12056
12267
  _iterator.f();
12057
- return _context13.finish(36);
12268
+ return _context15.finish(36);
12058
12269
 
12059
12270
  case 39:
12060
12271
  ADDRS = Object.keys(ADDRESS_MAP);
12061
12272
  _iterator2 = _createForOfIteratorHelper(CHAINS);
12062
- _context13.prev = 41;
12273
+ _context15.prev = 41;
12063
12274
  _loop = _regeneratorRuntime().mark((function _loop() {
12064
- var chain, chainId, i, slice, action, url, _data2, startBlock, endBlock, _loop2, _ret2, _i14, _ADDRS;
12065
- return _regeneratorRuntime().wrap((function _loop$(_context11) {
12066
- while (1) switch (_context11.prev = _context11.next) {
12275
+ var chain, chainId, i, slice, action, url, _data2, startBlock, endBlock, _loop2, _ret2, _i17, _ADDRS;
12276
+ return _regeneratorRuntime().wrap((function _loop$(_context13) {
12277
+ while (1) switch (_context13.prev = _context13.next) {
12067
12278
  case 0:
12068
12279
  chain = _step2.value;
12069
12280
  chainId = CHAIN_ID_MAP[chain];
12070
12281
  if (chainId) {
12071
- _context11.next = 4;
12282
+ _context13.next = 4;
12072
12283
  break;
12073
12284
  }
12074
- return _context11.abrupt("return", {
12285
+ return _context13.abrupt("return", {
12075
12286
  v: ERROR_MESSAGES_FLAG.UNSUPPORTED_CHAIN
12076
12287
  });
12077
12288
 
12078
12289
  case 4:
12079
12290
  if (!(category === "balance")) {
12080
- _context11.next = 20;
12291
+ _context13.next = 20;
12081
12292
  break;
12082
12293
  }
12083
12294
  i = 0;
12084
12295
 
12085
12296
  case 6:
12086
12297
  if (!(i < ADDRS.length)) {
12087
- _context11.next = 19;
12298
+ _context13.next = 19;
12088
12299
  break;
12089
12300
  }
12090
12301
  slice = ADDRS.slice(i, i + 20).join(",");
12091
12302
  action = ADDRS.length > 1 ? "balancemulti" : "balance";
12092
12303
  url = "https://api.etherscan.io/v2/api?chainid=".concat(chainId) + "&module=account&action=".concat(action, "&address=").concat(slice) + "&tag=latest&apikey=".concat(API_KEY);
12093
- _context11.next = 12;
12304
+ _context13.next = 12;
12094
12305
  return fetchJSON(url);
12095
12306
 
12096
12307
  case 12:
12097
- _data2 = _context11.sent;
12308
+ _data2 = _context13.sent;
12098
12309
  if (!(typeof _data2 === "string")) {
12099
- _context11.next = 15;
12310
+ _context13.next = 15;
12100
12311
  break;
12101
12312
  }
12102
- return _context11.abrupt("return", {
12313
+ return _context13.abrupt("return", {
12103
12314
  v: _data2
12104
12315
  });
12105
12316
 
@@ -12114,44 +12325,44 @@ function _typeof(o) {
12114
12325
 
12115
12326
  case 16:
12116
12327
  i += 20;
12117
- _context11.next = 6;
12328
+ _context13.next = 6;
12118
12329
  break;
12119
12330
 
12120
12331
  case 19:
12121
- return _context11.abrupt("return", 0);
12332
+ return _context13.abrupt("return", 0);
12122
12333
 
12123
12334
  case 20:
12124
12335
  if (!(category === "txns")) {
12125
- _context11.next = 38;
12336
+ _context13.next = 38;
12126
12337
  break;
12127
12338
  }
12128
- _context11.next = 23;
12339
+ _context13.next = 23;
12129
12340
  return fromTimeStampToBlock(toTimestamp(startTime), chain, API_KEY);
12130
12341
 
12131
12342
  case 23:
12132
- startBlock = _context11.sent;
12133
- _context11.next = 26;
12343
+ startBlock = _context13.sent;
12344
+ _context13.next = 26;
12134
12345
  return fromTimeStampToBlock(toTimestamp(endTime), chain, API_KEY);
12135
12346
 
12136
12347
  case 26:
12137
- endBlock = _context11.sent;
12348
+ endBlock = _context13.sent;
12138
12349
  _loop2 = _regeneratorRuntime().mark((function _loop2() {
12139
12350
  var addr, url, data;
12140
- return _regeneratorRuntime().wrap((function _loop2$(_context10) {
12141
- while (1) switch (_context10.prev = _context10.next) {
12351
+ return _regeneratorRuntime().wrap((function _loop2$(_context12) {
12352
+ while (1) switch (_context12.prev = _context12.next) {
12142
12353
  case 0:
12143
- addr = _ADDRS[_i14];
12354
+ addr = _ADDRS[_i17];
12144
12355
  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);
12145
- _context10.next = 4;
12356
+ _context12.next = 4;
12146
12357
  return fetchJSON(url);
12147
12358
 
12148
12359
  case 4:
12149
- data = _context10.sent;
12360
+ data = _context12.sent;
12150
12361
  if (!(typeof data === "string")) {
12151
- _context10.next = 7;
12362
+ _context12.next = 7;
12152
12363
  break;
12153
12364
  }
12154
- return _context10.abrupt("return", {
12365
+ return _context12.abrupt("return", {
12155
12366
  v: {
12156
12367
  v: data
12157
12368
  }
@@ -12168,43 +12379,43 @@ function _typeof(o) {
12168
12379
 
12169
12380
  case 8:
12170
12381
  case "end":
12171
- return _context10.stop();
12382
+ return _context12.stop();
12172
12383
  }
12173
12384
  }), _loop2);
12174
12385
  }));
12175
- _i14 = 0, _ADDRS = ADDRS;
12386
+ _i17 = 0, _ADDRS = ADDRS;
12176
12387
 
12177
12388
  case 29:
12178
- if (!(_i14 < _ADDRS.length)) {
12179
- _context11.next = 37;
12389
+ if (!(_i17 < _ADDRS.length)) {
12390
+ _context13.next = 37;
12180
12391
  break;
12181
12392
  }
12182
- return _context11.delegateYield(_loop2(), "t0", 31);
12393
+ return _context13.delegateYield(_loop2(), "t0", 31);
12183
12394
 
12184
12395
  case 31:
12185
- _ret2 = _context11.t0;
12396
+ _ret2 = _context13.t0;
12186
12397
  if (!_ret2) {
12187
- _context11.next = 34;
12398
+ _context13.next = 34;
12188
12399
  break;
12189
12400
  }
12190
- return _context11.abrupt("return", _ret2.v);
12401
+ return _context13.abrupt("return", _ret2.v);
12191
12402
 
12192
12403
  case 34:
12193
- _i14++;
12194
- _context11.next = 29;
12404
+ _i17++;
12405
+ _context13.next = 29;
12195
12406
  break;
12196
12407
 
12197
12408
  case 37:
12198
- return _context11.abrupt("return", 0);
12409
+ return _context13.abrupt("return", 0);
12199
12410
 
12200
12411
  case 38:
12201
- return _context11.abrupt("return", {
12412
+ return _context13.abrupt("return", {
12202
12413
  v: ERROR_MESSAGES_FLAG.INVALID_CATEGORY
12203
12414
  });
12204
12415
 
12205
12416
  case 39:
12206
12417
  case "end":
12207
- return _context11.stop();
12418
+ return _context13.stop();
12208
12419
  }
12209
12420
  }), _loop);
12210
12421
  }));
@@ -12212,52 +12423,52 @@ function _typeof(o) {
12212
12423
 
12213
12424
  case 44:
12214
12425
  if ((_step2 = _iterator2.n()).done) {
12215
- _context13.next = 53;
12426
+ _context15.next = 53;
12216
12427
  break;
12217
12428
  }
12218
- return _context13.delegateYield(_loop(), "t2", 46);
12429
+ return _context15.delegateYield(_loop(), "t2", 46);
12219
12430
 
12220
12431
  case 46:
12221
- _ret = _context13.t2;
12432
+ _ret = _context15.t2;
12222
12433
  if (!(_ret === 0)) {
12223
- _context13.next = 49;
12434
+ _context15.next = 49;
12224
12435
  break;
12225
12436
  }
12226
- return _context13.abrupt("continue", 51);
12437
+ return _context15.abrupt("continue", 51);
12227
12438
 
12228
12439
  case 49:
12229
12440
  if (!_ret) {
12230
- _context13.next = 51;
12441
+ _context15.next = 51;
12231
12442
  break;
12232
12443
  }
12233
- return _context13.abrupt("return", _ret.v);
12444
+ return _context15.abrupt("return", _ret.v);
12234
12445
 
12235
12446
  case 51:
12236
- _context13.next = 44;
12447
+ _context15.next = 44;
12237
12448
  break;
12238
12449
 
12239
12450
  case 53:
12240
- _context13.next = 58;
12451
+ _context15.next = 58;
12241
12452
  break;
12242
12453
 
12243
12454
  case 55:
12244
- _context13.prev = 55;
12245
- _context13.t3 = _context13["catch"](41);
12246
- _iterator2.e(_context13.t3);
12455
+ _context15.prev = 55;
12456
+ _context15.t3 = _context15["catch"](41);
12457
+ _iterator2.e(_context15.t3);
12247
12458
 
12248
12459
  case 58:
12249
- _context13.prev = 58;
12460
+ _context15.prev = 58;
12250
12461
  _iterator2.f();
12251
- return _context13.finish(58);
12462
+ return _context15.finish(58);
12252
12463
 
12253
12464
  case 61:
12254
- return _context13.abrupt("return", out);
12465
+ return _context15.abrupt("return", out);
12255
12466
 
12256
12467
  case 62:
12257
12468
  case "end":
12258
- return _context13.stop();
12469
+ return _context15.stop();
12259
12470
  }
12260
- }), _callee11, null, [ [ 11, 33, 36, 39 ], [ 19, 26 ], [ 41, 55, 58, 61 ] ]);
12471
+ }), _callee13, null, [ [ 11, 33, 36, 39 ], [ 19, 26 ], [ 41, 55, 58, 61 ] ]);
12261
12472
  })));
12262
12473
  return _EOA.apply(this, arguments);
12263
12474
  }
@@ -12265,11 +12476,11 @@ function _typeof(o) {
12265
12476
  return _FLVURL.apply(this, arguments);
12266
12477
  }
12267
12478
  function _FLVURL() {
12268
- _FLVURL = _asyncToGenerator(_regeneratorRuntime().mark((function _callee12(token, vs_currencies) {
12269
- return _regeneratorRuntime().wrap((function _callee12$(_context14) {
12270
- while (1) switch (_context14.prev = _context14.next) {
12479
+ _FLVURL = _asyncToGenerator(_regeneratorRuntime().mark((function _callee14(token, vs_currencies) {
12480
+ return _regeneratorRuntime().wrap((function _callee14$(_context16) {
12481
+ while (1) switch (_context16.prev = _context16.next) {
12271
12482
  case 0:
12272
- return _context14.abrupt("return", new Promise((function(resolve) {
12483
+ return _context16.abrupt("return", new Promise((function(resolve) {
12273
12484
  setTimeout((function() {
12274
12485
  resolve([ {
12275
12486
  Yoo: "gotcha"
@@ -12279,9 +12490,9 @@ function _typeof(o) {
12279
12490
 
12280
12491
  case 1:
12281
12492
  case "end":
12282
- return _context14.stop();
12493
+ return _context16.stop();
12283
12494
  }
12284
- }), _callee12);
12495
+ }), _callee14);
12285
12496
  })));
12286
12497
  return _FLVURL.apply(this, arguments);
12287
12498
  }
@@ -12289,72 +12500,72 @@ function _typeof(o) {
12289
12500
  return _SAFE.apply(this, arguments);
12290
12501
  }
12291
12502
  function _SAFE() {
12292
- _SAFE = _asyncToGenerator(_regeneratorRuntime().mark((function _callee13() {
12293
- var _argsToArray11, _argsToArray12, address, utility, chain, limit, offset, apiKey, chainIdentifier, url, response, json, _args15 = arguments;
12294
- return _regeneratorRuntime().wrap((function _callee13$(_context15) {
12295
- while (1) switch (_context15.prev = _context15.next) {
12503
+ _SAFE = _asyncToGenerator(_regeneratorRuntime().mark((function _callee15() {
12504
+ var _argsToArray15, _argsToArray16, address, utility, chain, limit, offset, apiKey, chainIdentifier, url, response, json, _args17 = arguments;
12505
+ return _regeneratorRuntime().wrap((function _callee15$(_context17) {
12506
+ while (1) switch (_context17.prev = _context17.next) {
12296
12507
  case 0:
12297
- _argsToArray11 = argsToArray(_args15), _argsToArray12 = _slicedToArray(_argsToArray11, 5),
12298
- address = _argsToArray12[0], utility = _argsToArray12[1], chain = _argsToArray12[2],
12299
- limit = _argsToArray12[3], offset = _argsToArray12[4];
12508
+ _argsToArray15 = argsToArray(_args17), _argsToArray16 = _slicedToArray(_argsToArray15, 5),
12509
+ address = _argsToArray16[0], utility = _argsToArray16[1], chain = _argsToArray16[2],
12510
+ limit = _argsToArray16[3], offset = _argsToArray16[4];
12300
12511
  if (!(typeof limit !== "number" || limit < 0)) {
12301
- _context15.next = 3;
12512
+ _context17.next = 3;
12302
12513
  break;
12303
12514
  }
12304
- return _context15.abrupt("return", "INVALID_LIMIT");
12515
+ return _context17.abrupt("return", "INVALID_LIMIT");
12305
12516
 
12306
12517
  case 3:
12307
12518
  if (!(typeof offset !== "number" || offset < 0)) {
12308
- _context15.next = 5;
12519
+ _context17.next = 5;
12309
12520
  break;
12310
12521
  }
12311
- return _context15.abrupt("return", "INVALID_OFFSET");
12522
+ return _context17.abrupt("return", "INVALID_OFFSET");
12312
12523
 
12313
12524
  case 5:
12314
12525
  if (!(utility !== "txns")) {
12315
- _context15.next = 7;
12526
+ _context17.next = 7;
12316
12527
  break;
12317
12528
  }
12318
- return _context15.abrupt("return", "UTILITY IS NOT SUPPORTED");
12529
+ return _context17.abrupt("return", "UTILITY IS NOT SUPPORTED");
12319
12530
 
12320
12531
  case 7:
12321
12532
  apiKey = window.localStorage.getItem(SERVICE_API_KEY.Safe);
12322
12533
  chainIdentifier = SAFE_CHAIN_MAP[chain];
12323
12534
  if (apiKey) {
12324
- _context15.next = 11;
12535
+ _context17.next = 11;
12325
12536
  break;
12326
12537
  }
12327
- return _context15.abrupt("return", "".concat(SERVICE_API_KEY.Safe, "_MISSING"));
12538
+ return _context17.abrupt("return", "".concat(SERVICE_API_KEY.Safe, "_MISSING"));
12328
12539
 
12329
12540
  case 11:
12330
12541
  if (chainIdentifier) {
12331
- _context15.next = 13;
12542
+ _context17.next = 13;
12332
12543
  break;
12333
12544
  }
12334
- return _context15.abrupt("return", "CHAIN IS NOT SUPPORTED");
12545
+ return _context17.abrupt("return", "CHAIN IS NOT SUPPORTED");
12335
12546
 
12336
12547
  case 13:
12337
12548
  if (isAddress(address)) {
12338
- _context15.next = 17;
12549
+ _context17.next = 17;
12339
12550
  break;
12340
12551
  }
12341
- _context15.next = 16;
12552
+ _context17.next = 16;
12342
12553
  return fromEnsNameToAddress(address);
12343
12554
 
12344
12555
  case 16:
12345
- address = _context15.sent;
12556
+ address = _context17.sent;
12346
12557
 
12347
12558
  case 17:
12348
12559
  if (address) {
12349
- _context15.next = 19;
12560
+ _context17.next = 19;
12350
12561
  break;
12351
12562
  }
12352
- return _context15.abrupt("return", "".concat(address).concat(ERROR_MESSAGES_FLAG.INVALID_PARAM));
12563
+ return _context17.abrupt("return", "".concat(address).concat(ERROR_MESSAGES_FLAG.INVALID_PARAM));
12353
12564
 
12354
12565
  case 19:
12355
12566
  url = "https://api.safe.global/tx-service/".concat(chainIdentifier, "/api/v2/safes/").concat(address, "/multisig-transactions?limit=").concat(limit, "&offset=").concat(offset);
12356
- _context15.prev = 20;
12357
- _context15.next = 23;
12567
+ _context17.prev = 20;
12568
+ _context17.next = 23;
12358
12569
  return fetch(url, {
12359
12570
  headers: {
12360
12571
  Authorization: "Bearer ".concat(apiKey)
@@ -12362,45 +12573,108 @@ function _typeof(o) {
12362
12573
  });
12363
12574
 
12364
12575
  case 23:
12365
- response = _context15.sent;
12576
+ response = _context17.sent;
12366
12577
  if (response.ok) {
12367
- _context15.next = 26;
12578
+ _context17.next = 26;
12368
12579
  break;
12369
12580
  }
12370
12581
  throw new Error("HTTP error! Status: ".concat(response.status));
12371
12582
 
12372
12583
  case 26:
12373
- _context15.next = 28;
12584
+ _context17.next = 28;
12374
12585
  return response.json();
12375
12586
 
12376
12587
  case 28:
12377
- json = _context15.sent;
12588
+ json = _context17.sent;
12378
12589
  if (Array.isArray(json.results)) {
12379
- _context15.next = 31;
12590
+ _context17.next = 31;
12380
12591
  break;
12381
12592
  }
12382
- return _context15.abrupt("return", "INVALID API RESPONSE");
12593
+ return _context17.abrupt("return", "INVALID API RESPONSE");
12383
12594
 
12384
12595
  case 31:
12385
- return _context15.abrupt("return", json.results.map((function(_ref6) {
12596
+ return _context17.abrupt("return", json.results.map((function(_ref6) {
12386
12597
  var confirmations = _ref6.confirmations, dataDecoded = _ref6.dataDecoded, rest = _objectWithoutProperties(_ref6, _excluded);
12387
12598
  return rest;
12388
12599
  })));
12389
12600
 
12390
12601
  case 34:
12391
- _context15.prev = 34;
12392
- _context15.t0 = _context15["catch"](20);
12393
- console.log(_context15.t0);
12394
- return _context15.abrupt("return", "ERROR IN FETCHING");
12602
+ _context17.prev = 34;
12603
+ _context17.t0 = _context17["catch"](20);
12604
+ console.log(_context17.t0);
12605
+ return _context17.abrupt("return", "ERROR IN FETCHING");
12395
12606
 
12396
12607
  case 38:
12397
12608
  case "end":
12398
- return _context15.stop();
12609
+ return _context17.stop();
12399
12610
  }
12400
- }), _callee13, null, [ [ 20, 34 ] ]);
12611
+ }), _callee15, null, [ [ 20, 34 ] ]);
12401
12612
  })));
12402
12613
  return _SAFE.apply(this, arguments);
12403
12614
  }
12615
+ function DEFILLAMA() {
12616
+ return _DEFILLAMA.apply(this, arguments);
12617
+ }
12618
+ function _DEFILLAMA() {
12619
+ _DEFILLAMA = _asyncToGenerator(_regeneratorRuntime().mark((function _callee16() {
12620
+ var _argsToArray17, _argsToArray18, category, param1, apiKey, baseUrl, categoryList, categoryMap, url, response, json, _args18 = arguments;
12621
+ return _regeneratorRuntime().wrap((function _callee16$(_context18) {
12622
+ while (1) switch (_context18.prev = _context18.next) {
12623
+ case 0:
12624
+ _argsToArray17 = argsToArray(_args18), _argsToArray18 = _slicedToArray(_argsToArray17, 2),
12625
+ category = _argsToArray18[0], param1 = _argsToArray18[1];
12626
+ apiKey = window.localStorage.getItem(SERVICE_API_KEY.Defillama);
12627
+ if (apiKey) {
12628
+ _context18.next = 4;
12629
+ break;
12630
+ }
12631
+ return _context18.abrupt("return", "".concat(SERVICE_API_KEY.Defillama, "_MISSING"));
12632
+
12633
+ case 4:
12634
+ baseUrl = "https://api.llama.fi/";
12635
+ categoryList = [ "protocols", "yields", "dex" ];
12636
+ categoryMap = _defineProperty(_defineProperty(_defineProperty({}, categoryList[0], "protocols"), categoryList[1], "pools"), categoryList[2], "overview/dexs?excludeTotalDataChart=true&excludeTotalDataChartBreakdown=true");
12637
+ url = "".concat(baseUrl, "/").concat(categoryMap[category]);
12638
+ if (categoryMap[category] === categoryList[0] && param1) {
12639
+ url += "/".concat(param1);
12640
+ }
12641
+ _context18.prev = 9;
12642
+ _context18.next = 12;
12643
+ return fetch(url);
12644
+
12645
+ case 12:
12646
+ response = _context18.sent;
12647
+ if (response.ok) {
12648
+ _context18.next = 15;
12649
+ break;
12650
+ }
12651
+ throw new Error("HTTP error! Status: ".concat(response.status));
12652
+
12653
+ case 15:
12654
+ _context18.next = 17;
12655
+ return response.json();
12656
+
12657
+ case 17:
12658
+ json = _context18.sent;
12659
+ if (json.length > 300) {
12660
+ json = json.slice(0, 300);
12661
+ }
12662
+ return _context18.abrupt("return", removeNestedStructure(json));
12663
+
12664
+ case 22:
12665
+ _context18.prev = 22;
12666
+ _context18.t0 = _context18["catch"](9);
12667
+ console.log(_context18.t0);
12668
+ return _context18.abrupt("return", "ERROR IN FETCHING");
12669
+
12670
+ case 26:
12671
+ case "end":
12672
+ return _context18.stop();
12673
+ }
12674
+ }), _callee16, null, [ [ 9, 22 ] ]);
12675
+ })));
12676
+ return _DEFILLAMA.apply(this, arguments);
12677
+ }
12404
12678
  function POLYMARKET() {
12405
12679
  return "Coming Soon";
12406
12680
  }
@@ -12520,6 +12794,7 @@ function _typeof(o) {
12520
12794
  exports.DEC2HEX = DEC2HEX;
12521
12795
  exports.DEC2OCT = DEC2OCT;
12522
12796
  exports.DECIMAL = DECIMAL;
12797
+ exports.DEFILLAMA = DEFILLAMA;
12523
12798
  exports.DEGREES = DEGREES;
12524
12799
  exports.DELTA = DELTA;
12525
12800
  exports.DEVSQ = DEVSQ;
@@ -12555,6 +12830,7 @@ function _typeof(o) {
12555
12830
  exports.FACT = FACT;
12556
12831
  exports.FACTDOUBLE = FACTDOUBLE;
12557
12832
  exports.FALSE = FALSE;
12833
+ exports.FARCASTER = FARCASTER;
12558
12834
  exports.FDIST = FDIST;
12559
12835
  exports.FDISTRT = FDISTRT;
12560
12836
  exports.FIND = FIND;
@@ -12646,6 +12922,7 @@ function _typeof(o) {
12646
12922
  exports.LCM = LCM;
12647
12923
  exports.LEFT = LEFT;
12648
12924
  exports.LEN = LEN;
12925
+ exports.LENS = LENS;
12649
12926
  exports.LINEST = LINEST;
12650
12927
  exports.LN = LN;
12651
12928
  exports.LOG = LOG;