@fileverse-dev/formulajs 4.4.11-mod-22-patch-4 → 4.4.11-mod-23
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.
- package/lib/browser/formula.js +332 -91
- package/lib/browser/formula.min.js +2 -2
- package/lib/browser/formula.min.js.map +1 -1
- package/lib/cjs/index.cjs +118 -54
- package/lib/esm/crypto-constants.mjs +462 -19
- package/lib/esm/index.mjs +118 -54
- package/package.json +1 -1
- package/types/cjs/index.d.cts +3 -3
- package/types/esm/index.d.mts +3 -3
package/lib/browser/formula.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @fileverse-dev/formulajs v4.4.11-mod-
|
|
1
|
+
/* @fileverse-dev/formulajs v4.4.11-mod-23 */
|
|
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,7 +10941,10 @@ 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"
|
|
10851
10948
|
};
|
|
10852
10949
|
var SERVICE_API_KEY = {
|
|
10853
10950
|
Etherscan: "ETHERSCAN_API_KEY",
|
|
@@ -10895,7 +10992,7 @@ function _typeof(o) {
|
|
|
10895
10992
|
return _BLOCKSCOUT.apply(this, arguments);
|
|
10896
10993
|
}
|
|
10897
10994
|
function _BLOCKSCOUT() {
|
|
10898
|
-
_BLOCKSCOUT = _asyncToGenerator(_regeneratorRuntime().mark((function _callee2(address, type, chain,
|
|
10995
|
+
_BLOCKSCOUT = _asyncToGenerator(_regeneratorRuntime().mark((function _callee2(address, type, chain, startTimestamp, endTimestamp, page, offset) {
|
|
10899
10996
|
var currentTimestamp, hostname, requestUrl, _json$result, _json$result2, response, json;
|
|
10900
10997
|
return _regeneratorRuntime().wrap((function _callee2$(_context2) {
|
|
10901
10998
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -10991,79 +11088,144 @@ function _typeof(o) {
|
|
|
10991
11088
|
})));
|
|
10992
11089
|
return _BLOCKSCOUT.apply(this, arguments);
|
|
10993
11090
|
}
|
|
10994
|
-
function ETHERSCAN(
|
|
11091
|
+
function ETHERSCAN() {
|
|
10995
11092
|
return _ETHERSCAN.apply(this, arguments);
|
|
10996
11093
|
}
|
|
10997
11094
|
function _ETHERSCAN() {
|
|
10998
|
-
_ETHERSCAN = _asyncToGenerator(_regeneratorRuntime().mark((function _callee3(
|
|
10999
|
-
var API_KEY, url, response, json;
|
|
11095
|
+
_ETHERSCAN = _asyncToGenerator(_regeneratorRuntime().mark((function _callee3() {
|
|
11096
|
+
var _len2, args, _key2, type, chain, address, startDate, endDate, API_KEY, chainId, action, url, startBlock, endBlock, response, json, _args3 = arguments;
|
|
11000
11097
|
return _regeneratorRuntime().wrap((function _callee3$(_context3) {
|
|
11001
11098
|
while (1) switch (_context3.prev = _context3.next) {
|
|
11002
11099
|
case 0:
|
|
11100
|
+
for (_len2 = _args3.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
11101
|
+
args[_key2] = _args3[_key2];
|
|
11102
|
+
}
|
|
11103
|
+
type = args[0], chain = args[1], address = args[2], startDate = args[3], endDate = args[4];
|
|
11003
11104
|
API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Etherscan);
|
|
11004
11105
|
if (API_KEY) {
|
|
11005
|
-
_context3.next =
|
|
11106
|
+
_context3.next = 5;
|
|
11006
11107
|
break;
|
|
11007
11108
|
}
|
|
11008
11109
|
return _context3.abrupt("return", "".concat(SERVICE_API_KEY.Etherscan).concat(ERROR_MESSAGES_FLAG.MISSING_KEY));
|
|
11009
11110
|
|
|
11010
|
-
case
|
|
11111
|
+
case 5:
|
|
11011
11112
|
if (!(API_KEY === "xxxx")) {
|
|
11012
|
-
_context3.next =
|
|
11113
|
+
_context3.next = 7;
|
|
11013
11114
|
break;
|
|
11014
11115
|
}
|
|
11015
11116
|
return _context3.abrupt("return", "".concat(SERVICE_API_KEY.Etherscan).concat(ERROR_MESSAGES_FLAG.RATE_LIMIT));
|
|
11016
11117
|
|
|
11017
|
-
case
|
|
11018
|
-
|
|
11019
|
-
|
|
11020
|
-
|
|
11118
|
+
case 7:
|
|
11119
|
+
chainId = CHAIN_ID_MAP[chain === null || chain === void 0 ? void 0 : chain.toLowerCase()];
|
|
11120
|
+
if (chainId) {
|
|
11121
|
+
_context3.next = 10;
|
|
11122
|
+
break;
|
|
11123
|
+
}
|
|
11124
|
+
return _context3.abrupt("return", "".concat(SERVICE_API_KEY.Etherscan).concat(ERROR_MESSAGES_FLAG.INVALID_CHAIN));
|
|
11125
|
+
|
|
11126
|
+
case 10:
|
|
11127
|
+
_context3.t0 = type;
|
|
11128
|
+
_context3.next = _context3.t0 === "all-txns" ? 13 : _context3.t0 === "token-txns" ? 15 : _context3.t0 === "nft-txns" ? 17 : _context3.t0 === "gas" ? 19 : 21;
|
|
11129
|
+
break;
|
|
11130
|
+
|
|
11131
|
+
case 13:
|
|
11132
|
+
action = "txlist";
|
|
11133
|
+
return _context3.abrupt("break", 22);
|
|
11134
|
+
|
|
11135
|
+
case 15:
|
|
11136
|
+
action = "tokentx";
|
|
11137
|
+
return _context3.abrupt("break", 22);
|
|
11138
|
+
|
|
11139
|
+
case 17:
|
|
11140
|
+
action = "tokennfttx";
|
|
11141
|
+
return _context3.abrupt("break", 22);
|
|
11142
|
+
|
|
11143
|
+
case 19:
|
|
11144
|
+
action = "gastracker";
|
|
11145
|
+
return _context3.abrupt("break", 22);
|
|
11146
|
+
|
|
11147
|
+
case 21:
|
|
11148
|
+
return _context3.abrupt("return", "".concat(SERVICE_API_KEY.Etherscan).concat(ERROR_MESSAGES_FLAG.INVALID_TYPE));
|
|
11149
|
+
|
|
11150
|
+
case 22:
|
|
11151
|
+
url = "https://api.etherscan.io/v2/api?chainid=".concat(chainId, "&module=account&action=").concat(action, "&apikey=").concat(API_KEY);
|
|
11152
|
+
if (![ "all-txns", "token-txns", "nft-txns" ].includes(type)) {
|
|
11153
|
+
_context3.next = 35;
|
|
11154
|
+
break;
|
|
11155
|
+
}
|
|
11156
|
+
if (address) {
|
|
11157
|
+
_context3.next = 26;
|
|
11158
|
+
break;
|
|
11159
|
+
}
|
|
11160
|
+
return _context3.abrupt("return", "".concat(SERVICE_API_KEY.Etherscan).concat(ERROR_MESSAGES_FLAG.INVALID_ADDRESS));
|
|
11161
|
+
|
|
11162
|
+
case 26:
|
|
11163
|
+
url += "&address=".concat(address, "&startblock=0&endblock=99999999&sort=asc");
|
|
11164
|
+
if (!(startDate && endDate && !isNaN(startDate) && !isNaN(endDate))) {
|
|
11165
|
+
_context3.next = 35;
|
|
11166
|
+
break;
|
|
11167
|
+
}
|
|
11168
|
+
_context3.next = 30;
|
|
11169
|
+
return fromTimeStampToBlock(startDate, chain, API_KEY);
|
|
11170
|
+
|
|
11171
|
+
case 30:
|
|
11172
|
+
startBlock = _context3.sent;
|
|
11173
|
+
_context3.next = 33;
|
|
11174
|
+
return fromTimeStampToBlock(endDate, chain, API_KEY);
|
|
11175
|
+
|
|
11176
|
+
case 33:
|
|
11177
|
+
endBlock = _context3.sent;
|
|
11178
|
+
url += "&startblock=".concat(startBlock, "&endblock=").concat(endBlock);
|
|
11179
|
+
|
|
11180
|
+
case 35:
|
|
11181
|
+
_context3.prev = 35;
|
|
11182
|
+
_context3.next = 38;
|
|
11021
11183
|
return fetch(url);
|
|
11022
11184
|
|
|
11023
|
-
case
|
|
11185
|
+
case 38:
|
|
11024
11186
|
response = _context3.sent;
|
|
11025
11187
|
if (response.ok) {
|
|
11026
|
-
_context3.next =
|
|
11188
|
+
_context3.next = 41;
|
|
11027
11189
|
break;
|
|
11028
11190
|
}
|
|
11029
11191
|
throw new Error("HTTP error! Status: ".concat(response.status));
|
|
11030
11192
|
|
|
11031
|
-
case
|
|
11032
|
-
_context3.next =
|
|
11193
|
+
case 41:
|
|
11194
|
+
_context3.next = 43;
|
|
11033
11195
|
return response.json();
|
|
11034
11196
|
|
|
11035
|
-
case
|
|
11197
|
+
case 43:
|
|
11036
11198
|
json = _context3.sent;
|
|
11037
|
-
if (!json.result.includes("Invalid API Key")) {
|
|
11038
|
-
_context3.next =
|
|
11199
|
+
if (!(typeof json.result === "string" && json.result.includes("Invalid API Key"))) {
|
|
11200
|
+
_context3.next = 46;
|
|
11039
11201
|
break;
|
|
11040
11202
|
}
|
|
11041
11203
|
return _context3.abrupt("return", "".concat(SERVICE_API_KEY.Etherscan).concat(ERROR_MESSAGES_FLAG.INVALID_API_KEY));
|
|
11042
11204
|
|
|
11043
|
-
case
|
|
11044
|
-
if (!json.result.includes("Max rate limit reached")) {
|
|
11045
|
-
_context3.next =
|
|
11205
|
+
case 46:
|
|
11206
|
+
if (!(typeof json.result === "string" && json.result.includes("Max rate limit reached"))) {
|
|
11207
|
+
_context3.next = 48;
|
|
11046
11208
|
break;
|
|
11047
11209
|
}
|
|
11048
11210
|
return _context3.abrupt("return", "".concat(SERVICE_API_KEY.Etherscan).concat(ERROR_MESSAGES_FLAG.RATE_LIMIT));
|
|
11049
11211
|
|
|
11050
|
-
case
|
|
11212
|
+
case 48:
|
|
11051
11213
|
return _context3.abrupt("return", json.result);
|
|
11052
11214
|
|
|
11053
|
-
case
|
|
11054
|
-
_context3.prev =
|
|
11055
|
-
_context3.
|
|
11215
|
+
case 51:
|
|
11216
|
+
_context3.prev = 51;
|
|
11217
|
+
_context3.t1 = _context3["catch"](35);
|
|
11056
11218
|
return _context3.abrupt("return", ERROR_MESSAGES_FLAG.DEFAULT);
|
|
11057
11219
|
|
|
11058
|
-
case
|
|
11220
|
+
case 54:
|
|
11059
11221
|
case "end":
|
|
11060
11222
|
return _context3.stop();
|
|
11061
11223
|
}
|
|
11062
|
-
}), _callee3, null, [ [
|
|
11224
|
+
}), _callee3, null, [ [ 35, 51 ] ]);
|
|
11063
11225
|
})));
|
|
11064
11226
|
return _ETHERSCAN.apply(this, arguments);
|
|
11065
11227
|
}
|
|
11066
|
-
function COINGECKO(
|
|
11228
|
+
function COINGECKO(_x1, _x10) {
|
|
11067
11229
|
return _COINGECKO.apply(this, arguments);
|
|
11068
11230
|
}
|
|
11069
11231
|
function _COINGECKO() {
|
|
@@ -11131,9 +11293,10 @@ function _typeof(o) {
|
|
|
11131
11293
|
case 23:
|
|
11132
11294
|
_context4.prev = 23;
|
|
11133
11295
|
_context4.t0 = _context4["catch"](3);
|
|
11296
|
+
console.log(_context4.t0);
|
|
11134
11297
|
return _context4.abrupt("return", ERROR_MESSAGES_FLAG.DEFAULT);
|
|
11135
11298
|
|
|
11136
|
-
case
|
|
11299
|
+
case 27:
|
|
11137
11300
|
case "end":
|
|
11138
11301
|
return _context4.stop();
|
|
11139
11302
|
}
|
|
@@ -11141,115 +11304,193 @@ function _typeof(o) {
|
|
|
11141
11304
|
})));
|
|
11142
11305
|
return _COINGECKO.apply(this, arguments);
|
|
11143
11306
|
}
|
|
11144
|
-
function EOA(
|
|
11307
|
+
function EOA(_x11, _x12, _x13, _x14, _x15) {
|
|
11145
11308
|
return _EOA.apply(this, arguments);
|
|
11146
11309
|
}
|
|
11147
11310
|
function _EOA() {
|
|
11148
|
-
_EOA = _asyncToGenerator(_regeneratorRuntime().mark((function _callee5(
|
|
11149
|
-
var
|
|
11311
|
+
_EOA = _asyncToGenerator(_regeneratorRuntime().mark((function _callee5(addresses, category, chains, startTime, endTime) {
|
|
11312
|
+
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;
|
|
11150
11313
|
return _regeneratorRuntime().wrap((function _callee5$(_context5) {
|
|
11151
11314
|
while (1) switch (_context5.prev = _context5.next) {
|
|
11152
11315
|
case 0:
|
|
11153
|
-
|
|
11154
|
-
|
|
11155
|
-
|
|
11156
|
-
|
|
11157
|
-
|
|
11158
|
-
|
|
11316
|
+
_context5.prev = 0;
|
|
11317
|
+
ADDRESSES = addresses.split(",").map((function(a) {
|
|
11318
|
+
return a.trim();
|
|
11319
|
+
}));
|
|
11320
|
+
CHAINS = typeof chains === "string" ? chains.split(",").map((function(c) {
|
|
11321
|
+
return c.trim();
|
|
11322
|
+
})) : chains;
|
|
11323
|
+
flatResults = [];
|
|
11324
|
+
API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Etherscan);
|
|
11325
|
+
if (API_KEY) {
|
|
11326
|
+
_context5.next = 7;
|
|
11327
|
+
break;
|
|
11328
|
+
}
|
|
11329
|
+
return _context5.abrupt("return", "".concat(SERVICE_API_KEY.Etherscan).concat(ERROR_MESSAGES_FLAG.MISSING_KEY));
|
|
11330
|
+
|
|
11331
|
+
case 7:
|
|
11332
|
+
_iterator = _createForOfIteratorHelper(CHAINS);
|
|
11333
|
+
_context5.prev = 8;
|
|
11334
|
+
_iterator.s();
|
|
11335
|
+
|
|
11336
|
+
case 10:
|
|
11337
|
+
if ((_step = _iterator.n()).done) {
|
|
11338
|
+
_context5.next = 67;
|
|
11339
|
+
break;
|
|
11340
|
+
}
|
|
11341
|
+
chain = _step.value;
|
|
11159
11342
|
chainId = CHAIN_ID_MAP[chain];
|
|
11160
|
-
if (
|
|
11161
|
-
_context5.next =
|
|
11343
|
+
if (chainId) {
|
|
11344
|
+
_context5.next = 15;
|
|
11162
11345
|
break;
|
|
11163
11346
|
}
|
|
11164
|
-
|
|
11347
|
+
throw new Error("Unsupported chain");
|
|
11165
11348
|
|
|
11166
|
-
case
|
|
11167
|
-
|
|
11168
|
-
|
|
11169
|
-
|
|
11349
|
+
case 15:
|
|
11350
|
+
_iterator2 = _createForOfIteratorHelper(ADDRESSES);
|
|
11351
|
+
_context5.prev = 16;
|
|
11352
|
+
_iterator2.s();
|
|
11353
|
+
|
|
11354
|
+
case 18:
|
|
11355
|
+
if ((_step2 = _iterator2.n()).done) {
|
|
11356
|
+
_context5.next = 57;
|
|
11357
|
+
break;
|
|
11170
11358
|
}
|
|
11359
|
+
address = _step2.value;
|
|
11360
|
+
action = category === "txns" ? "account.txlist" : "account.balance";
|
|
11171
11361
|
timeQuery = "";
|
|
11172
|
-
if (!(
|
|
11173
|
-
_context5.next =
|
|
11362
|
+
if (!(category === "txns")) {
|
|
11363
|
+
_context5.next = 32;
|
|
11174
11364
|
break;
|
|
11175
11365
|
}
|
|
11176
|
-
_context5.next =
|
|
11177
|
-
return fromTimeStampToBlock(startTime, chain,
|
|
11366
|
+
_context5.next = 25;
|
|
11367
|
+
return fromTimeStampToBlock(startTime, chain, API_KEY);
|
|
11178
11368
|
|
|
11179
|
-
case
|
|
11369
|
+
case 25:
|
|
11180
11370
|
startBlock = _context5.sent;
|
|
11181
|
-
_context5.next =
|
|
11182
|
-
return fromTimeStampToBlock(endTime, chain,
|
|
11371
|
+
_context5.next = 28;
|
|
11372
|
+
return fromTimeStampToBlock(endTime, chain, API_KEY);
|
|
11183
11373
|
|
|
11184
|
-
case
|
|
11374
|
+
case 28:
|
|
11185
11375
|
endBlock = _context5.sent;
|
|
11186
11376
|
timeQuery = "&startblock=".concat(startBlock, "&endblock=").concat(endBlock);
|
|
11187
|
-
_context5.next =
|
|
11377
|
+
_context5.next = 33;
|
|
11188
11378
|
break;
|
|
11189
11379
|
|
|
11190
|
-
case
|
|
11191
|
-
if (!(categories === "balance")) {
|
|
11192
|
-
_context5.next = 22;
|
|
11193
|
-
break;
|
|
11194
|
-
}
|
|
11380
|
+
case 32:
|
|
11195
11381
|
timeQuery = "&tag=latest";
|
|
11196
|
-
_context5.next = 23;
|
|
11197
|
-
break;
|
|
11198
|
-
|
|
11199
|
-
case 22:
|
|
11200
|
-
throw new Error("Start and End Time is required for querying transaction list ");
|
|
11201
11382
|
|
|
11202
|
-
case
|
|
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(
|
|
11204
|
-
_context5.prev =
|
|
11205
|
-
_context5.next =
|
|
11383
|
+
case 33:
|
|
11384
|
+
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);
|
|
11385
|
+
_context5.prev = 34;
|
|
11386
|
+
_context5.next = 37;
|
|
11206
11387
|
return fetch(url);
|
|
11207
11388
|
|
|
11208
|
-
case
|
|
11389
|
+
case 37:
|
|
11209
11390
|
response = _context5.sent;
|
|
11210
11391
|
if (response.ok) {
|
|
11211
|
-
_context5.next =
|
|
11392
|
+
_context5.next = 40;
|
|
11212
11393
|
break;
|
|
11213
11394
|
}
|
|
11214
|
-
|
|
11395
|
+
return _context5.abrupt("return", "HTTP_".concat(response.status));
|
|
11215
11396
|
|
|
11216
|
-
case
|
|
11217
|
-
_context5.next =
|
|
11397
|
+
case 40:
|
|
11398
|
+
_context5.next = 42;
|
|
11218
11399
|
return response.json();
|
|
11219
11400
|
|
|
11220
|
-
case
|
|
11401
|
+
case 42:
|
|
11221
11402
|
json = _context5.sent;
|
|
11222
11403
|
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 =
|
|
11404
|
+
_context5.next = 45;
|
|
11224
11405
|
break;
|
|
11225
11406
|
}
|
|
11226
|
-
return _context5.abrupt("return", "".concat(SERVICE_API_KEY
|
|
11407
|
+
return _context5.abrupt("return", "".concat(SERVICE_API_KEY.Etherscan).concat(ERROR_MESSAGES_FLAG.INVALID_API_KEY));
|
|
11227
11408
|
|
|
11228
|
-
case
|
|
11229
|
-
if (!json.result.includes("Max rate limit reached")) {
|
|
11230
|
-
_context5.next =
|
|
11409
|
+
case 45:
|
|
11410
|
+
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"))) {
|
|
11411
|
+
_context5.next = 47;
|
|
11231
11412
|
break;
|
|
11232
11413
|
}
|
|
11233
11414
|
return _context5.abrupt("return", "".concat(SERVICE_API_KEY.Etherscan).concat(ERROR_MESSAGES_FLAG.RATE_LIMIT));
|
|
11234
11415
|
|
|
11235
|
-
case
|
|
11236
|
-
|
|
11416
|
+
case 47:
|
|
11417
|
+
entries = Array.isArray(json.result) ? json.result : [ json.result ];
|
|
11418
|
+
_iterator3 = _createForOfIteratorHelper(entries);
|
|
11419
|
+
try {
|
|
11420
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done; ) {
|
|
11421
|
+
entry = _step3.value;
|
|
11422
|
+
flatResults.push(_objectSpread({
|
|
11423
|
+
chain: chain,
|
|
11424
|
+
address: address
|
|
11425
|
+
}, entry));
|
|
11426
|
+
}
|
|
11427
|
+
} catch (err) {
|
|
11428
|
+
_iterator3.e(err);
|
|
11429
|
+
} finally {
|
|
11430
|
+
_iterator3.f();
|
|
11431
|
+
}
|
|
11432
|
+
_context5.next = 55;
|
|
11433
|
+
break;
|
|
11237
11434
|
|
|
11238
|
-
case
|
|
11239
|
-
_context5.prev =
|
|
11240
|
-
_context5.t0 = _context5["catch"](
|
|
11241
|
-
|
|
11435
|
+
case 52:
|
|
11436
|
+
_context5.prev = 52;
|
|
11437
|
+
_context5.t0 = _context5["catch"](34);
|
|
11438
|
+
return _context5.abrupt("return", ERROR_MESSAGES_FLAG.DEFAULT);
|
|
11439
|
+
|
|
11440
|
+
case 55:
|
|
11441
|
+
_context5.next = 18;
|
|
11442
|
+
break;
|
|
11443
|
+
|
|
11444
|
+
case 57:
|
|
11445
|
+
_context5.next = 62;
|
|
11446
|
+
break;
|
|
11447
|
+
|
|
11448
|
+
case 59:
|
|
11449
|
+
_context5.prev = 59;
|
|
11450
|
+
_context5.t1 = _context5["catch"](16);
|
|
11451
|
+
_iterator2.e(_context5.t1);
|
|
11452
|
+
|
|
11453
|
+
case 62:
|
|
11454
|
+
_context5.prev = 62;
|
|
11455
|
+
_iterator2.f();
|
|
11456
|
+
return _context5.finish(62);
|
|
11457
|
+
|
|
11458
|
+
case 65:
|
|
11459
|
+
_context5.next = 10;
|
|
11460
|
+
break;
|
|
11461
|
+
|
|
11462
|
+
case 67:
|
|
11463
|
+
_context5.next = 72;
|
|
11464
|
+
break;
|
|
11465
|
+
|
|
11466
|
+
case 69:
|
|
11467
|
+
_context5.prev = 69;
|
|
11468
|
+
_context5.t2 = _context5["catch"](8);
|
|
11469
|
+
_iterator.e(_context5.t2);
|
|
11470
|
+
|
|
11471
|
+
case 72:
|
|
11472
|
+
_context5.prev = 72;
|
|
11473
|
+
_iterator.f();
|
|
11474
|
+
return _context5.finish(72);
|
|
11475
|
+
|
|
11476
|
+
case 75:
|
|
11477
|
+
return _context5.abrupt("return", flatResults);
|
|
11478
|
+
|
|
11479
|
+
case 78:
|
|
11480
|
+
_context5.prev = 78;
|
|
11481
|
+
_context5.t3 = _context5["catch"](0);
|
|
11482
|
+
console.log(_context5.t3);
|
|
11242
11483
|
return _context5.abrupt("return", ERROR_MESSAGES_FLAG.DEFAULT);
|
|
11243
11484
|
|
|
11244
|
-
case
|
|
11485
|
+
case 82:
|
|
11245
11486
|
case "end":
|
|
11246
11487
|
return _context5.stop();
|
|
11247
11488
|
}
|
|
11248
|
-
}), _callee5, null, [ [
|
|
11489
|
+
}), _callee5, null, [ [ 0, 78 ], [ 8, 69, 72, 75 ], [ 16, 59, 62, 65 ], [ 34, 52 ] ]);
|
|
11249
11490
|
})));
|
|
11250
11491
|
return _EOA.apply(this, arguments);
|
|
11251
11492
|
}
|
|
11252
|
-
function FLVURL(
|
|
11493
|
+
function FLVURL(_x16, _x17) {
|
|
11253
11494
|
return _FLVURL.apply(this, arguments);
|
|
11254
11495
|
}
|
|
11255
11496
|
function _FLVURL() {
|
|
@@ -11273,7 +11514,7 @@ function _typeof(o) {
|
|
|
11273
11514
|
})));
|
|
11274
11515
|
return _FLVURL.apply(this, arguments);
|
|
11275
11516
|
}
|
|
11276
|
-
function SAFE(
|
|
11517
|
+
function SAFE(_x18, _x19, _x20, _x21, _x22) {
|
|
11277
11518
|
return _SAFE.apply(this, arguments);
|
|
11278
11519
|
}
|
|
11279
11520
|
function _SAFE() {
|