@fileverse-dev/formulajs 4.4.11-mod-22-patch-5 → 4.4.11-mod-23-patch-1

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-22-patch-5 */
1
+ /* @fileverse-dev/formulajs v4.4.11-mod-23-patch-1 */
2
2
  var _excluded = [ "confirmations", "dataDecoded" ];
3
3
 
4
4
  function _objectWithoutProperties(e, t) {
@@ -21,6 +21,100 @@ function _objectWithoutPropertiesLoose(r, e) {
21
21
  return t;
22
22
  }
23
23
 
24
+ function ownKeys(e, r) {
25
+ var t = Object.keys(e);
26
+ if (Object.getOwnPropertySymbols) {
27
+ var o = Object.getOwnPropertySymbols(e);
28
+ r && (o = o.filter((function(r) {
29
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
30
+ }))), t.push.apply(t, o);
31
+ }
32
+ return t;
33
+ }
34
+
35
+ function _objectSpread(e) {
36
+ for (var r = 1; r < arguments.length; r++) {
37
+ var t = null != arguments[r] ? arguments[r] : {};
38
+ r % 2 ? ownKeys(Object(t), !0).forEach((function(r) {
39
+ _defineProperty(e, r, t[r]);
40
+ })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach((function(r) {
41
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
42
+ }));
43
+ }
44
+ return e;
45
+ }
46
+
47
+ function _defineProperty(e, r, t) {
48
+ return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
49
+ value: t,
50
+ enumerable: !0,
51
+ configurable: !0,
52
+ writable: !0
53
+ }) : e[r] = t, e;
54
+ }
55
+
56
+ function _toPropertyKey(t) {
57
+ var i = _toPrimitive(t, "string");
58
+ return "symbol" == _typeof(i) ? i : i + "";
59
+ }
60
+
61
+ function _toPrimitive(t, r) {
62
+ if ("object" != _typeof(t) || !t) return t;
63
+ var e = t[Symbol.toPrimitive];
64
+ if (void 0 !== e) {
65
+ var i = e.call(t, r || "default");
66
+ if ("object" != _typeof(i)) return i;
67
+ throw new TypeError("@@toPrimitive must return a primitive value.");
68
+ }
69
+ return ("string" === r ? String : Number)(t);
70
+ }
71
+
72
+ function _createForOfIteratorHelper(r, e) {
73
+ var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
74
+ if (!t) {
75
+ if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
76
+ t && (r = t);
77
+ var _n = 0, F = function F() {};
78
+ return {
79
+ s: F,
80
+ n: function n() {
81
+ return _n >= r.length ? {
82
+ done: !0
83
+ } : {
84
+ done: !1,
85
+ value: r[_n++]
86
+ };
87
+ },
88
+ e: function e(r) {
89
+ throw r;
90
+ },
91
+ f: F
92
+ };
93
+ }
94
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
95
+ }
96
+ var o, a = !0, u = !1;
97
+ return {
98
+ s: function s() {
99
+ t = t.call(r);
100
+ },
101
+ n: function n() {
102
+ var r = t.next();
103
+ return a = r.done, r;
104
+ },
105
+ e: function e(r) {
106
+ u = !0, o = r;
107
+ },
108
+ f: function f() {
109
+ try {
110
+ a || null == t["return"] || t["return"]();
111
+ } finally {
112
+ if (u) throw o;
113
+ }
114
+ }
115
+ };
116
+ }
117
+
24
118
  function _regeneratorRuntime() {
25
119
  "use strict";
26
120
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() {
@@ -10847,12 +10941,19 @@ function _typeof(o) {
10847
10941
  INVALID_API_KEY: "_INVALID_KEY",
10848
10942
  RATE_LIMIT: "_RATE_LIMIT_REACHED",
10849
10943
  DEFAULT: "FETCH_ERROR",
10850
- MISSING_KEY: "_MISSING"
10944
+ MISSING_KEY: "_MISSING",
10945
+ INVALID_CHAIN: "_INVALID_CHAIN",
10946
+ INVALID_TYPE: "_INVALID_TYPE",
10947
+ INVALID_ADDRESS: "_INVALID_ADDRESS",
10948
+ INVALID_PARAM: "_INVALID_PARAM"
10851
10949
  };
10852
10950
  var SERVICE_API_KEY = {
10853
10951
  Etherscan: "ETHERSCAN_API_KEY",
10854
10952
  Coingecko: "COINGECKO_API_KEY",
10855
- Safe: "SAFE_API_KEY"
10953
+ Safe: "SAFE_API_KEY",
10954
+ Basescan: "BASESCAN_API_KEY",
10955
+ Gnosisscan: "GNOSIS_API_KEY",
10956
+ Firefly: "FIRE_FLY_API_KEY"
10856
10957
  };
10857
10958
  var fromTimeStampToBlock = function() {
10858
10959
  var _ref = _asyncToGenerator(_regeneratorRuntime().mark((function _callee(timestamp, chain, apiKey) {
@@ -10891,23 +10992,291 @@ function _typeof(o) {
10891
10992
  return _ref.apply(this, arguments);
10892
10993
  };
10893
10994
  }();
10894
- function BLOCKSCOUT(_x4, _x5, _x6, _x7, _x8, _x9, _x0) {
10995
+ function handleScanRequest(_x4) {
10996
+ return _handleScanRequest.apply(this, arguments);
10997
+ }
10998
+ function _handleScanRequest() {
10999
+ _handleScanRequest = _asyncToGenerator(_regeneratorRuntime().mark((function _callee2(_ref2) {
11000
+ var scanKey, baseUrl, type, chain, address, startDate, endDate, API_KEY, chainId, ACTION_MAP, action, url, _yield$Promise$all, _yield$Promise$all2, startBlock, endBlock, res, json;
11001
+ return _regeneratorRuntime().wrap((function _callee2$(_context2) {
11002
+ while (1) switch (_context2.prev = _context2.next) {
11003
+ case 0:
11004
+ scanKey = _ref2.scanKey, baseUrl = _ref2.baseUrl, type = _ref2.type, chain = _ref2.chain,
11005
+ address = _ref2.address, startDate = _ref2.startDate, endDate = _ref2.endDate;
11006
+ API_KEY = window.localStorage.getItem(scanKey);
11007
+ if (API_KEY) {
11008
+ _context2.next = 4;
11009
+ break;
11010
+ }
11011
+ return _context2.abrupt("return", "".concat(scanKey).concat(ERROR_MESSAGES_FLAG.MISSING_KEY));
11012
+
11013
+ case 4:
11014
+ if (!(API_KEY === "xxxx")) {
11015
+ _context2.next = 6;
11016
+ break;
11017
+ }
11018
+ return _context2.abrupt("return", "".concat(scanKey).concat(ERROR_MESSAGES_FLAG.RATE_LIMIT));
11019
+
11020
+ case 6:
11021
+ chainId = CHAIN_ID_MAP[chain === null || chain === void 0 ? void 0 : chain.toLowerCase()];
11022
+ if (chainId) {
11023
+ _context2.next = 9;
11024
+ break;
11025
+ }
11026
+ return _context2.abrupt("return", "".concat(scanKey).concat(ERROR_MESSAGES_FLAG.INVALID_CHAIN));
11027
+
11028
+ case 9:
11029
+ ACTION_MAP = {
11030
+ "all-txns": "txlist",
11031
+ "token-txns": "tokentx",
11032
+ "nft-txns": "tokennfttx",
11033
+ gas: "gastracker"
11034
+ };
11035
+ action = ACTION_MAP[type];
11036
+ if (action) {
11037
+ _context2.next = 13;
11038
+ break;
11039
+ }
11040
+ return _context2.abrupt("return", "".concat(scanKey).concat(ERROR_MESSAGES_FLAG.INVALID_TYPE));
11041
+
11042
+ case 13:
11043
+ url = "".concat(baseUrl, "?chainid=").concat(chainId, "&module=account&action=").concat(action, "&apikey=").concat(API_KEY);
11044
+ if (![ "all-txns", "token-txns", "nft-txns" ].includes(type)) {
11045
+ _context2.next = 26;
11046
+ break;
11047
+ }
11048
+ if (address) {
11049
+ _context2.next = 17;
11050
+ break;
11051
+ }
11052
+ return _context2.abrupt("return", "".concat(scanKey).concat(ERROR_MESSAGES_FLAG.INVALID_ADDRESS));
11053
+
11054
+ case 17:
11055
+ url += "&address=".concat(address, "&startblock=0&endblock=99999999&sort=asc");
11056
+ if (!(!isNaN(startDate) && !isNaN(endDate))) {
11057
+ _context2.next = 26;
11058
+ break;
11059
+ }
11060
+ _context2.next = 21;
11061
+ return Promise.all([ fromTimeStampToBlock(startDate, chain, API_KEY), fromTimeStampToBlock(endDate, chain, API_KEY) ]);
11062
+
11063
+ case 21:
11064
+ _yield$Promise$all = _context2.sent;
11065
+ _yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 2);
11066
+ startBlock = _yield$Promise$all2[0];
11067
+ endBlock = _yield$Promise$all2[1];
11068
+ url += "&startblock=".concat(startBlock, "&endblock=").concat(endBlock);
11069
+
11070
+ case 26:
11071
+ _context2.prev = 26;
11072
+ _context2.next = 29;
11073
+ return fetch(url);
11074
+
11075
+ case 29:
11076
+ res = _context2.sent;
11077
+ if (res.ok) {
11078
+ _context2.next = 32;
11079
+ break;
11080
+ }
11081
+ throw new Error("HTTP error: ".concat(res.status));
11082
+
11083
+ case 32:
11084
+ _context2.next = 34;
11085
+ return res.json();
11086
+
11087
+ case 34:
11088
+ json = _context2.sent;
11089
+ if (!(typeof json.result === "string")) {
11090
+ _context2.next = 40;
11091
+ break;
11092
+ }
11093
+ if (!json.result.includes("Invalid API Key")) {
11094
+ _context2.next = 38;
11095
+ break;
11096
+ }
11097
+ return _context2.abrupt("return", "".concat(scanKey).concat(ERROR_MESSAGES_FLAG.INVALID_API_KEY));
11098
+
11099
+ case 38:
11100
+ if (!json.result.includes("Max rate limit reached")) {
11101
+ _context2.next = 40;
11102
+ break;
11103
+ }
11104
+ return _context2.abrupt("return", "".concat(scanKey).concat(ERROR_MESSAGES_FLAG.RATE_LIMIT));
11105
+
11106
+ case 40:
11107
+ return _context2.abrupt("return", json.result);
11108
+
11109
+ case 43:
11110
+ _context2.prev = 43;
11111
+ _context2.t0 = _context2["catch"](26);
11112
+ console.error("[".concat(scanKey, "]"), _context2.t0);
11113
+ return _context2.abrupt("return", ERROR_MESSAGES_FLAG.DEFAULT);
11114
+
11115
+ case 47:
11116
+ case "end":
11117
+ return _context2.stop();
11118
+ }
11119
+ }), _callee2, null, [ [ 26, 43 ] ]);
11120
+ })));
11121
+ return _handleScanRequest.apply(this, arguments);
11122
+ }
11123
+ function FIREFLY(_x5, _x6, _x7) {
11124
+ return _FIREFLY.apply(this, arguments);
11125
+ }
11126
+ function _FIREFLY() {
11127
+ _FIREFLY = _asyncToGenerator(_regeneratorRuntime().mark((function _callee3(platform, contentType, identifier) {
11128
+ var API_KEY, baseUrl, headers, query, type, normalizedId, url, res, json, flattened;
11129
+ return _regeneratorRuntime().wrap((function _callee3$(_context3) {
11130
+ while (1) switch (_context3.prev = _context3.next) {
11131
+ case 0:
11132
+ API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Firefly);
11133
+ if (API_KEY) {
11134
+ _context3.next = 3;
11135
+ break;
11136
+ }
11137
+ return _context3.abrupt("return", "".concat(SERVICE_API_KEY.Firefly).concat(ERROR_MESSAGES_FLAG.MISSING_KEY));
11138
+
11139
+ case 3:
11140
+ baseUrl = "https://openapi.firefly.land/v1/fileverse/fetch";
11141
+ headers = {
11142
+ "x-api-key": API_KEY
11143
+ };
11144
+ query = "";
11145
+ type = "";
11146
+ normalizedId = identifier.trim().replace(/.*\/([^\/]+)$/, "$1");
11147
+ if (!(platform === "farcaster")) {
11148
+ _context3.next = 22;
11149
+ break;
11150
+ }
11151
+ if (!(contentType === "posts")) {
11152
+ _context3.next = 14;
11153
+ break;
11154
+ }
11155
+ type = "farcasterid";
11156
+ query = normalizedId;
11157
+ _context3.next = 20;
11158
+ break;
11159
+
11160
+ case 14:
11161
+ if (!(contentType === "replies")) {
11162
+ _context3.next = 19;
11163
+ break;
11164
+ }
11165
+ type = "farcasterpostid";
11166
+ query = normalizedId.startsWith("0x") ? normalizedId : Number(normalizedId).toString();
11167
+ _context3.next = 20;
11168
+ break;
11169
+
11170
+ case 19:
11171
+ return _context3.abrupt("return", "".concat(SERVICE_API_KEY.Firefly).concat(ERROR_MESSAGES_FLAG.INVALID_TYPE));
11172
+
11173
+ case 20:
11174
+ _context3.next = 37;
11175
+ break;
11176
+
11177
+ case 22:
11178
+ if (!(platform === "lens")) {
11179
+ _context3.next = 36;
11180
+ break;
11181
+ }
11182
+ if (!(contentType === "posts")) {
11183
+ _context3.next = 28;
11184
+ break;
11185
+ }
11186
+ type = "lensid";
11187
+ query = normalizedId;
11188
+ _context3.next = 34;
11189
+ break;
11190
+
11191
+ case 28:
11192
+ if (!(contentType === "replies")) {
11193
+ _context3.next = 33;
11194
+ break;
11195
+ }
11196
+ type = "lenspostid";
11197
+ query = normalizedId;
11198
+ _context3.next = 34;
11199
+ break;
11200
+
11201
+ case 33:
11202
+ return _context3.abrupt("return", "".concat(SERVICE_API_KEY.Firefly).concat(ERROR_MESSAGES_FLAG.INVALID_TYPE));
11203
+
11204
+ case 34:
11205
+ _context3.next = 37;
11206
+ break;
11207
+
11208
+ case 36:
11209
+ return _context3.abrupt("return", "".concat(SERVICE_API_KEY.Firefly).concat(ERROR_MESSAGES_FLAG.INVALID_PARAM));
11210
+
11211
+ case 37:
11212
+ url = new URL(baseUrl);
11213
+ url.searchParams.set("query", query);
11214
+ url.searchParams.set("type", type);
11215
+ url.searchParams.set("size", "10");
11216
+ url.searchParams.set("cursor", "0");
11217
+ _context3.prev = 42;
11218
+ _context3.next = 45;
11219
+ return fetch(url.toString(), {
11220
+ headers: headers
11221
+ });
11222
+
11223
+ case 45:
11224
+ res = _context3.sent;
11225
+ if (res.ok) {
11226
+ _context3.next = 48;
11227
+ break;
11228
+ }
11229
+ throw new Error("HTTP ".concat(res.status));
11230
+
11231
+ case 48:
11232
+ _context3.next = 50;
11233
+ return res.json();
11234
+
11235
+ case 50:
11236
+ json = _context3.sent;
11237
+ flattened = Array.isArray(json === null || json === void 0 ? void 0 : json.data) ? json.data.map((function(item) {
11238
+ var _item$author, _item$author2, _item$metadata;
11239
+ return {
11240
+ id: (item === null || item === void 0 ? void 0 : item.id) || null,
11241
+ author: (item === null || item === void 0 || (_item$author = item.author) === null || _item$author === void 0 ? void 0 : _item$author.username) || (item === null || item === void 0 || (_item$author2 = item.author) === null || _item$author2 === void 0 ? void 0 : _item$author2.handle) || "",
11242
+ text: (item === null || item === void 0 ? void 0 : item.text) || (item === null || item === void 0 || (_item$metadata = item.metadata) === null || _item$metadata === void 0 || (_item$metadata = _item$metadata.content) === null || _item$metadata === void 0 ? void 0 : _item$metadata.content) || "",
11243
+ createdAt: (item === null || item === void 0 ? void 0 : item.createdAt) || "",
11244
+ platform: platform
11245
+ };
11246
+ })) : [];
11247
+ return _context3.abrupt("return", flattened);
11248
+
11249
+ case 55:
11250
+ _context3.prev = 55;
11251
+ _context3.t0 = _context3["catch"](42);
11252
+ console.error("FIREFLY fetch error:", _context3.t0);
11253
+ return _context3.abrupt("return", ERROR_MESSAGES_FLAG.DEFAULT);
11254
+
11255
+ case 59:
11256
+ case "end":
11257
+ return _context3.stop();
11258
+ }
11259
+ }), _callee3, null, [ [ 42, 55 ] ]);
11260
+ })));
11261
+ return _FIREFLY.apply(this, arguments);
11262
+ }
11263
+ function BLOCKSCOUT(_x8, _x9, _x0, _x1, _x10, _x11, _x12) {
10895
11264
  return _BLOCKSCOUT.apply(this, arguments);
10896
11265
  }
10897
11266
  function _BLOCKSCOUT() {
10898
- _BLOCKSCOUT = _asyncToGenerator(_regeneratorRuntime().mark((function _callee2(address, type, chain, startTimestamp, endTimestamp, page, offset) {
11267
+ _BLOCKSCOUT = _asyncToGenerator(_regeneratorRuntime().mark((function _callee4(address, type, chain, startTimestamp, endTimestamp, page, offset) {
10899
11268
  var currentTimestamp, hostname, requestUrl, _json$result, _json$result2, response, json;
10900
- return _regeneratorRuntime().wrap((function _callee2$(_context2) {
10901
- while (1) switch (_context2.prev = _context2.next) {
11269
+ return _regeneratorRuntime().wrap((function _callee4$(_context4) {
11270
+ while (1) switch (_context4.prev = _context4.next) {
10902
11271
  case 0:
10903
11272
  if (!chain) {
10904
11273
  chain = "ethereum";
10905
11274
  }
10906
11275
  if (type) {
10907
- _context2.next = 3;
11276
+ _context4.next = 3;
10908
11277
  break;
10909
11278
  }
10910
- return _context2.abrupt("return", "TYPE_MISSING");
11279
+ return _context4.abrupt("return", "TYPE_MISSING");
10911
11280
 
10912
11281
  case 3:
10913
11282
  if (!startTimestamp) {
@@ -10916,161 +11285,359 @@ function _typeof(o) {
10916
11285
  startTimestamp = Math.floor(startTimestamp / 1e3);
10917
11286
  }
10918
11287
  hostname = BLOCKSCOUT_CHAINS_MAP[chain];
10919
- _context2.t0 = type;
10920
- _context2.next = _context2.t0 === "stat" ? 8 : _context2.t0 === "txns" ? 10 : _context2.t0 === "tokens" ? 12 : 14;
11288
+ _context4.t0 = type;
11289
+ _context4.next = _context4.t0 === "stat" ? 8 : _context4.t0 === "txns" ? 10 : _context4.t0 === "tokens" ? 12 : 14;
10921
11290
  break;
10922
11291
 
10923
11292
  case 8:
10924
11293
  requestUrl = "".concat(hostname, "/api/v2/addresses/").concat(address, "/counters");
10925
- return _context2.abrupt("break", 15);
11294
+ return _context4.abrupt("break", 15);
10926
11295
 
10927
11296
  case 10:
10928
11297
  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");
10929
- return _context2.abrupt("break", 15);
11298
+ return _context4.abrupt("break", 15);
10930
11299
 
10931
11300
  case 12:
10932
11301
  requestUrl = "".concat(hostname, "/api?module=account&action=tokenlist&address=").concat(address);
10933
- return _context2.abrupt("break", 15);
11302
+ return _context4.abrupt("break", 15);
10934
11303
 
10935
11304
  case 14:
10936
- return _context2.abrupt("return", "INVALID_TYPE");
11305
+ return _context4.abrupt("return", "INVALID_TYPE");
10937
11306
 
10938
11307
  case 15:
10939
- _context2.prev = 15;
10940
- _context2.next = 18;
11308
+ _context4.prev = 15;
11309
+ _context4.next = 18;
10941
11310
  return fetch(requestUrl);
10942
11311
 
10943
11312
  case 18:
10944
- response = _context2.sent;
11313
+ response = _context4.sent;
10945
11314
  if (response.ok) {
10946
- _context2.next = 21;
11315
+ _context4.next = 21;
10947
11316
  break;
10948
11317
  }
10949
11318
  throw new Error("HTTP error! Status: ".concat(response.status));
10950
11319
 
10951
11320
  case 21:
10952
- _context2.next = 23;
11321
+ _context4.next = 23;
10953
11322
  return response.json();
10954
11323
 
10955
11324
  case 23:
10956
- json = _context2.sent;
11325
+ json = _context4.sent;
10957
11326
  console.log(json);
10958
11327
  if (!(json !== null && json !== void 0 && (_json$result = json.result) !== null && _json$result !== void 0 && _json$result.includes("Invalid parameter(s)"))) {
10959
- _context2.next = 27;
11328
+ _context4.next = 27;
10960
11329
  break;
10961
11330
  }
10962
- return _context2.abrupt("return", "INVALID_REQUEST_PARAMS");
11331
+ return _context4.abrupt("return", "INVALID_REQUEST_PARAMS");
10963
11332
 
10964
11333
  case 27:
10965
11334
  if (!(json !== null && json !== void 0 && (_json$result2 = json.result) !== null && _json$result2 !== void 0 && _json$result2.includes("Not found"))) {
10966
- _context2.next = 29;
11335
+ _context4.next = 29;
10967
11336
  break;
10968
11337
  }
10969
- return _context2.abrupt("return", "ADDRESS_NOT_FOUND");
11338
+ return _context4.abrupt("return", "ADDRESS_NOT_FOUND");
10970
11339
 
10971
11340
  case 29:
10972
11341
  if (!(type === "stat")) {
10973
- _context2.next = 31;
11342
+ _context4.next = 31;
10974
11343
  break;
10975
11344
  }
10976
- return _context2.abrupt("return", [ json ]);
11345
+ return _context4.abrupt("return", [ json ]);
10977
11346
 
10978
11347
  case 31:
10979
- return _context2.abrupt("return", json.result);
11348
+ return _context4.abrupt("return", json.result);
10980
11349
 
10981
11350
  case 34:
10982
- _context2.prev = 34;
10983
- _context2.t1 = _context2["catch"](15);
10984
- return _context2.abrupt("return", "ERROR IN FETCHING");
11351
+ _context4.prev = 34;
11352
+ _context4.t1 = _context4["catch"](15);
11353
+ return _context4.abrupt("return", "ERROR IN FETCHING");
10985
11354
 
10986
11355
  case 37:
10987
11356
  case "end":
10988
- return _context2.stop();
11357
+ return _context4.stop();
10989
11358
  }
10990
- }), _callee2, null, [ [ 15, 34 ] ]);
11359
+ }), _callee4, null, [ [ 15, 34 ] ]);
10991
11360
  })));
10992
11361
  return _BLOCKSCOUT.apply(this, arguments);
10993
11362
  }
10994
- function ETHERSCAN(_x1, _x10, _x11) {
10995
- return _ETHERSCAN.apply(this, arguments);
11363
+ function BASESCAN() {
11364
+ return _BASESCAN.apply(this, arguments);
10996
11365
  }
10997
- function _ETHERSCAN() {
10998
- _ETHERSCAN = _asyncToGenerator(_regeneratorRuntime().mark((function _callee3(address, page, offset) {
10999
- var API_KEY, url, response, json;
11000
- return _regeneratorRuntime().wrap((function _callee3$(_context3) {
11001
- while (1) switch (_context3.prev = _context3.next) {
11366
+ function _BASESCAN() {
11367
+ _BASESCAN = _asyncToGenerator(_regeneratorRuntime().mark((function _callee5() {
11368
+ var _len2, args, _key2, type, chain, address, startDate, endDate, _args5 = arguments;
11369
+ return _regeneratorRuntime().wrap((function _callee5$(_context5) {
11370
+ while (1) switch (_context5.prev = _context5.next) {
11002
11371
  case 0:
11003
- API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Etherscan);
11004
- if (API_KEY) {
11005
- _context3.next = 3;
11006
- break;
11372
+ for (_len2 = _args5.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
11373
+ args[_key2] = _args5[_key2];
11007
11374
  }
11008
- return _context3.abrupt("return", "".concat(SERVICE_API_KEY.Etherscan).concat(ERROR_MESSAGES_FLAG.MISSING_KEY));
11375
+ type = args[0], chain = args[1], address = args[2], startDate = args[3], endDate = args[4];
11376
+ return _context5.abrupt("return", handleScanRequest({
11377
+ scanKey: SERVICE_API_KEY.Basescan,
11378
+ baseUrl: "https://api.basescan.org/api",
11379
+ type: type,
11380
+ chain: chain,
11381
+ address: address,
11382
+ startDate: startDate,
11383
+ endDate: endDate
11384
+ }));
11009
11385
 
11010
11386
  case 3:
11011
- if (!(API_KEY === "xxxx")) {
11012
- _context3.next = 5;
11387
+ case "end":
11388
+ return _context5.stop();
11389
+ }
11390
+ }), _callee5);
11391
+ })));
11392
+ return _BASESCAN.apply(this, arguments);
11393
+ }
11394
+ function GNOSISSCAN() {
11395
+ return _GNOSISSCAN.apply(this, arguments);
11396
+ }
11397
+ function _GNOSISSCAN() {
11398
+ _GNOSISSCAN = _asyncToGenerator(_regeneratorRuntime().mark((function _callee6() {
11399
+ var _len3, args, _key3, type, chain, address, startDate, endDate, _args6 = arguments;
11400
+ return _regeneratorRuntime().wrap((function _callee6$(_context6) {
11401
+ while (1) switch (_context6.prev = _context6.next) {
11402
+ case 0:
11403
+ for (_len3 = _args6.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
11404
+ args[_key3] = _args6[_key3];
11405
+ }
11406
+ type = args[0], chain = args[1], address = args[2], startDate = args[3], endDate = args[4];
11407
+ return _context6.abrupt("return", handleScanRequest({
11408
+ scanKey: SERVICE_API_KEY.Gnosisscan,
11409
+ baseUrl: "https://api.gnosisscan.io/api",
11410
+ type: type,
11411
+ chain: chain,
11412
+ address: address,
11413
+ startDate: startDate,
11414
+ endDate: endDate
11415
+ }));
11416
+
11417
+ case 3:
11418
+ case "end":
11419
+ return _context6.stop();
11420
+ }
11421
+ }), _callee6);
11422
+ })));
11423
+ return _GNOSISSCAN.apply(this, arguments);
11424
+ }
11425
+ function NEYNAR(_x13, _x14, _x15, _x16, _x17) {
11426
+ return _NEYNAR.apply(this, arguments);
11427
+ }
11428
+ function _NEYNAR() {
11429
+ _NEYNAR = _asyncToGenerator(_regeneratorRuntime().mark((function _callee7(fid, viewerFid, sortType, limit, cursor) {
11430
+ var API_KEY, url, _json$users, response, json;
11431
+ return _regeneratorRuntime().wrap((function _callee7$(_context7) {
11432
+ while (1) switch (_context7.prev = _context7.next) {
11433
+ case 0:
11434
+ API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Neynar);
11435
+ if (API_KEY) {
11436
+ _context7.next = 3;
11013
11437
  break;
11014
11438
  }
11015
- return _context3.abrupt("return", "".concat(SERVICE_API_KEY.Etherscan).concat(ERROR_MESSAGES_FLAG.RATE_LIMIT));
11439
+ return _context7.abrupt("return", "".concat(SERVICE_API_KEY.Neynar).concat(ERROR_MESSAGES_FLAG.MISSING_KEY));
11016
11440
 
11017
- case 5:
11018
- url = "https://api.etherscan.io/v2/api?chainid=1&module=account&action=txlist&address=".concat(address, "&startblock=0&endblock=99999999&page=").concat(page || 1, "&offset=").concat(offset || 10, "&sort=asc&apikey=").concat(API_KEY);
11019
- _context3.prev = 6;
11020
- _context3.next = 9;
11021
- return fetch(url);
11441
+ case 3:
11442
+ url = new URL("https://api.neynar.com/v2/farcaster/followers");
11443
+ url.searchParams.set("fid", fid.toString());
11444
+ url.searchParams.set("sort_type", sortType);
11445
+ url.searchParams.set("limit", limit.toString());
11446
+ if (viewerFid !== null) url.searchParams.set("viewer_fid", viewerFid.toString());
11447
+ if (cursor) url.searchParams.set("cursor", cursor);
11448
+ _context7.prev = 9;
11449
+ _context7.next = 12;
11450
+ return fetch(url.toString(), {
11451
+ headers: {
11452
+ "x-api-key": API_KEY,
11453
+ "x-neynar-experimental": "false"
11454
+ }
11455
+ });
11022
11456
 
11023
- case 9:
11024
- response = _context3.sent;
11457
+ case 12:
11458
+ response = _context7.sent;
11025
11459
  if (response.ok) {
11026
- _context3.next = 12;
11460
+ _context7.next = 15;
11027
11461
  break;
11028
11462
  }
11029
- throw new Error("HTTP error! Status: ".concat(response.status));
11463
+ throw new Error("HTTP ".concat(response.status));
11030
11464
 
11031
- case 12:
11032
- _context3.next = 14;
11465
+ case 15:
11466
+ _context7.next = 17;
11033
11467
  return response.json();
11034
11468
 
11035
- case 14:
11036
- json = _context3.sent;
11037
- if (!json.result.includes("Invalid API Key")) {
11038
- _context3.next = 17;
11469
+ case 17:
11470
+ json = _context7.sent;
11471
+ if (json !== null && json !== void 0 && (_json$users = json.users) !== null && _json$users !== void 0 && _json$users.length) {
11472
+ _context7.next = 20;
11039
11473
  break;
11040
11474
  }
11041
- return _context3.abrupt("return", "".concat(SERVICE_API_KEY.Etherscan).concat(ERROR_MESSAGES_FLAG.INVALID_API_KEY));
11475
+ return _context7.abrupt("return", []);
11042
11476
 
11043
- case 17:
11044
- if (!json.result.includes("Max rate limit reached")) {
11045
- _context3.next = 19;
11477
+ case 20:
11478
+ return _context7.abrupt("return", json.users.map((function(_ref4) {
11479
+ var _user$profile, _user$profile2;
11480
+ var user = _ref4.user;
11481
+ return {
11482
+ username: user.username,
11483
+ custody_address: user.custody_address,
11484
+ follower_count: user.follower_count,
11485
+ country: ((_user$profile = user.profile) === null || _user$profile === void 0 || (_user$profile = _user$profile.location) === null || _user$profile === void 0 || (_user$profile = _user$profile.address) === null || _user$profile === void 0 ? void 0 : _user$profile.country) || "",
11486
+ city: ((_user$profile2 = user.profile) === null || _user$profile2 === void 0 || (_user$profile2 = _user$profile2.location) === null || _user$profile2 === void 0 || (_user$profile2 = _user$profile2.address) === null || _user$profile2 === void 0 ? void 0 : _user$profile2.city) || ""
11487
+ };
11488
+ })));
11489
+
11490
+ case 23:
11491
+ _context7.prev = 23;
11492
+ _context7.t0 = _context7["catch"](9);
11493
+ console.error("NEYNAR_FETCH_FOLLOWERS error:", _context7.t0);
11494
+ return _context7.abrupt("return", ERROR_MESSAGES_FLAG.DEFAULT);
11495
+
11496
+ case 27:
11497
+ case "end":
11498
+ return _context7.stop();
11499
+ }
11500
+ }), _callee7, null, [ [ 9, 23 ] ]);
11501
+ })));
11502
+ return _NEYNAR.apply(this, arguments);
11503
+ }
11504
+ function GNOSIS(_x18) {
11505
+ return _GNOSIS.apply(this, arguments);
11506
+ }
11507
+ function _GNOSIS() {
11508
+ _GNOSIS = _asyncToGenerator(_regeneratorRuntime().mark((function _callee8(_ref3) {
11509
+ var cardId, startDate, endDate, _ref3$limit, limit, _ref3$offset, offset, apiKeyKey, API_KEY, url, res, json;
11510
+ return _regeneratorRuntime().wrap((function _callee8$(_context8) {
11511
+ while (1) switch (_context8.prev = _context8.next) {
11512
+ case 0:
11513
+ cardId = _ref3.cardId, startDate = _ref3.startDate, endDate = _ref3.endDate, _ref3$limit = _ref3.limit,
11514
+ limit = _ref3$limit === void 0 ? 20 : _ref3$limit, _ref3$offset = _ref3.offset,
11515
+ offset = _ref3$offset === void 0 ? 0 : _ref3$offset;
11516
+ apiKeyKey = SERVICE_API_KEY.GnosisPay;
11517
+ API_KEY = window.localStorage.getItem(apiKeyKey);
11518
+ if (API_KEY) {
11519
+ _context8.next = 5;
11046
11520
  break;
11047
11521
  }
11048
- return _context3.abrupt("return", "".concat(SERVICE_API_KEY.Etherscan).concat(ERROR_MESSAGES_FLAG.RATE_LIMIT));
11522
+ return _context8.abrupt("return", "".concat(apiKeyKey).concat(ERROR_MESSAGES_FLAG.MISSING_KEY));
11049
11523
 
11050
- case 19:
11051
- return _context3.abrupt("return", json.result);
11524
+ case 5:
11525
+ if (cardId) {
11526
+ _context8.next = 7;
11527
+ break;
11528
+ }
11529
+ return _context8.abrupt("return", "".concat(apiKeyKey).concat(ERROR_MESSAGES_FLAG.INVALID_PARAM));
11530
+
11531
+ case 7:
11532
+ url = new URL("https://api.gnosispay.com/cards/".concat(cardId, "/transactions"));
11533
+ url.searchParams.set("limit", limit.toString());
11534
+ url.searchParams.set("offset", offset.toString());
11535
+ if (!isNaN(startDate)) {
11536
+ url.searchParams.set("startDate", new Date(startDate * 1e3).toISOString());
11537
+ }
11538
+ if (!isNaN(endDate)) {
11539
+ url.searchParams.set("endDate", new Date(endDate * 1e3).toISOString());
11540
+ }
11541
+ _context8.prev = 12;
11542
+ _context8.next = 15;
11543
+ return fetch(url.toString(), {
11544
+ headers: {
11545
+ Authorization: "Bearer ".concat(API_KEY),
11546
+ "Content-Type": "application/json"
11547
+ }
11548
+ });
11052
11549
 
11053
- case 22:
11054
- _context3.prev = 22;
11055
- _context3.t0 = _context3["catch"](6);
11056
- return _context3.abrupt("return", ERROR_MESSAGES_FLAG.DEFAULT);
11550
+ case 15:
11551
+ res = _context8.sent;
11552
+ if (res.ok) {
11553
+ _context8.next = 18;
11554
+ break;
11555
+ }
11556
+ throw new Error("HTTP error! Status: ".concat(res.status));
11057
11557
 
11058
- case 25:
11558
+ case 18:
11559
+ _context8.next = 20;
11560
+ return res.json();
11561
+
11562
+ case 20:
11563
+ json = _context8.sent;
11564
+ if (Array.isArray(json)) {
11565
+ _context8.next = 23;
11566
+ break;
11567
+ }
11568
+ return _context8.abrupt("return", []);
11569
+
11570
+ case 23:
11571
+ return _context8.abrupt("return", json.map((function(tx) {
11572
+ return {
11573
+ createdAt: tx.createdAt,
11574
+ clearedAt: tx.clearedAt,
11575
+ country: tx.country,
11576
+ merchant: tx.merchant,
11577
+ billingAmount: tx.billingAmount,
11578
+ billingCurrency: tx.billingCurrency,
11579
+ transactionAmount: tx.transactionAmount,
11580
+ transactionCurrency: tx.transactionCurrency,
11581
+ transactionType: tx.transactionType,
11582
+ kind: tx.kind,
11583
+ status: tx.status || null,
11584
+ mcc: tx.mcc
11585
+ };
11586
+ })));
11587
+
11588
+ case 26:
11589
+ _context8.prev = 26;
11590
+ _context8.t0 = _context8["catch"](12);
11591
+ console.error("GNOSISPAY_CARD_TXNS error:", _context8.t0);
11592
+ return _context8.abrupt("return", ERROR_MESSAGES_FLAG.DEFAULT);
11593
+
11594
+ case 30:
11059
11595
  case "end":
11060
- return _context3.stop();
11596
+ return _context8.stop();
11597
+ }
11598
+ }), _callee8, null, [ [ 12, 26 ] ]);
11599
+ })));
11600
+ return _GNOSIS.apply(this, arguments);
11601
+ }
11602
+ function ETHERSCAN() {
11603
+ return _ETHERSCAN.apply(this, arguments);
11604
+ }
11605
+ function _ETHERSCAN() {
11606
+ _ETHERSCAN = _asyncToGenerator(_regeneratorRuntime().mark((function _callee9() {
11607
+ var _len4, args, _key4, type, chain, address, startDate, endDate, _args9 = arguments;
11608
+ return _regeneratorRuntime().wrap((function _callee9$(_context9) {
11609
+ while (1) switch (_context9.prev = _context9.next) {
11610
+ case 0:
11611
+ for (_len4 = _args9.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
11612
+ args[_key4] = _args9[_key4];
11613
+ }
11614
+ type = args[0], chain = args[1], address = args[2], startDate = args[3], endDate = args[4];
11615
+ return _context9.abrupt("return", handleScanRequest({
11616
+ scanKey: SERVICE_API_KEY.Etherscan,
11617
+ baseUrl: "https://api.etherscan.io/v2/api",
11618
+ type: type,
11619
+ chain: chain,
11620
+ address: address,
11621
+ startDate: startDate,
11622
+ endDate: endDate
11623
+ }));
11624
+
11625
+ case 3:
11626
+ case "end":
11627
+ return _context9.stop();
11061
11628
  }
11062
- }), _callee3, null, [ [ 6, 22 ] ]);
11629
+ }), _callee9);
11063
11630
  })));
11064
11631
  return _ETHERSCAN.apply(this, arguments);
11065
11632
  }
11066
- function COINGECKO(_x12, _x13) {
11633
+ function COINGECKO(_x19, _x20) {
11067
11634
  return _COINGECKO.apply(this, arguments);
11068
11635
  }
11069
11636
  function _COINGECKO() {
11070
- _COINGECKO = _asyncToGenerator(_regeneratorRuntime().mark((function _callee4(token, vs_currencies) {
11637
+ _COINGECKO = _asyncToGenerator(_regeneratorRuntime().mark((function _callee0(token, vs_currencies) {
11071
11638
  var API_KEY, url, options, response, json, jsonResponse, output, _i10, _Object$entries, _Object$entries$_i, coin, prices, _i11, _Object$entries2, _Object$entries2$_i, currency, _value5, key;
11072
- return _regeneratorRuntime().wrap((function _callee4$(_context4) {
11073
- while (1) switch (_context4.prev = _context4.next) {
11639
+ return _regeneratorRuntime().wrap((function _callee0$(_context0) {
11640
+ while (1) switch (_context0.prev = _context0.next) {
11074
11641
  case 0:
11075
11642
  API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Coingecko);
11076
11643
  url = "https://api.coingecko.com/api/v3/simple/price?vs_currencies=".concat(vs_currencies, "&ids=").concat(token);
@@ -11081,40 +11648,40 @@ function _typeof(o) {
11081
11648
  "x-cg-demo-api-key": "".concat(API_KEY)
11082
11649
  }
11083
11650
  };
11084
- _context4.prev = 3;
11085
- _context4.next = 6;
11651
+ _context0.prev = 3;
11652
+ _context0.next = 6;
11086
11653
  return fetch(url, options);
11087
11654
 
11088
11655
  case 6:
11089
- response = _context4.sent;
11656
+ response = _context0.sent;
11090
11657
  if (response.ok) {
11091
- _context4.next = 15;
11658
+ _context0.next = 15;
11092
11659
  break;
11093
11660
  }
11094
- _context4.next = 10;
11661
+ _context0.next = 10;
11095
11662
  return response.json();
11096
11663
 
11097
11664
  case 10:
11098
- json = _context4.sent;
11665
+ json = _context0.sent;
11099
11666
  if (!json.status.error_message.includes("API Key Missing")) {
11100
- _context4.next = 13;
11667
+ _context0.next = 13;
11101
11668
  break;
11102
11669
  }
11103
- return _context4.abrupt("return", "".concat(SERVICE_API_KEY.Coingecko).concat(ERROR_MESSAGES_FLAG.INVALID_API_KEY));
11670
+ return _context0.abrupt("return", "".concat(SERVICE_API_KEY.Coingecko).concat(ERROR_MESSAGES_FLAG.INVALID_API_KEY));
11104
11671
 
11105
11672
  case 13:
11106
11673
  if (!(response.status === 429)) {
11107
- _context4.next = 15;
11674
+ _context0.next = 15;
11108
11675
  break;
11109
11676
  }
11110
- return _context4.abrupt("return", "".concat(SERVICE_API_KEY.Coingecko).concat(ERROR_MESSAGES_FLAG.RATE_LIMIT));
11677
+ return _context0.abrupt("return", "".concat(SERVICE_API_KEY.Coingecko).concat(ERROR_MESSAGES_FLAG.RATE_LIMIT));
11111
11678
 
11112
11679
  case 15:
11113
- _context4.next = 17;
11680
+ _context0.next = 17;
11114
11681
  return response.json();
11115
11682
 
11116
11683
  case 17:
11117
- jsonResponse = _context4.sent;
11684
+ jsonResponse = _context0.sent;
11118
11685
  output = {};
11119
11686
  for (_i10 = 0, _Object$entries = Object.entries(jsonResponse); _i10 < _Object$entries.length; _i10++) {
11120
11687
  _Object$entries$_i = _slicedToArray(_Object$entries[_i10], 2), coin = _Object$entries$_i[0],
@@ -11126,138 +11693,217 @@ function _typeof(o) {
11126
11693
  output[key] = _value5;
11127
11694
  }
11128
11695
  }
11129
- return _context4.abrupt("return", [ output ]);
11696
+ return _context0.abrupt("return", [ output ]);
11130
11697
 
11131
11698
  case 23:
11132
- _context4.prev = 23;
11133
- _context4.t0 = _context4["catch"](3);
11134
- return _context4.abrupt("return", ERROR_MESSAGES_FLAG.DEFAULT);
11699
+ _context0.prev = 23;
11700
+ _context0.t0 = _context0["catch"](3);
11701
+ console.log(_context0.t0);
11702
+ return _context0.abrupt("return", ERROR_MESSAGES_FLAG.DEFAULT);
11135
11703
 
11136
- case 26:
11704
+ case 27:
11137
11705
  case "end":
11138
- return _context4.stop();
11706
+ return _context0.stop();
11139
11707
  }
11140
- }), _callee4, null, [ [ 3, 23 ] ]);
11708
+ }), _callee0, null, [ [ 3, 23 ] ]);
11141
11709
  })));
11142
11710
  return _COINGECKO.apply(this, arguments);
11143
11711
  }
11144
- function EOA(_x14, _x15, _x16, _x17, _x18) {
11712
+ function EOA(_x21, _x22, _x23, _x24, _x25) {
11145
11713
  return _EOA.apply(this, arguments);
11146
11714
  }
11147
11715
  function _EOA() {
11148
- _EOA = _asyncToGenerator(_regeneratorRuntime().mark((function _callee5(address, categories, chain, startTime, endTime) {
11149
- var API_KEYS, apiKey, chainId, action, timeQuery, startBlock, endBlock, url, _json$result3, _json$result3$include, response, json;
11150
- return _regeneratorRuntime().wrap((function _callee5$(_context5) {
11151
- while (1) switch (_context5.prev = _context5.next) {
11716
+ _EOA = _asyncToGenerator(_regeneratorRuntime().mark((function _callee1(addresses, category, chains, startTime, endTime) {
11717
+ var ADDRESSES, CHAINS, flatResults, API_KEY, _iterator, _step, chain, chainId, _iterator2, _step2, address, action, timeQuery, startBlock, endBlock, url, _json$result3, _json$result3$include, _json$result4, _json$result4$include, response, json, entries, _iterator3, _step3, entry;
11718
+ return _regeneratorRuntime().wrap((function _callee1$(_context1) {
11719
+ while (1) switch (_context1.prev = _context1.next) {
11152
11720
  case 0:
11153
- API_KEYS = {
11154
- ethereum: window.localStorage.getItem(SERVICE_API_KEY.Etherscan),
11155
- gnosis: window.localStorage.getItem(SERVICE_API_KEY.Gnosisscan),
11156
- base: window.localStorage.getItem(SERVICE_API_KEY.Basescan)
11157
- };
11158
- apiKey = API_KEYS[chain];
11721
+ _context1.prev = 0;
11722
+ ADDRESSES = addresses.split(",").map((function(a) {
11723
+ return a.trim();
11724
+ }));
11725
+ CHAINS = typeof chains === "string" ? chains.split(",").map((function(c) {
11726
+ return c.trim();
11727
+ })) : chains;
11728
+ flatResults = [];
11729
+ API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Etherscan);
11730
+ if (API_KEY) {
11731
+ _context1.next = 7;
11732
+ break;
11733
+ }
11734
+ return _context1.abrupt("return", "".concat(SERVICE_API_KEY.Etherscan).concat(ERROR_MESSAGES_FLAG.MISSING_KEY));
11735
+
11736
+ case 7:
11737
+ _iterator = _createForOfIteratorHelper(CHAINS);
11738
+ _context1.prev = 8;
11739
+ _iterator.s();
11740
+
11741
+ case 10:
11742
+ if ((_step = _iterator.n()).done) {
11743
+ _context1.next = 67;
11744
+ break;
11745
+ }
11746
+ chain = _step.value;
11159
11747
  chainId = CHAIN_ID_MAP[chain];
11160
- if (!(!apiKey || !chainId)) {
11161
- _context5.next = 5;
11748
+ if (chainId) {
11749
+ _context1.next = 15;
11162
11750
  break;
11163
11751
  }
11164
- return _context5.abrupt("return", "".concat(chain.toUpperCase(), "_MISSING"));
11752
+ throw new Error("Unsupported chain");
11165
11753
 
11166
- case 5:
11167
- action = "";
11168
- if (categories === "txns") action = "account.txlist"; else {
11169
- action = "account.balance";
11754
+ case 15:
11755
+ _iterator2 = _createForOfIteratorHelper(ADDRESSES);
11756
+ _context1.prev = 16;
11757
+ _iterator2.s();
11758
+
11759
+ case 18:
11760
+ if ((_step2 = _iterator2.n()).done) {
11761
+ _context1.next = 57;
11762
+ break;
11170
11763
  }
11764
+ address = _step2.value;
11765
+ action = category === "txns" ? "account.txlist" : "account.balance";
11171
11766
  timeQuery = "";
11172
- if (!(!isNaN(startTime) && !isNaN(endTime))) {
11173
- _context5.next = 18;
11767
+ if (!(category === "txns")) {
11768
+ _context1.next = 32;
11174
11769
  break;
11175
11770
  }
11176
- _context5.next = 11;
11177
- return fromTimeStampToBlock(startTime, chain, apiKey);
11771
+ _context1.next = 25;
11772
+ return fromTimeStampToBlock(startTime, chain, API_KEY);
11178
11773
 
11179
- case 11:
11180
- startBlock = _context5.sent;
11181
- _context5.next = 14;
11182
- return fromTimeStampToBlock(endTime, chain, apiKey);
11774
+ case 25:
11775
+ startBlock = _context1.sent;
11776
+ _context1.next = 28;
11777
+ return fromTimeStampToBlock(endTime, chain, API_KEY);
11183
11778
 
11184
- case 14:
11185
- endBlock = _context5.sent;
11779
+ case 28:
11780
+ endBlock = _context1.sent;
11186
11781
  timeQuery = "&startblock=".concat(startBlock, "&endblock=").concat(endBlock);
11187
- _context5.next = 23;
11782
+ _context1.next = 33;
11188
11783
  break;
11189
11784
 
11190
- case 18:
11191
- if (!(categories === "balance")) {
11192
- _context5.next = 22;
11193
- break;
11194
- }
11785
+ case 32:
11195
11786
  timeQuery = "&tag=latest";
11196
- _context5.next = 23;
11197
- break;
11198
11787
 
11199
- case 22:
11200
- throw new Error("Start and End Time is required for querying transaction list ");
11201
-
11202
- case 23:
11203
- url = "https://api.etherscan.io/v2/api?module=".concat(action.split(".")[0], "&action=").concat(action.split(".")[1], "&address=").concat(address, "&sort=asc&chainid=").concat(chainId, "&apikey=").concat(apiKey).concat(timeQuery);
11204
- _context5.prev = 24;
11205
- _context5.next = 27;
11788
+ case 33:
11789
+ url = "https://api.etherscan.io/v2/api?module=".concat(action.split(".")[0], "&action=").concat(action.split(".")[1], "&address=").concat(address, "&sort=asc&chainid=").concat(chainId, "&apikey=").concat(API_KEY).concat(timeQuery);
11790
+ _context1.prev = 34;
11791
+ _context1.next = 37;
11206
11792
  return fetch(url);
11207
11793
 
11208
- case 27:
11209
- response = _context5.sent;
11794
+ case 37:
11795
+ response = _context1.sent;
11210
11796
  if (response.ok) {
11211
- _context5.next = 30;
11797
+ _context1.next = 40;
11212
11798
  break;
11213
11799
  }
11214
- throw new Error("HTTP error! Status: ".concat(response.status));
11800
+ return _context1.abrupt("return", "HTTP_".concat(response.status));
11215
11801
 
11216
- case 30:
11217
- _context5.next = 32;
11802
+ case 40:
11803
+ _context1.next = 42;
11218
11804
  return response.json();
11219
11805
 
11220
- case 32:
11221
- json = _context5.sent;
11806
+ case 42:
11807
+ json = _context1.sent;
11222
11808
  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"))) {
11223
- _context5.next = 35;
11809
+ _context1.next = 45;
11224
11810
  break;
11225
11811
  }
11226
- return _context5.abrupt("return", "".concat(SERVICE_API_KEY[chain.charAt(0).toUpperCase() + chain.slice(1)], "_MISSING"));
11812
+ return _context1.abrupt("return", "".concat(SERVICE_API_KEY.Etherscan).concat(ERROR_MESSAGES_FLAG.INVALID_API_KEY));
11227
11813
 
11228
- case 35:
11229
- if (!json.result.includes("Max rate limit reached")) {
11230
- _context5.next = 37;
11814
+ case 45:
11815
+ 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"))) {
11816
+ _context1.next = 47;
11231
11817
  break;
11232
11818
  }
11233
- return _context5.abrupt("return", "".concat(SERVICE_API_KEY.Etherscan).concat(ERROR_MESSAGES_FLAG.RATE_LIMIT));
11819
+ return _context1.abrupt("return", "".concat(SERVICE_API_KEY.Etherscan).concat(ERROR_MESSAGES_FLAG.RATE_LIMIT));
11820
+
11821
+ case 47:
11822
+ entries = Array.isArray(json.result) ? json.result : [ json.result ];
11823
+ _iterator3 = _createForOfIteratorHelper(entries);
11824
+ try {
11825
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done; ) {
11826
+ entry = _step3.value;
11827
+ flatResults.push(_objectSpread({
11828
+ chain: chain,
11829
+ address: address
11830
+ }, entry));
11831
+ }
11832
+ } catch (err) {
11833
+ _iterator3.e(err);
11834
+ } finally {
11835
+ _iterator3.f();
11836
+ }
11837
+ _context1.next = 55;
11838
+ break;
11234
11839
 
11235
- case 37:
11236
- return _context5.abrupt("return", json.result);
11840
+ case 52:
11841
+ _context1.prev = 52;
11842
+ _context1.t0 = _context1["catch"](34);
11843
+ return _context1.abrupt("return", ERROR_MESSAGES_FLAG.DEFAULT);
11237
11844
 
11238
- case 40:
11239
- _context5.prev = 40;
11240
- _context5.t0 = _context5["catch"](24);
11241
- console.log(_context5.t0);
11242
- return _context5.abrupt("return", ERROR_MESSAGES_FLAG.DEFAULT);
11845
+ case 55:
11846
+ _context1.next = 18;
11847
+ break;
11243
11848
 
11244
- case 44:
11849
+ case 57:
11850
+ _context1.next = 62;
11851
+ break;
11852
+
11853
+ case 59:
11854
+ _context1.prev = 59;
11855
+ _context1.t1 = _context1["catch"](16);
11856
+ _iterator2.e(_context1.t1);
11857
+
11858
+ case 62:
11859
+ _context1.prev = 62;
11860
+ _iterator2.f();
11861
+ return _context1.finish(62);
11862
+
11863
+ case 65:
11864
+ _context1.next = 10;
11865
+ break;
11866
+
11867
+ case 67:
11868
+ _context1.next = 72;
11869
+ break;
11870
+
11871
+ case 69:
11872
+ _context1.prev = 69;
11873
+ _context1.t2 = _context1["catch"](8);
11874
+ _iterator.e(_context1.t2);
11875
+
11876
+ case 72:
11877
+ _context1.prev = 72;
11878
+ _iterator.f();
11879
+ return _context1.finish(72);
11880
+
11881
+ case 75:
11882
+ return _context1.abrupt("return", flatResults);
11883
+
11884
+ case 78:
11885
+ _context1.prev = 78;
11886
+ _context1.t3 = _context1["catch"](0);
11887
+ console.log(_context1.t3);
11888
+ return _context1.abrupt("return", ERROR_MESSAGES_FLAG.DEFAULT);
11889
+
11890
+ case 82:
11245
11891
  case "end":
11246
- return _context5.stop();
11892
+ return _context1.stop();
11247
11893
  }
11248
- }), _callee5, null, [ [ 24, 40 ] ]);
11894
+ }), _callee1, null, [ [ 0, 78 ], [ 8, 69, 72, 75 ], [ 16, 59, 62, 65 ], [ 34, 52 ] ]);
11249
11895
  })));
11250
11896
  return _EOA.apply(this, arguments);
11251
11897
  }
11252
- function FLVURL(_x19, _x20) {
11898
+ function FLVURL(_x26, _x27) {
11253
11899
  return _FLVURL.apply(this, arguments);
11254
11900
  }
11255
11901
  function _FLVURL() {
11256
- _FLVURL = _asyncToGenerator(_regeneratorRuntime().mark((function _callee6(token, vs_currencies) {
11257
- return _regeneratorRuntime().wrap((function _callee6$(_context6) {
11258
- while (1) switch (_context6.prev = _context6.next) {
11902
+ _FLVURL = _asyncToGenerator(_regeneratorRuntime().mark((function _callee10(token, vs_currencies) {
11903
+ return _regeneratorRuntime().wrap((function _callee10$(_context10) {
11904
+ while (1) switch (_context10.prev = _context10.next) {
11259
11905
  case 0:
11260
- return _context6.abrupt("return", new Promise((function(resolve) {
11906
+ return _context10.abrupt("return", new Promise((function(resolve) {
11261
11907
  setTimeout((function() {
11262
11908
  resolve([ {
11263
11909
  Yoo: "gotcha"
@@ -11267,61 +11913,61 @@ function _typeof(o) {
11267
11913
 
11268
11914
  case 1:
11269
11915
  case "end":
11270
- return _context6.stop();
11916
+ return _context10.stop();
11271
11917
  }
11272
- }), _callee6);
11918
+ }), _callee10);
11273
11919
  })));
11274
11920
  return _FLVURL.apply(this, arguments);
11275
11921
  }
11276
- function SAFE(_x21, _x22, _x23, _x24, _x25) {
11922
+ function SAFE(_x28, _x29, _x30, _x31, _x32) {
11277
11923
  return _SAFE.apply(this, arguments);
11278
11924
  }
11279
11925
  function _SAFE() {
11280
- _SAFE = _asyncToGenerator(_regeneratorRuntime().mark((function _callee7(address, utility, chain, limit, offset) {
11926
+ _SAFE = _asyncToGenerator(_regeneratorRuntime().mark((function _callee11(address, utility, chain, limit, offset) {
11281
11927
  var apiKey, chainIdentifier, url, response, json;
11282
- return _regeneratorRuntime().wrap((function _callee7$(_context7) {
11283
- while (1) switch (_context7.prev = _context7.next) {
11928
+ return _regeneratorRuntime().wrap((function _callee11$(_context11) {
11929
+ while (1) switch (_context11.prev = _context11.next) {
11284
11930
  case 0:
11285
11931
  if (!(typeof limit !== "number" || limit < 0)) {
11286
- _context7.next = 2;
11932
+ _context11.next = 2;
11287
11933
  break;
11288
11934
  }
11289
- return _context7.abrupt("return", "INVALID_LIMIT");
11935
+ return _context11.abrupt("return", "INVALID_LIMIT");
11290
11936
 
11291
11937
  case 2:
11292
11938
  if (!(typeof offset !== "number" || offset < 0)) {
11293
- _context7.next = 4;
11939
+ _context11.next = 4;
11294
11940
  break;
11295
11941
  }
11296
- return _context7.abrupt("return", "INVALID_OFFSET");
11942
+ return _context11.abrupt("return", "INVALID_OFFSET");
11297
11943
 
11298
11944
  case 4:
11299
11945
  if (!(utility !== "txns")) {
11300
- _context7.next = 6;
11946
+ _context11.next = 6;
11301
11947
  break;
11302
11948
  }
11303
- return _context7.abrupt("return", "UTILITY IS NOT SUPPORTED");
11949
+ return _context11.abrupt("return", "UTILITY IS NOT SUPPORTED");
11304
11950
 
11305
11951
  case 6:
11306
11952
  apiKey = window.localStorage.getItem(SERVICE_API_KEY.Safe);
11307
11953
  chainIdentifier = SAFE_CHAIN_MAP[chain];
11308
11954
  if (apiKey) {
11309
- _context7.next = 10;
11955
+ _context11.next = 10;
11310
11956
  break;
11311
11957
  }
11312
- return _context7.abrupt("return", "".concat(SERVICE_API_KEY.Safe, "_MISSING"));
11958
+ return _context11.abrupt("return", "".concat(SERVICE_API_KEY.Safe, "_MISSING"));
11313
11959
 
11314
11960
  case 10:
11315
11961
  if (chainIdentifier) {
11316
- _context7.next = 12;
11962
+ _context11.next = 12;
11317
11963
  break;
11318
11964
  }
11319
- return _context7.abrupt("return", "CHAIN IS NOT SUPPORTED");
11965
+ return _context11.abrupt("return", "CHAIN IS NOT SUPPORTED");
11320
11966
 
11321
11967
  case 12:
11322
11968
  url = "https://api.safe.global/tx-service/".concat(chainIdentifier, "/api/v2/safes/").concat(address, "/multisig-transactions?limit=").concat(limit, "&offset=").concat(offset);
11323
- _context7.prev = 13;
11324
- _context7.next = 16;
11969
+ _context11.prev = 13;
11970
+ _context11.next = 16;
11325
11971
  return fetch(url, {
11326
11972
  headers: {
11327
11973
  Authorization: "Bearer ".concat(apiKey)
@@ -11329,42 +11975,42 @@ function _typeof(o) {
11329
11975
  });
11330
11976
 
11331
11977
  case 16:
11332
- response = _context7.sent;
11978
+ response = _context11.sent;
11333
11979
  if (response.ok) {
11334
- _context7.next = 19;
11980
+ _context11.next = 19;
11335
11981
  break;
11336
11982
  }
11337
11983
  throw new Error("HTTP error! Status: ".concat(response.status));
11338
11984
 
11339
11985
  case 19:
11340
- _context7.next = 21;
11986
+ _context11.next = 21;
11341
11987
  return response.json();
11342
11988
 
11343
11989
  case 21:
11344
- json = _context7.sent;
11990
+ json = _context11.sent;
11345
11991
  if (Array.isArray(json.results)) {
11346
- _context7.next = 24;
11992
+ _context11.next = 24;
11347
11993
  break;
11348
11994
  }
11349
- return _context7.abrupt("return", "INVALID API RESPONSE");
11995
+ return _context11.abrupt("return", "INVALID API RESPONSE");
11350
11996
 
11351
11997
  case 24:
11352
- return _context7.abrupt("return", json.results.map((function(_ref2) {
11353
- var confirmations = _ref2.confirmations, dataDecoded = _ref2.dataDecoded, rest = _objectWithoutProperties(_ref2, _excluded);
11998
+ return _context11.abrupt("return", json.results.map((function(_ref5) {
11999
+ var confirmations = _ref5.confirmations, dataDecoded = _ref5.dataDecoded, rest = _objectWithoutProperties(_ref5, _excluded);
11354
12000
  return rest;
11355
12001
  })));
11356
12002
 
11357
12003
  case 27:
11358
- _context7.prev = 27;
11359
- _context7.t0 = _context7["catch"](13);
11360
- console.log(_context7.t0);
11361
- return _context7.abrupt("return", "ERROR IN FETCHING");
12004
+ _context11.prev = 27;
12005
+ _context11.t0 = _context11["catch"](13);
12006
+ console.log(_context11.t0);
12007
+ return _context11.abrupt("return", "ERROR IN FETCHING");
11362
12008
 
11363
12009
  case 31:
11364
12010
  case "end":
11365
- return _context7.stop();
12011
+ return _context11.stop();
11366
12012
  }
11367
- }), _callee7, null, [ [ 13, 27 ] ]);
12013
+ }), _callee11, null, [ [ 13, 27 ] ]);
11368
12014
  })));
11369
12015
  return _SAFE.apply(this, arguments);
11370
12016
  }
@@ -11393,6 +12039,7 @@ function _typeof(o) {
11393
12039
  exports.AVERAGEIF = AVERAGEIF;
11394
12040
  exports.AVERAGEIFS = AVERAGEIFS;
11395
12041
  exports.BASE = BASE;
12042
+ exports.BASESCAN = BASESCAN;
11396
12043
  exports.BESSELI = BESSELI;
11397
12044
  exports.BESSELJ = BESSELJ;
11398
12045
  exports.BESSELK = BESSELK;
@@ -11509,6 +12156,7 @@ function _typeof(o) {
11509
12156
  exports.FIND = FIND;
11510
12157
  exports.FINV = FINV;
11511
12158
  exports.FINVRT = FINVRT;
12159
+ exports.FIREFLY = FIREFLY;
11512
12160
  exports.FISHER = FISHER;
11513
12161
  exports.FISHERINV = FISHERINV;
11514
12162
  exports.FIXED = FIXED;
@@ -11530,6 +12178,8 @@ function _typeof(o) {
11530
12178
  exports.GCD = GCD;
11531
12179
  exports.GEOMEAN = GEOMEAN;
11532
12180
  exports.GESTEP = GESTEP;
12181
+ exports.GNOSIS = GNOSIS;
12182
+ exports.GNOSISSCAN = GNOSISSCAN;
11533
12183
  exports.GROWTH = GROWTH;
11534
12184
  exports.HARMEAN = HARMEAN;
11535
12185
  exports.HEX2BIN = HEX2BIN;
@@ -11630,6 +12280,7 @@ function _typeof(o) {
11630
12280
  exports.NETWORKDAYS = NETWORKDAYS;
11631
12281
  exports.NETWORKDAYSINTL = NETWORKDAYSINTL;
11632
12282
  exports.NETWORKDAYS_INTL = NETWORKDAYS_INTL;
12283
+ exports.NEYNAR = NEYNAR;
11633
12284
  exports.NOMINAL = NOMINAL;
11634
12285
  exports.NORM = NORM;
11635
12286
  exports.NORMDIST = NORMDIST;