@fileverse-dev/formulajs 4.4.11-mod-38 → 4.4.11-mod-39

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-38 */
1
+ /* @fileverse-dev/formulajs v4.4.11-mod-39 */
2
2
  var _excluded = [ "confirmations", "dataDecoded" ];
3
3
 
4
4
  function _objectWithoutProperties(e, t) {
@@ -11211,24 +11211,26 @@ function _typeof(o) {
11211
11211
  })));
11212
11212
  return _handleScanRequest.apply(this, arguments);
11213
11213
  }
11214
- function FIREFLY() {
11214
+ function FIREFLY(_x6, _x7, _x8) {
11215
11215
  return _FIREFLY.apply(this, arguments);
11216
11216
  }
11217
11217
  function _FIREFLY() {
11218
- _FIREFLY = _asyncToGenerator(_regeneratorRuntime().mark((function _callee4() {
11218
+ _FIREFLY = _asyncToGenerator(_regeneratorRuntime().mark((function _callee4(platform, contentType, identifier) {
11219
11219
  var _typeMap$platform;
11220
- var API_KEY, baseUrl, headers, typeMap, _argsToArray3, _argsToArray4, platform, contentType, identifier, _argsToArray4$, start, _argsToArray4$2, end, platformType, query, url, res, json, _args4 = arguments;
11220
+ var start, end, API_KEY, baseUrl, headers, typeMap, platformType, query, url, res, json, _args4 = arguments;
11221
11221
  return _regeneratorRuntime().wrap((function _callee4$(_context4) {
11222
11222
  while (1) switch (_context4.prev = _context4.next) {
11223
11223
  case 0:
11224
+ start = _args4.length > 3 && _args4[3] !== undefined ? _args4[3] : 0;
11225
+ end = _args4.length > 4 && _args4[4] !== undefined ? _args4[4] : 10;
11224
11226
  API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Firefly);
11225
11227
  if (API_KEY) {
11226
- _context4.next = 3;
11228
+ _context4.next = 5;
11227
11229
  break;
11228
11230
  }
11229
11231
  return _context4.abrupt("return", "".concat(SERVICE_API_KEY.Firefly).concat(ERROR_MESSAGES_FLAG.MISSING_KEY));
11230
11232
 
11231
- case 3:
11233
+ case 5:
11232
11234
  baseUrl = "https://openapi.firefly.land/v1/fileverse/fetch";
11233
11235
  headers = {
11234
11236
  "x-api-key": API_KEY
@@ -11244,18 +11246,14 @@ function _typeof(o) {
11244
11246
  replies: "lenspostid"
11245
11247
  }
11246
11248
  };
11247
- _argsToArray3 = argsToArray(_args4), _argsToArray4 = _slicedToArray(_argsToArray3, 5),
11248
- platform = _argsToArray4[0], contentType = _argsToArray4[1], identifier = _argsToArray4[2],
11249
- _argsToArray4$ = _argsToArray4[3], start = _argsToArray4$ === void 0 ? 0 : _argsToArray4$,
11250
- _argsToArray4$2 = _argsToArray4[4], end = _argsToArray4$2 === void 0 ? 10 : _argsToArray4$2;
11251
11249
  platformType = (_typeMap$platform = typeMap[platform]) === null || _typeMap$platform === void 0 ? void 0 : _typeMap$platform[contentType];
11252
11250
  if (platformType) {
11253
- _context4.next = 10;
11251
+ _context4.next = 11;
11254
11252
  break;
11255
11253
  }
11256
11254
  return _context4.abrupt("return", "".concat(SERVICE_API_KEY.Firefly).concat(ERROR_MESSAGES_FLAG.INVALID_TYPE));
11257
11255
 
11258
- case 10:
11256
+ case 11:
11259
11257
  query = identifier.split(",").map((function(s) {
11260
11258
  return s.trim();
11261
11259
  })).filter(Boolean).join(",");
@@ -11264,33 +11262,33 @@ function _typeof(o) {
11264
11262
  url.searchParams.set("type", platformType);
11265
11263
  url.searchParams.set("start", String(start));
11266
11264
  url.searchParams.set("end", String(end));
11267
- _context4.prev = 16;
11268
- _context4.next = 19;
11265
+ _context4.prev = 17;
11266
+ _context4.next = 20;
11269
11267
  return fetch(url.toString(), {
11270
11268
  headers: headers
11271
11269
  });
11272
11270
 
11273
- case 19:
11271
+ case 20:
11274
11272
  res = _context4.sent;
11275
11273
  if (res.ok) {
11276
- _context4.next = 22;
11274
+ _context4.next = 23;
11277
11275
  break;
11278
11276
  }
11279
11277
  throw new Error("HTTP ".concat(res.status));
11280
11278
 
11281
- case 22:
11282
- _context4.next = 24;
11279
+ case 23:
11280
+ _context4.next = 25;
11283
11281
  return res.json();
11284
11282
 
11285
- case 24:
11283
+ case 25:
11286
11284
  json = _context4.sent;
11287
11285
  if (Array.isArray(json === null || json === void 0 ? void 0 : json.data)) {
11288
- _context4.next = 27;
11286
+ _context4.next = 28;
11289
11287
  break;
11290
11288
  }
11291
11289
  return _context4.abrupt("return", []);
11292
11290
 
11293
- case 27:
11291
+ case 28:
11294
11292
  return _context4.abrupt("return", json.data.map((function(item) {
11295
11293
  var flat = {};
11296
11294
  for (var _i10 = 0, _Object$entries = Object.entries(item); _i10 < _Object$entries.length; _i10++) {
@@ -11303,26 +11301,26 @@ function _typeof(o) {
11303
11301
  return flat;
11304
11302
  })));
11305
11303
 
11306
- case 30:
11307
- _context4.prev = 30;
11308
- _context4.t0 = _context4["catch"](16);
11304
+ case 31:
11305
+ _context4.prev = 31;
11306
+ _context4.t0 = _context4["catch"](17);
11309
11307
  console.error("FIREFLY fetch error:", _context4.t0);
11310
11308
  return _context4.abrupt("return", ERROR_MESSAGES_FLAG.DEFAULT);
11311
11309
 
11312
- case 34:
11310
+ case 35:
11313
11311
  case "end":
11314
11312
  return _context4.stop();
11315
11313
  }
11316
- }), _callee4, null, [ [ 16, 30 ] ]);
11314
+ }), _callee4, null, [ [ 17, 31 ] ]);
11317
11315
  })));
11318
11316
  return _FIREFLY.apply(this, arguments);
11319
11317
  }
11320
- function BLOCKSCOUT() {
11318
+ function BLOCKSCOUT(_x9, _x0, _x1, _x10, _x11, _x12, _x13) {
11321
11319
  return _BLOCKSCOUT.apply(this, arguments);
11322
11320
  }
11323
11321
  function _BLOCKSCOUT() {
11324
- _BLOCKSCOUT = _asyncToGenerator(_regeneratorRuntime().mark((function _callee5() {
11325
- var _argsToArray5, _argsToArray6, address, type, chain, startTimestamp, endTimestamp, page, offset, currentTimestamp, hostname, requestUrl, _json$result, _json$result2, response, json, _args5 = arguments;
11322
+ _BLOCKSCOUT = _asyncToGenerator(_regeneratorRuntime().mark((function _callee5(address, type, chain, startTimestamp, endTimestamp, page, offset) {
11323
+ var currentTimestamp, hostname, requestUrl, _json$result, _json$result2, response, json;
11326
11324
  return _regeneratorRuntime().wrap((function _callee5$(_context5) {
11327
11325
  while (1) switch (_context5.prev = _context5.next) {
11328
11326
  case 0:
@@ -11336,9 +11334,6 @@ function _typeof(o) {
11336
11334
  return _context5.abrupt("return", "TYPE_MISSING");
11337
11335
 
11338
11336
  case 3:
11339
- _argsToArray5 = argsToArray(_args5), _argsToArray6 = _slicedToArray(_argsToArray5, 7),
11340
- address = _argsToArray6[0], type = _argsToArray6[1], chain = _argsToArray6[2], startTimestamp = _argsToArray6[3],
11341
- endTimestamp = _argsToArray6[4], page = _argsToArray6[5], offset = _argsToArray6[6];
11342
11337
  if (!startTimestamp) {
11343
11338
  currentTimestamp = Date.now();
11344
11339
  startTimestamp = currentTimestamp - 30 * 24 * 60 * 60 * 1e3;
@@ -11351,96 +11346,96 @@ function _typeof(o) {
11351
11346
  endTimestamp = toTimestamp(endTimestamp);
11352
11347
  }
11353
11348
  if (isAddress(address)) {
11354
- _context5.next = 11;
11349
+ _context5.next = 10;
11355
11350
  break;
11356
11351
  }
11357
- _context5.next = 10;
11352
+ _context5.next = 9;
11358
11353
  return fromEnsNameToAddress(address);
11359
11354
 
11360
- case 10:
11355
+ case 9:
11361
11356
  address = _context5.sent;
11362
11357
 
11363
- case 11:
11358
+ case 10:
11364
11359
  if (address) {
11365
- _context5.next = 13;
11360
+ _context5.next = 12;
11366
11361
  break;
11367
11362
  }
11368
11363
  return _context5.abrupt("return", "".concat(address).concat(ERROR_MESSAGES_FLAG.INVALID_PARAM));
11369
11364
 
11370
- case 13:
11365
+ case 12:
11371
11366
  hostname = BLOCKSCOUT_CHAINS_MAP[chain];
11372
11367
  _context5.t0 = type;
11373
- _context5.next = _context5.t0 === "stat" ? 17 : _context5.t0 === "txns" ? 19 : _context5.t0 === "tokens" ? 21 : 23;
11368
+ _context5.next = _context5.t0 === "stat" ? 16 : _context5.t0 === "txns" ? 18 : _context5.t0 === "tokens" ? 20 : 22;
11374
11369
  break;
11375
11370
 
11376
- case 17:
11371
+ case 16:
11377
11372
  requestUrl = "".concat(hostname, "/api/v2/addresses/").concat(address, "/counters");
11378
- return _context5.abrupt("break", 24);
11373
+ return _context5.abrupt("break", 23);
11379
11374
 
11380
- case 19:
11375
+ case 18:
11381
11376
  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");
11382
- return _context5.abrupt("break", 24);
11377
+ return _context5.abrupt("break", 23);
11383
11378
 
11384
- case 21:
11379
+ case 20:
11385
11380
  requestUrl = "".concat(hostname, "/api?module=account&action=tokenlist&address=").concat(address);
11386
- return _context5.abrupt("break", 24);
11381
+ return _context5.abrupt("break", 23);
11387
11382
 
11388
- case 23:
11383
+ case 22:
11389
11384
  return _context5.abrupt("return", "INVALID_TYPE");
11390
11385
 
11391
- case 24:
11392
- _context5.prev = 24;
11393
- _context5.next = 27;
11386
+ case 23:
11387
+ _context5.prev = 23;
11388
+ _context5.next = 26;
11394
11389
  return fetch(requestUrl);
11395
11390
 
11396
- case 27:
11391
+ case 26:
11397
11392
  response = _context5.sent;
11398
11393
  if (response.ok) {
11399
- _context5.next = 30;
11394
+ _context5.next = 29;
11400
11395
  break;
11401
11396
  }
11402
11397
  throw new Error("HTTP error! Status: ".concat(response.status));
11403
11398
 
11404
- case 30:
11405
- _context5.next = 32;
11399
+ case 29:
11400
+ _context5.next = 31;
11406
11401
  return response.json();
11407
11402
 
11408
- case 32:
11403
+ case 31:
11409
11404
  json = _context5.sent;
11410
11405
  console.log(json);
11411
11406
  if (!(json !== null && json !== void 0 && (_json$result = json.result) !== null && _json$result !== void 0 && _json$result.includes("Invalid parameter(s)"))) {
11412
- _context5.next = 36;
11407
+ _context5.next = 35;
11413
11408
  break;
11414
11409
  }
11415
11410
  return _context5.abrupt("return", "INVALID_REQUEST_PARAMS");
11416
11411
 
11417
- case 36:
11412
+ case 35:
11418
11413
  if (!(json !== null && json !== void 0 && (_json$result2 = json.result) !== null && _json$result2 !== void 0 && _json$result2.includes("Not found"))) {
11419
- _context5.next = 38;
11414
+ _context5.next = 37;
11420
11415
  break;
11421
11416
  }
11422
11417
  return _context5.abrupt("return", "ADDRESS_NOT_FOUND");
11423
11418
 
11424
- case 38:
11419
+ case 37:
11425
11420
  if (!(type === "stat")) {
11426
- _context5.next = 40;
11421
+ _context5.next = 39;
11427
11422
  break;
11428
11423
  }
11429
11424
  return _context5.abrupt("return", [ json ]);
11430
11425
 
11431
- case 40:
11426
+ case 39:
11432
11427
  return _context5.abrupt("return", json.result);
11433
11428
 
11434
- case 43:
11435
- _context5.prev = 43;
11436
- _context5.t1 = _context5["catch"](24);
11429
+ case 42:
11430
+ _context5.prev = 42;
11431
+ _context5.t1 = _context5["catch"](23);
11437
11432
  return _context5.abrupt("return", "ERROR IN FETCHING");
11438
11433
 
11439
- case 46:
11434
+ case 45:
11440
11435
  case "end":
11441
11436
  return _context5.stop();
11442
11437
  }
11443
- }), _callee5, null, [ [ 24, 43 ] ]);
11438
+ }), _callee5, null, [ [ 23, 42 ] ]);
11444
11439
  })));
11445
11440
  return _BLOCKSCOUT.apply(this, arguments);
11446
11441
  }
@@ -11449,13 +11444,15 @@ function _typeof(o) {
11449
11444
  }
11450
11445
  function _BASESCAN() {
11451
11446
  _BASESCAN = _asyncToGenerator(_regeneratorRuntime().mark((function _callee6() {
11452
- var _argsToArray7, _argsToArray8, type, chain, address, startDate, endDate, page, limit, _args6 = arguments;
11447
+ var _len2, args, _key2, type, chain, address, startDate, endDate, page, limit, _args6 = arguments;
11453
11448
  return _regeneratorRuntime().wrap((function _callee6$(_context6) {
11454
11449
  while (1) switch (_context6.prev = _context6.next) {
11455
11450
  case 0:
11456
- _argsToArray7 = argsToArray(_args6), _argsToArray8 = _slicedToArray(_argsToArray7, 7),
11457
- type = _argsToArray8[0], chain = _argsToArray8[1], address = _argsToArray8[2], startDate = _argsToArray8[3],
11458
- endDate = _argsToArray8[4], page = _argsToArray8[5], limit = _argsToArray8[6];
11451
+ for (_len2 = _args6.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
11452
+ args[_key2] = _args6[_key2];
11453
+ }
11454
+ type = args[0], chain = args[1], address = args[2], startDate = args[3], endDate = args[4],
11455
+ page = args[5], limit = args[6];
11459
11456
  return _context6.abrupt("return", handleScanRequest({
11460
11457
  scanKey: SERVICE_API_KEY.Basescan,
11461
11458
  baseUrl: "https://api.basescan.org/api",
@@ -11468,7 +11465,7 @@ function _typeof(o) {
11468
11465
  offset: limit
11469
11466
  }));
11470
11467
 
11471
- case 2:
11468
+ case 3:
11472
11469
  case "end":
11473
11470
  return _context6.stop();
11474
11471
  }
@@ -11481,13 +11478,15 @@ function _typeof(o) {
11481
11478
  }
11482
11479
  function _GNOSISSCAN() {
11483
11480
  _GNOSISSCAN = _asyncToGenerator(_regeneratorRuntime().mark((function _callee7() {
11484
- var _argsToArray9, _argsToArray0, type, chain, address, startDate, endDate, page, limit, _args7 = arguments;
11481
+ var _len3, args, _key3, type, chain, address, startDate, endDate, page, limit, _args7 = arguments;
11485
11482
  return _regeneratorRuntime().wrap((function _callee7$(_context7) {
11486
11483
  while (1) switch (_context7.prev = _context7.next) {
11487
11484
  case 0:
11488
- _argsToArray9 = argsToArray(_args7), _argsToArray0 = _slicedToArray(_argsToArray9, 7),
11489
- type = _argsToArray0[0], chain = _argsToArray0[1], address = _argsToArray0[2], startDate = _argsToArray0[3],
11490
- endDate = _argsToArray0[4], page = _argsToArray0[5], limit = _argsToArray0[6];
11485
+ for (_len3 = _args7.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
11486
+ args[_key3] = _args7[_key3];
11487
+ }
11488
+ type = args[0], chain = args[1], address = args[2], startDate = args[3], endDate = args[4],
11489
+ page = args[5], limit = args[6];
11491
11490
  return _context7.abrupt("return", handleScanRequest({
11492
11491
  scanKey: SERVICE_API_KEY.Gnosisscan,
11493
11492
  baseUrl: "https://api.gnosisscan.io/api",
@@ -11500,7 +11499,7 @@ function _typeof(o) {
11500
11499
  offset: limit
11501
11500
  }));
11502
11501
 
11503
- case 2:
11502
+ case 3:
11504
11503
  case "end":
11505
11504
  return _context7.stop();
11506
11505
  }
@@ -11508,12 +11507,12 @@ function _typeof(o) {
11508
11507
  })));
11509
11508
  return _GNOSISSCAN.apply(this, arguments);
11510
11509
  }
11511
- function NEYNAR() {
11510
+ function NEYNAR(_x14, _x15, _x16, _x17, _x18) {
11512
11511
  return _NEYNAR.apply(this, arguments);
11513
11512
  }
11514
11513
  function _NEYNAR() {
11515
- _NEYNAR = _asyncToGenerator(_regeneratorRuntime().mark((function _callee8() {
11516
- var API_KEY, _argsToArray1, _argsToArray10, fid, viewerFid, sortType, limit, cursor, url, _json$users, response, json, _args8 = arguments;
11514
+ _NEYNAR = _asyncToGenerator(_regeneratorRuntime().mark((function _callee8(fid, viewerFid, sortType, limit, cursor) {
11515
+ var API_KEY, url, _json$users, response, json;
11517
11516
  return _regeneratorRuntime().wrap((function _callee8$(_context8) {
11518
11517
  while (1) switch (_context8.prev = _context8.next) {
11519
11518
  case 0:
@@ -11525,17 +11524,14 @@ function _typeof(o) {
11525
11524
  return _context8.abrupt("return", "".concat(SERVICE_API_KEY.Neynar).concat(ERROR_MESSAGES_FLAG.MISSING_KEY));
11526
11525
 
11527
11526
  case 3:
11528
- _argsToArray1 = argsToArray(_args8), _argsToArray10 = _slicedToArray(_argsToArray1, 5),
11529
- fid = _argsToArray10[0], viewerFid = _argsToArray10[1], sortType = _argsToArray10[2],
11530
- limit = _argsToArray10[3], cursor = _argsToArray10[4];
11531
11527
  url = new URL("https://api.neynar.com/v2/farcaster/followers");
11532
11528
  url.searchParams.set("fid", fid.toString());
11533
11529
  url.searchParams.set("sort_type", sortType);
11534
11530
  url.searchParams.set("limit", limit.toString());
11535
11531
  if (viewerFid !== null) url.searchParams.set("viewer_fid", viewerFid.toString());
11536
11532
  if (cursor) url.searchParams.set("cursor", cursor);
11537
- _context8.prev = 10;
11538
- _context8.next = 13;
11533
+ _context8.prev = 9;
11534
+ _context8.next = 12;
11539
11535
  return fetch(url.toString(), {
11540
11536
  headers: {
11541
11537
  "x-api-key": API_KEY,
@@ -11543,30 +11539,30 @@ function _typeof(o) {
11543
11539
  }
11544
11540
  });
11545
11541
 
11546
- case 13:
11542
+ case 12:
11547
11543
  response = _context8.sent;
11548
11544
  if (response.ok) {
11549
- _context8.next = 16;
11545
+ _context8.next = 15;
11550
11546
  break;
11551
11547
  }
11552
11548
  throw new Error("HTTP ".concat(response.status));
11553
11549
 
11554
- case 16:
11555
- _context8.next = 18;
11550
+ case 15:
11551
+ _context8.next = 17;
11556
11552
  return response.json();
11557
11553
 
11558
- case 18:
11554
+ case 17:
11559
11555
  json = _context8.sent;
11560
11556
  if (json !== null && json !== void 0 && (_json$users = json.users) !== null && _json$users !== void 0 && _json$users.length) {
11561
- _context8.next = 21;
11557
+ _context8.next = 20;
11562
11558
  break;
11563
11559
  }
11564
11560
  return _context8.abrupt("return", []);
11565
11561
 
11566
- case 21:
11567
- return _context8.abrupt("return", json.users.map((function(_ref3) {
11562
+ case 20:
11563
+ return _context8.abrupt("return", json.users.map((function(_ref4) {
11568
11564
  var _user$profile, _user$profile2;
11569
- var user = _ref3.user;
11565
+ var user = _ref4.user;
11570
11566
  return {
11571
11567
  username: user.username,
11572
11568
  custody_address: user.custody_address,
@@ -11576,49 +11572,48 @@ function _typeof(o) {
11576
11572
  };
11577
11573
  })));
11578
11574
 
11579
- case 24:
11580
- _context8.prev = 24;
11581
- _context8.t0 = _context8["catch"](10);
11575
+ case 23:
11576
+ _context8.prev = 23;
11577
+ _context8.t0 = _context8["catch"](9);
11582
11578
  console.error("NEYNAR_FETCH_FOLLOWERS error:", _context8.t0);
11583
11579
  return _context8.abrupt("return", ERROR_MESSAGES_FLAG.DEFAULT);
11584
11580
 
11585
- case 28:
11581
+ case 27:
11586
11582
  case "end":
11587
11583
  return _context8.stop();
11588
11584
  }
11589
- }), _callee8, null, [ [ 10, 24 ] ]);
11585
+ }), _callee8, null, [ [ 9, 23 ] ]);
11590
11586
  })));
11591
11587
  return _NEYNAR.apply(this, arguments);
11592
11588
  }
11593
- function GNOSISPAY() {
11589
+ function GNOSISPAY(_x19) {
11594
11590
  return _GNOSISPAY.apply(this, arguments);
11595
11591
  }
11596
11592
  function _GNOSISPAY() {
11597
- _GNOSISPAY = _asyncToGenerator(_regeneratorRuntime().mark((function _callee9() {
11598
- var apiKeyKey, API_KEY, _argsToArray11, _argsToArray12, cardId, startDate, endDate, _argsToArray12$, limit, _argsToArray12$2, offset, url, res, json, _args9 = arguments;
11593
+ _GNOSISPAY = _asyncToGenerator(_regeneratorRuntime().mark((function _callee9(_ref3) {
11594
+ var cardId, startDate, endDate, _ref3$limit, limit, _ref3$offset, offset, apiKeyKey, API_KEY, url, res, json;
11599
11595
  return _regeneratorRuntime().wrap((function _callee9$(_context9) {
11600
11596
  while (1) switch (_context9.prev = _context9.next) {
11601
11597
  case 0:
11598
+ cardId = _ref3.cardId, startDate = _ref3.startDate, endDate = _ref3.endDate, _ref3$limit = _ref3.limit,
11599
+ limit = _ref3$limit === void 0 ? 20 : _ref3$limit, _ref3$offset = _ref3.offset,
11600
+ offset = _ref3$offset === void 0 ? 0 : _ref3$offset;
11602
11601
  apiKeyKey = SERVICE_API_KEY.GnosisPay;
11603
11602
  API_KEY = window.localStorage.getItem(apiKeyKey);
11604
11603
  if (API_KEY) {
11605
- _context9.next = 4;
11604
+ _context9.next = 5;
11606
11605
  break;
11607
11606
  }
11608
11607
  return _context9.abrupt("return", "".concat(apiKeyKey).concat(ERROR_MESSAGES_FLAG.MISSING_KEY));
11609
11608
 
11610
- case 4:
11609
+ case 5:
11611
11610
  if (cardId) {
11612
- _context9.next = 6;
11611
+ _context9.next = 7;
11613
11612
  break;
11614
11613
  }
11615
11614
  return _context9.abrupt("return", "".concat(apiKeyKey).concat(ERROR_MESSAGES_FLAG.INVALID_PARAM));
11616
11615
 
11617
- case 6:
11618
- _argsToArray11 = argsToArray(_args9), _argsToArray12 = _slicedToArray(_argsToArray11, 5),
11619
- cardId = _argsToArray12[0], startDate = _argsToArray12[1], endDate = _argsToArray12[2],
11620
- _argsToArray12$ = _argsToArray12[3], limit = _argsToArray12$ === void 0 ? 20 : _argsToArray12$,
11621
- _argsToArray12$2 = _argsToArray12[4], offset = _argsToArray12$2 === void 0 ? 0 : _argsToArray12$2;
11616
+ case 7:
11622
11617
  url = new URL("https://api.gnosispay.com/cards/".concat(cardId, "/transactions"));
11623
11618
  url.searchParams.set("limit", limit.toString());
11624
11619
  url.searchParams.set("offset", offset.toString());
@@ -11694,14 +11689,15 @@ function _typeof(o) {
11694
11689
  }
11695
11690
  function _ETHERSCAN() {
11696
11691
  _ETHERSCAN = _asyncToGenerator(_regeneratorRuntime().mark((function _callee0() {
11697
- var _argsToArray13, _argsToArray14, type, chain, address, startDate, endDate, page, limit, _args0 = arguments;
11692
+ var _len4, args, _key4, type, chain, address, startDate, endDate, page, limit, _args0 = arguments;
11698
11693
  return _regeneratorRuntime().wrap((function _callee0$(_context0) {
11699
11694
  while (1) switch (_context0.prev = _context0.next) {
11700
11695
  case 0:
11701
- _argsToArray13 = argsToArray(_args0), _argsToArray14 = _slicedToArray(_argsToArray13, 7),
11702
- type = _argsToArray14[0], chain = _argsToArray14[1], address = _argsToArray14[2],
11703
- startDate = _argsToArray14[3], endDate = _argsToArray14[4], page = _argsToArray14[5],
11704
- limit = _argsToArray14[6];
11696
+ for (_len4 = _args0.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
11697
+ args[_key4] = _args0[_key4];
11698
+ }
11699
+ type = args[0], chain = args[1], address = args[2], startDate = args[3], endDate = args[4],
11700
+ page = args[5], limit = args[6];
11705
11701
  return _context0.abrupt("return", handleScanRequest({
11706
11702
  scanKey: SERVICE_API_KEY.Etherscan,
11707
11703
  baseUrl: "https://api.etherscan.io/v2/api",
@@ -11714,7 +11710,7 @@ function _typeof(o) {
11714
11710
  offset: limit
11715
11711
  }));
11716
11712
 
11717
- case 2:
11713
+ case 3:
11718
11714
  case "end":
11719
11715
  return _context0.stop();
11720
11716
  }
@@ -11722,51 +11718,49 @@ function _typeof(o) {
11722
11718
  })));
11723
11719
  return _ETHERSCAN.apply(this, arguments);
11724
11720
  }
11725
- function COINGECKO() {
11721
+ function COINGECKO(_x20, _x21, _x22) {
11726
11722
  return _COINGECKO.apply(this, arguments);
11727
11723
  }
11728
11724
  function _COINGECKO() {
11729
- _COINGECKO = _asyncToGenerator(_regeneratorRuntime().mark((function _callee1() {
11730
- var API_KEY, headers, url, _argsToArray15, _argsToArray16, category, param1, param2, _argsToArray16$, page, _argsToArray16$2, perPage, 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, _key2, flatArray, _args1 = arguments;
11725
+ _COINGECKO = _asyncToGenerator(_regeneratorRuntime().mark((function _callee1(category, param1, param2) {
11726
+ var page, perPage, 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, _key5, flatArray, _args1 = arguments;
11731
11727
  return _regeneratorRuntime().wrap((function _callee1$(_context1) {
11732
11728
  while (1) switch (_context1.prev = _context1.next) {
11733
11729
  case 0:
11730
+ page = _args1.length > 3 && _args1[3] !== undefined ? _args1[3] : 1;
11731
+ perPage = _args1.length > 4 && _args1[4] !== undefined ? _args1[4] : 2;
11734
11732
  API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Coingecko);
11735
11733
  if (API_KEY) {
11736
- _context1.next = 3;
11734
+ _context1.next = 5;
11737
11735
  break;
11738
11736
  }
11739
11737
  return _context1.abrupt("return", "".concat(SERVICE_API_KEY.Coingecko).concat(ERROR_MESSAGES_FLAG.MISSING_KEY));
11740
11738
 
11741
- case 3:
11739
+ case 5:
11742
11740
  headers = {
11743
11741
  accept: "application/json",
11744
11742
  "x-cg-demo-api-key": API_KEY
11745
11743
  };
11746
11744
  url = "";
11747
- _argsToArray15 = argsToArray(_args1), _argsToArray16 = _slicedToArray(_argsToArray15, 5),
11748
- category = _argsToArray16[0], param1 = _argsToArray16[1], param2 = _argsToArray16[2],
11749
- _argsToArray16$ = _argsToArray16[3], page = _argsToArray16$ === void 0 ? 1 : _argsToArray16$,
11750
- _argsToArray16$2 = _argsToArray16[4], perPage = _argsToArray16$2 === void 0 ? 2 : _argsToArray16$2;
11751
11745
  lowerCategory = (category || "").toLowerCase();
11752
11746
  _context1.t0 = lowerCategory;
11753
- _context1.next = _context1.t0 === "price" ? 10 : _context1.t0 === "market" ? 16 : _context1.t0 === "stablecoins" ? 26 : _context1.t0 === "derivatives" ? 30 : 33;
11747
+ _context1.next = _context1.t0 === "price" ? 11 : _context1.t0 === "market" ? 17 : _context1.t0 === "stablecoins" ? 27 : _context1.t0 === "derivatives" ? 31 : 34;
11754
11748
  break;
11755
11749
 
11756
- case 10:
11750
+ case 11:
11757
11751
  token = param1;
11758
11752
  vsCurrencies = param2;
11759
11753
  if (!(!token || !vsCurrencies)) {
11760
- _context1.next = 14;
11754
+ _context1.next = 15;
11761
11755
  break;
11762
11756
  }
11763
11757
  return _context1.abrupt("return", "".concat(SERVICE_API_KEY.Coingecko).concat(ERROR_MESSAGES_FLAG.INVALID_PARAM));
11764
11758
 
11765
- case 14:
11759
+ case 15:
11766
11760
  url = "https://api.coingecko.com/api/v3/simple/price?vs_currencies=".concat(vsCurrencies, "&ids=").concat(token);
11767
- return _context1.abrupt("break", 34);
11761
+ return _context1.abrupt("break", 35);
11768
11762
 
11769
- case 16:
11763
+ case 17:
11770
11764
  ecosystemMap = {
11771
11765
  eth: "ethereum-ecosystem",
11772
11766
  base: "base-ecosystem",
@@ -11783,70 +11777,70 @@ function _typeof(o) {
11783
11777
  trend = param2 ? "&price_change_percentage=".concat(param2) : "";
11784
11778
  url = "https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&include_tokens=top&page=".concat(page, "&per_page=").concat(perPage);
11785
11779
  if (!(key && !categoryVal)) {
11786
- _context1.next = 23;
11780
+ _context1.next = 24;
11787
11781
  break;
11788
11782
  }
11789
11783
  return _context1.abrupt("return", "".concat(SERVICE_API_KEY.Coingecko).concat(ERROR_MESSAGES_FLAG.INVALID_PARAM));
11790
11784
 
11791
- case 23:
11785
+ case 24:
11792
11786
  if (categoryVal) url += "&category=".concat(categoryVal);
11793
11787
  if (trend) url += trend;
11794
- return _context1.abrupt("break", 34);
11788
+ return _context1.abrupt("break", 35);
11795
11789
 
11796
- case 26:
11790
+ case 27:
11797
11791
  _category = !param1 || param1.toLowerCase() === "all" ? "stablecoins" : param1.toLowerCase();
11798
11792
  _trend = param2 ? "&price_change_percentage=".concat(param2) : "";
11799
11793
  url = "https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&category=".concat(_category, "&order=market_cap_desc&page=").concat(page, "&per_page=").concat(perPage).concat(_trend);
11800
- return _context1.abrupt("break", 34);
11794
+ return _context1.abrupt("break", 35);
11801
11795
 
11802
- case 30:
11796
+ case 31:
11803
11797
  exchange = param1;
11804
11798
  if (exchange) {
11805
11799
  url = "https://api.coingecko.com/api/v3/derivatives/exchanges/".concat(exchange, "?include_tickers=all");
11806
11800
  } else {
11807
11801
  url = "https://api.coingecko.com/api/v3/derivatives?page=".concat(page, "&per_page=").concat(perPage);
11808
11802
  }
11809
- return _context1.abrupt("break", 34);
11803
+ return _context1.abrupt("break", 35);
11810
11804
 
11811
- case 33:
11805
+ case 34:
11812
11806
  return _context1.abrupt("return", "".concat(SERVICE_API_KEY.Coingecko).concat(ERROR_MESSAGES_FLAG.INVALID_PARAMS));
11813
11807
 
11814
- case 34:
11815
- _context1.prev = 34;
11816
- _context1.next = 37;
11808
+ case 35:
11809
+ _context1.prev = 35;
11810
+ _context1.next = 38;
11817
11811
  return fetch(url, {
11818
11812
  method: "GET",
11819
11813
  headers: headers
11820
11814
  });
11821
11815
 
11822
- case 37:
11816
+ case 38:
11823
11817
  response = _context1.sent;
11824
- _context1.next = 40;
11818
+ _context1.next = 41;
11825
11819
  return response.json();
11826
11820
 
11827
- case 40:
11821
+ case 41:
11828
11822
  json = _context1.sent;
11829
11823
  if (response.ok) {
11830
- _context1.next = 47;
11824
+ _context1.next = 48;
11831
11825
  break;
11832
11826
  }
11833
11827
  message = (json === null || json === void 0 || (_json$status = json.status) === null || _json$status === void 0 ? void 0 : _json$status.error_message) || "";
11834
11828
  if (!message.includes("API Key Missing")) {
11835
- _context1.next = 45;
11829
+ _context1.next = 46;
11836
11830
  break;
11837
11831
  }
11838
11832
  return _context1.abrupt("return", "".concat(SERVICE_API_KEY.Coingecko).concat(ERROR_MESSAGES_FLAG.INVALID_API_KEY));
11839
11833
 
11840
- case 45:
11834
+ case 46:
11841
11835
  if (!(response.status === 429)) {
11842
- _context1.next = 47;
11836
+ _context1.next = 48;
11843
11837
  break;
11844
11838
  }
11845
11839
  return _context1.abrupt("return", "".concat(SERVICE_API_KEY.Coingecko).concat(ERROR_MESSAGES_FLAG.RATE_LIMIT));
11846
11840
 
11847
- case 47:
11841
+ case 48:
11848
11842
  if (!(lowerCategory === "price")) {
11849
- _context1.next = 51;
11843
+ _context1.next = 52;
11850
11844
  break;
11851
11845
  }
11852
11846
  output = {};
@@ -11856,45 +11850,45 @@ function _typeof(o) {
11856
11850
  for (_i12 = 0, _Object$entries3 = Object.entries(prices); _i12 < _Object$entries3.length; _i12++) {
11857
11851
  _Object$entries3$_i = _slicedToArray(_Object$entries3[_i12], 2), currency = _Object$entries3$_i[0],
11858
11852
  _value6 = _Object$entries3$_i[1];
11859
- _key2 = "".concat(_token.charAt(0).toUpperCase() + _token.slice(1), "_").concat(currency.toUpperCase());
11860
- output[_key2] = _value6;
11853
+ _key5 = "".concat(_token.charAt(0).toUpperCase() + _token.slice(1), "_").concat(currency.toUpperCase());
11854
+ output[_key5] = _value6;
11861
11855
  }
11862
11856
  }
11863
11857
  return _context1.abrupt("return", [ output ]);
11864
11858
 
11865
- case 51:
11859
+ case 52:
11866
11860
  flatArray = Array.isArray(json) ? json : [ json ];
11867
11861
  return _context1.abrupt("return", flatArray.map((function(item) {
11868
11862
  var flat = {};
11869
11863
  for (var _i13 = 0, _Object$entries4 = Object.entries(item); _i13 < _Object$entries4.length; _i13++) {
11870
- var _Object$entries4$_i = _slicedToArray(_Object$entries4[_i13], 2), _key3 = _Object$entries4$_i[0], _value7 = _Object$entries4$_i[1];
11864
+ var _Object$entries4$_i = _slicedToArray(_Object$entries4[_i13], 2), _key6 = _Object$entries4$_i[0], _value7 = _Object$entries4$_i[1];
11871
11865
  if (_typeof(_value7) !== "object" || _value7 === null) {
11872
- flat[_key3] = _value7;
11866
+ flat[_key6] = _value7;
11873
11867
  }
11874
11868
  }
11875
11869
  return flat;
11876
11870
  })));
11877
11871
 
11878
- case 55:
11879
- _context1.prev = 55;
11880
- _context1.t1 = _context1["catch"](34);
11872
+ case 56:
11873
+ _context1.prev = 56;
11874
+ _context1.t1 = _context1["catch"](35);
11881
11875
  console.error(_context1.t1);
11882
11876
  return _context1.abrupt("return", ERROR_MESSAGES_FLAG.DEFAULT);
11883
11877
 
11884
- case 59:
11878
+ case 60:
11885
11879
  case "end":
11886
11880
  return _context1.stop();
11887
11881
  }
11888
- }), _callee1, null, [ [ 34, 55 ] ]);
11882
+ }), _callee1, null, [ [ 35, 56 ] ]);
11889
11883
  })));
11890
11884
  return _COINGECKO.apply(this, arguments);
11891
11885
  }
11892
- function EOA() {
11886
+ function EOA(_x23, _x24, _x25, _x26, _x27) {
11893
11887
  return _EOA.apply(this, arguments);
11894
11888
  }
11895
11889
  function _EOA() {
11896
- _EOA = _asyncToGenerator(_regeneratorRuntime().mark((function _callee11() {
11897
- var _argsToArray17, _argsToArray18, addresses, category, chains, startTime, endTime, _argsToArray18$, page, _argsToArray18$2, offset, someError, API_KEY, INPUTS, CHAINS, out, ADDRESS_MAP, _iterator, _step, input, resolved, ADDRS, _iterator2, _step2, _loop, _ret, fetchJSON, _fetchJSON, _args13 = arguments;
11890
+ _EOA = _asyncToGenerator(_regeneratorRuntime().mark((function _callee11(addresses, category, chains, startTime, endTime) {
11891
+ var page, offset, API_KEY, INPUTS, CHAINS, out, ADDRESS_MAP, _iterator, _step, input, resolved, ADDRS, _iterator2, _step2, _loop, _ret, fetchJSON, _fetchJSON, _args13 = arguments;
11898
11892
  return _regeneratorRuntime().wrap((function _callee11$(_context13) {
11899
11893
  while (1) switch (_context13.prev = _context13.next) {
11900
11894
  case 0:
@@ -11958,98 +11952,83 @@ function _typeof(o) {
11958
11952
  })));
11959
11953
  return _fetchJSON.apply(this, arguments);
11960
11954
  };
11961
- fetchJSON = function _fetchJSON2(_x8) {
11955
+ fetchJSON = function _fetchJSON2(_x35) {
11962
11956
  return _fetchJSON.apply(this, arguments);
11963
11957
  };
11964
- _argsToArray17 = argsToArray(_args13), _argsToArray18 = _slicedToArray(_argsToArray17, 7),
11965
- addresses = _argsToArray18[0], category = _argsToArray18[1], chains = _argsToArray18[2],
11966
- startTime = _argsToArray18[3], endTime = _argsToArray18[4], _argsToArray18$ = _argsToArray18[5],
11967
- page = _argsToArray18$ === void 0 ? 1 : _argsToArray18$, _argsToArray18$2 = _argsToArray18[6],
11968
- offset = _argsToArray18$2 === void 0 ? 10 : _argsToArray18$2;
11969
- someError = anyError(addresses, category, chains, startTime, endTime, page, offset);
11970
- if (!someError) {
11971
- _context13.next = 6;
11972
- break;
11973
- }
11974
- return _context13.abrupt("return", someError);
11975
-
11976
- case 6:
11958
+ page = _args13.length > 5 && _args13[5] !== undefined ? _args13[5] : 1;
11959
+ offset = _args13.length > 6 && _args13[6] !== undefined ? _args13[6] : 10;
11977
11960
  API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Etherscan);
11978
11961
  if (API_KEY) {
11979
- _context13.next = 9;
11962
+ _context13.next = 7;
11980
11963
  break;
11981
11964
  }
11982
11965
  return _context13.abrupt("return", "".concat(SERVICE_API_KEY.Etherscan).concat(ERROR_MESSAGES_FLAG.MISSING_KEY));
11983
11966
 
11984
- case 9:
11985
- if (typeof addresses === "string") {
11986
- INPUTS = addresses.split(",").map((function(a) {
11987
- return a.trim();
11988
- })).filter(Boolean);
11989
- } else if (_typeof(addresses) === "object") {
11990
- INPUTS = addresses;
11991
- }
11967
+ case 7:
11968
+ INPUTS = addresses.split(",").map((function(a) {
11969
+ return a.trim();
11970
+ })).filter(Boolean);
11992
11971
  CHAINS = chains.split(",").map((function(c) {
11993
11972
  return c.trim();
11994
11973
  })).filter(Boolean);
11995
11974
  out = [];
11996
11975
  ADDRESS_MAP = {};
11997
11976
  _iterator = _createForOfIteratorHelper(INPUTS);
11998
- _context13.prev = 14;
11977
+ _context13.prev = 12;
11999
11978
  _iterator.s();
12000
11979
 
12001
- case 16:
11980
+ case 14:
12002
11981
  if ((_step = _iterator.n()).done) {
12003
- _context13.next = 34;
11982
+ _context13.next = 32;
12004
11983
  break;
12005
11984
  }
12006
11985
  input = _step.value;
12007
11986
  if (!isAddress(input)) {
12008
- _context13.next = 22;
11987
+ _context13.next = 20;
12009
11988
  break;
12010
11989
  }
12011
11990
  ADDRESS_MAP[input.toLowerCase()] = null;
12012
- _context13.next = 32;
11991
+ _context13.next = 30;
12013
11992
  break;
12014
11993
 
12015
- case 22:
12016
- _context13.prev = 22;
12017
- _context13.next = 25;
11994
+ case 20:
11995
+ _context13.prev = 20;
11996
+ _context13.next = 23;
12018
11997
  return fromEnsNameToAddress(input);
12019
11998
 
12020
- case 25:
11999
+ case 23:
12021
12000
  resolved = _context13.sent;
12022
12001
  if (resolved) ADDRESS_MAP[resolved.toLowerCase()] = input;
12023
- _context13.next = 32;
12002
+ _context13.next = 30;
12024
12003
  break;
12025
12004
 
12026
- case 29:
12027
- _context13.prev = 29;
12028
- _context13.t0 = _context13["catch"](22);
12005
+ case 27:
12006
+ _context13.prev = 27;
12007
+ _context13.t0 = _context13["catch"](20);
12029
12008
  return _context13.abrupt("return", "".concat(input).concat(ERROR_MESSAGES_FLAG.INVALID_PARAM));
12030
12009
 
12031
- case 32:
12032
- _context13.next = 16;
12010
+ case 30:
12011
+ _context13.next = 14;
12033
12012
  break;
12034
12013
 
12035
- case 34:
12036
- _context13.next = 39;
12014
+ case 32:
12015
+ _context13.next = 37;
12037
12016
  break;
12038
12017
 
12039
- case 36:
12040
- _context13.prev = 36;
12041
- _context13.t1 = _context13["catch"](14);
12018
+ case 34:
12019
+ _context13.prev = 34;
12020
+ _context13.t1 = _context13["catch"](12);
12042
12021
  _iterator.e(_context13.t1);
12043
12022
 
12044
- case 39:
12045
- _context13.prev = 39;
12023
+ case 37:
12024
+ _context13.prev = 37;
12046
12025
  _iterator.f();
12047
- return _context13.finish(39);
12026
+ return _context13.finish(37);
12048
12027
 
12049
- case 42:
12028
+ case 40:
12050
12029
  ADDRS = Object.keys(ADDRESS_MAP);
12051
12030
  _iterator2 = _createForOfIteratorHelper(CHAINS);
12052
- _context13.prev = 44;
12031
+ _context13.prev = 42;
12053
12032
  _loop = _regeneratorRuntime().mark((function _loop() {
12054
12033
  var chain, chainId, i, slice, action, url, _data, startBlock, endBlock, _loop2, _ret2, _i14, _ADDRS;
12055
12034
  return _regeneratorRuntime().wrap((function _loop$(_context11) {
@@ -12200,58 +12179,58 @@ function _typeof(o) {
12200
12179
  }));
12201
12180
  _iterator2.s();
12202
12181
 
12203
- case 47:
12182
+ case 45:
12204
12183
  if ((_step2 = _iterator2.n()).done) {
12205
- _context13.next = 56;
12184
+ _context13.next = 54;
12206
12185
  break;
12207
12186
  }
12208
- return _context13.delegateYield(_loop(), "t2", 49);
12187
+ return _context13.delegateYield(_loop(), "t2", 47);
12209
12188
 
12210
- case 49:
12189
+ case 47:
12211
12190
  _ret = _context13.t2;
12212
12191
  if (!(_ret === 0)) {
12213
- _context13.next = 52;
12192
+ _context13.next = 50;
12214
12193
  break;
12215
12194
  }
12216
- return _context13.abrupt("continue", 54);
12195
+ return _context13.abrupt("continue", 52);
12217
12196
 
12218
- case 52:
12197
+ case 50:
12219
12198
  if (!_ret) {
12220
- _context13.next = 54;
12199
+ _context13.next = 52;
12221
12200
  break;
12222
12201
  }
12223
12202
  return _context13.abrupt("return", _ret.v);
12224
12203
 
12225
- case 54:
12226
- _context13.next = 47;
12204
+ case 52:
12205
+ _context13.next = 45;
12227
12206
  break;
12228
12207
 
12229
- case 56:
12230
- _context13.next = 61;
12208
+ case 54:
12209
+ _context13.next = 59;
12231
12210
  break;
12232
12211
 
12233
- case 58:
12234
- _context13.prev = 58;
12235
- _context13.t3 = _context13["catch"](44);
12212
+ case 56:
12213
+ _context13.prev = 56;
12214
+ _context13.t3 = _context13["catch"](42);
12236
12215
  _iterator2.e(_context13.t3);
12237
12216
 
12238
- case 61:
12239
- _context13.prev = 61;
12217
+ case 59:
12218
+ _context13.prev = 59;
12240
12219
  _iterator2.f();
12241
- return _context13.finish(61);
12220
+ return _context13.finish(59);
12242
12221
 
12243
- case 64:
12222
+ case 62:
12244
12223
  return _context13.abrupt("return", out);
12245
12224
 
12246
- case 65:
12225
+ case 63:
12247
12226
  case "end":
12248
12227
  return _context13.stop();
12249
12228
  }
12250
- }), _callee11, null, [ [ 14, 36, 39, 42 ], [ 22, 29 ], [ 44, 58, 61, 64 ] ]);
12229
+ }), _callee11, null, [ [ 12, 34, 37, 40 ], [ 20, 27 ], [ 42, 56, 59, 62 ] ]);
12251
12230
  })));
12252
12231
  return _EOA.apply(this, arguments);
12253
12232
  }
12254
- function FLVURL(_x6, _x7) {
12233
+ function FLVURL(_x28, _x29) {
12255
12234
  return _FLVURL.apply(this, arguments);
12256
12235
  }
12257
12236
  function _FLVURL() {
@@ -12275,119 +12254,116 @@ function _typeof(o) {
12275
12254
  })));
12276
12255
  return _FLVURL.apply(this, arguments);
12277
12256
  }
12278
- function SAFE() {
12257
+ function SAFE(_x30, _x31, _x32, _x33, _x34) {
12279
12258
  return _SAFE.apply(this, arguments);
12280
12259
  }
12281
12260
  function _SAFE() {
12282
- _SAFE = _asyncToGenerator(_regeneratorRuntime().mark((function _callee13() {
12283
- var _argsToArray19, _argsToArray20, address, utility, chain, limit, offset, apiKey, chainIdentifier, url, response, json, _args15 = arguments;
12261
+ _SAFE = _asyncToGenerator(_regeneratorRuntime().mark((function _callee13(address, utility, chain, limit, offset) {
12262
+ var apiKey, chainIdentifier, url, response, json;
12284
12263
  return _regeneratorRuntime().wrap((function _callee13$(_context15) {
12285
12264
  while (1) switch (_context15.prev = _context15.next) {
12286
12265
  case 0:
12287
- _argsToArray19 = argsToArray(_args15), _argsToArray20 = _slicedToArray(_argsToArray19, 5),
12288
- address = _argsToArray20[0], utility = _argsToArray20[1], chain = _argsToArray20[2],
12289
- limit = _argsToArray20[3], offset = _argsToArray20[4];
12290
12266
  if (!(typeof limit !== "number" || limit < 0)) {
12291
- _context15.next = 3;
12267
+ _context15.next = 2;
12292
12268
  break;
12293
12269
  }
12294
12270
  return _context15.abrupt("return", "INVALID_LIMIT");
12295
12271
 
12296
- case 3:
12272
+ case 2:
12297
12273
  if (!(typeof offset !== "number" || offset < 0)) {
12298
- _context15.next = 5;
12274
+ _context15.next = 4;
12299
12275
  break;
12300
12276
  }
12301
12277
  return _context15.abrupt("return", "INVALID_OFFSET");
12302
12278
 
12303
- case 5:
12279
+ case 4:
12304
12280
  if (!(utility !== "txns")) {
12305
- _context15.next = 7;
12281
+ _context15.next = 6;
12306
12282
  break;
12307
12283
  }
12308
12284
  return _context15.abrupt("return", "UTILITY IS NOT SUPPORTED");
12309
12285
 
12310
- case 7:
12286
+ case 6:
12311
12287
  apiKey = window.localStorage.getItem(SERVICE_API_KEY.Safe);
12312
12288
  chainIdentifier = SAFE_CHAIN_MAP[chain];
12313
12289
  if (apiKey) {
12314
- _context15.next = 11;
12290
+ _context15.next = 10;
12315
12291
  break;
12316
12292
  }
12317
12293
  return _context15.abrupt("return", "".concat(SERVICE_API_KEY.Safe, "_MISSING"));
12318
12294
 
12319
- case 11:
12295
+ case 10:
12320
12296
  if (chainIdentifier) {
12321
- _context15.next = 13;
12297
+ _context15.next = 12;
12322
12298
  break;
12323
12299
  }
12324
12300
  return _context15.abrupt("return", "CHAIN IS NOT SUPPORTED");
12325
12301
 
12326
- case 13:
12302
+ case 12:
12327
12303
  if (isAddress(address)) {
12328
- _context15.next = 17;
12304
+ _context15.next = 16;
12329
12305
  break;
12330
12306
  }
12331
- _context15.next = 16;
12307
+ _context15.next = 15;
12332
12308
  return fromEnsNameToAddress(address);
12333
12309
 
12334
- case 16:
12310
+ case 15:
12335
12311
  address = _context15.sent;
12336
12312
 
12337
- case 17:
12313
+ case 16:
12338
12314
  if (address) {
12339
- _context15.next = 19;
12315
+ _context15.next = 18;
12340
12316
  break;
12341
12317
  }
12342
12318
  return _context15.abrupt("return", "".concat(address).concat(ERROR_MESSAGES_FLAG.INVALID_PARAM));
12343
12319
 
12344
- case 19:
12320
+ case 18:
12345
12321
  url = "https://api.safe.global/tx-service/".concat(chainIdentifier, "/api/v2/safes/").concat(address, "/multisig-transactions?limit=").concat(limit, "&offset=").concat(offset);
12346
- _context15.prev = 20;
12347
- _context15.next = 23;
12322
+ _context15.prev = 19;
12323
+ _context15.next = 22;
12348
12324
  return fetch(url, {
12349
12325
  headers: {
12350
12326
  Authorization: "Bearer ".concat(apiKey)
12351
12327
  }
12352
12328
  });
12353
12329
 
12354
- case 23:
12330
+ case 22:
12355
12331
  response = _context15.sent;
12356
12332
  if (response.ok) {
12357
- _context15.next = 26;
12333
+ _context15.next = 25;
12358
12334
  break;
12359
12335
  }
12360
12336
  throw new Error("HTTP error! Status: ".concat(response.status));
12361
12337
 
12362
- case 26:
12363
- _context15.next = 28;
12338
+ case 25:
12339
+ _context15.next = 27;
12364
12340
  return response.json();
12365
12341
 
12366
- case 28:
12342
+ case 27:
12367
12343
  json = _context15.sent;
12368
12344
  if (Array.isArray(json.results)) {
12369
- _context15.next = 31;
12345
+ _context15.next = 30;
12370
12346
  break;
12371
12347
  }
12372
12348
  return _context15.abrupt("return", "INVALID API RESPONSE");
12373
12349
 
12374
- case 31:
12375
- return _context15.abrupt("return", json.results.map((function(_ref4) {
12376
- var confirmations = _ref4.confirmations, dataDecoded = _ref4.dataDecoded, rest = _objectWithoutProperties(_ref4, _excluded);
12350
+ case 30:
12351
+ return _context15.abrupt("return", json.results.map((function(_ref5) {
12352
+ var confirmations = _ref5.confirmations, dataDecoded = _ref5.dataDecoded, rest = _objectWithoutProperties(_ref5, _excluded);
12377
12353
  return rest;
12378
12354
  })));
12379
12355
 
12380
- case 34:
12381
- _context15.prev = 34;
12382
- _context15.t0 = _context15["catch"](20);
12356
+ case 33:
12357
+ _context15.prev = 33;
12358
+ _context15.t0 = _context15["catch"](19);
12383
12359
  console.log(_context15.t0);
12384
12360
  return _context15.abrupt("return", "ERROR IN FETCHING");
12385
12361
 
12386
- case 38:
12362
+ case 37:
12387
12363
  case "end":
12388
12364
  return _context15.stop();
12389
12365
  }
12390
- }), _callee13, null, [ [ 20, 34 ] ]);
12366
+ }), _callee13, null, [ [ 19, 33 ] ]);
12391
12367
  })));
12392
12368
  return _SAFE.apply(this, arguments);
12393
12369
  }