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

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