@fileverse-dev/fortune-react 1.0.2-mod-66-patch-1 → 1.0.2-mod-66-patch-2
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/dist/index.umd.js +49 -9
- package/dist/index.umd.min.js +6 -6
- package/package.json +2 -2
package/dist/index.umd.js
CHANGED
|
@@ -35353,12 +35353,52 @@
|
|
|
35353
35353
|
}
|
|
35354
35354
|
function _ETHERSCAN() {
|
|
35355
35355
|
_ETHERSCAN = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(address, page, offset) {
|
|
35356
|
+
var API_KEY, url, response, json, _t;
|
|
35356
35357
|
return _regenerator().w(function (_context2) {
|
|
35357
35358
|
while (1) switch (_context2.n) {
|
|
35358
35359
|
case 0:
|
|
35360
|
+
API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Etherscan);
|
|
35361
|
+
if (!(API_KEY === 'xxxx')) {
|
|
35362
|
+
_context2.n = 1;
|
|
35363
|
+
break;
|
|
35364
|
+
}
|
|
35359
35365
|
return _context2.a(2, "".concat(SERVICE_API_KEY.Etherscan).concat(ERROR_MESSAGES_FLAG.RATE_LIMIT));
|
|
35366
|
+
case 1:
|
|
35367
|
+
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);
|
|
35368
|
+
_context2.p = 2;
|
|
35369
|
+
_context2.n = 3;
|
|
35370
|
+
return fetch(url);
|
|
35371
|
+
case 3:
|
|
35372
|
+
response = _context2.v;
|
|
35373
|
+
if (response.ok) {
|
|
35374
|
+
_context2.n = 4;
|
|
35375
|
+
break;
|
|
35376
|
+
}
|
|
35377
|
+
throw new Error("HTTP error! Status: ".concat(response.status));
|
|
35378
|
+
case 4:
|
|
35379
|
+
_context2.n = 5;
|
|
35380
|
+
return response.json();
|
|
35381
|
+
case 5:
|
|
35382
|
+
json = _context2.v;
|
|
35383
|
+
if (!json.result.includes("Invalid API Key")) {
|
|
35384
|
+
_context2.n = 6;
|
|
35385
|
+
break;
|
|
35386
|
+
}
|
|
35387
|
+
return _context2.a(2, "".concat(SERVICE_API_KEY.Etherscan).concat(ERROR_MESSAGES_FLAG.INVALID_API_KEY));
|
|
35388
|
+
case 6:
|
|
35389
|
+
if (!json.result.includes('Max rate limit reached')) {
|
|
35390
|
+
_context2.n = 7;
|
|
35391
|
+
break;
|
|
35392
|
+
}
|
|
35393
|
+
return _context2.a(2, "".concat(SERVICE_API_KEY.Etherscan).concat(ERROR_MESSAGES_FLAG.RATE_LIMIT));
|
|
35394
|
+
case 7:
|
|
35395
|
+
return _context2.a(2, json.result);
|
|
35396
|
+
case 8:
|
|
35397
|
+
_context2.p = 8;
|
|
35398
|
+
_t = _context2.v;
|
|
35399
|
+
return _context2.a(2, ERROR_MESSAGES_FLAG.DEFAULT);
|
|
35360
35400
|
}
|
|
35361
|
-
}, _callee2);
|
|
35401
|
+
}, _callee2, null, [[2, 8]]);
|
|
35362
35402
|
}));
|
|
35363
35403
|
return _ETHERSCAN.apply(this, arguments);
|
|
35364
35404
|
}
|
|
@@ -35367,7 +35407,7 @@
|
|
|
35367
35407
|
}
|
|
35368
35408
|
function _COINGECKO() {
|
|
35369
35409
|
_COINGECKO = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(token, vs_currencies) {
|
|
35370
|
-
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,
|
|
35410
|
+
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, _t2;
|
|
35371
35411
|
return _regenerator().w(function (_context3) {
|
|
35372
35412
|
while (1) switch (_context3.n) {
|
|
35373
35413
|
case 0:
|
|
@@ -35425,7 +35465,7 @@
|
|
|
35425
35465
|
return _context3.a(2, [output]);
|
|
35426
35466
|
case 7:
|
|
35427
35467
|
_context3.p = 7;
|
|
35428
|
-
|
|
35468
|
+
_t2 = _context3.v;
|
|
35429
35469
|
return _context3.a(2, ERROR_MESSAGES_FLAG.DEFAULT);
|
|
35430
35470
|
}
|
|
35431
35471
|
}, _callee3, null, [[1, 7]]);
|
|
@@ -35437,7 +35477,7 @@
|
|
|
35437
35477
|
}
|
|
35438
35478
|
function _EOA() {
|
|
35439
35479
|
_EOA = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(address, categories, chain, startTime, endTime) {
|
|
35440
|
-
var API_KEYS, apiKey, chainId, action, timeQuery, startBlock, endBlock, url, _json$result, _json$result$includes, response, json,
|
|
35480
|
+
var API_KEYS, apiKey, chainId, action, timeQuery, startBlock, endBlock, url, _json$result, _json$result$includes, response, json, _t3;
|
|
35441
35481
|
return _regenerator().w(function (_context4) {
|
|
35442
35482
|
while (1) switch (_context4.n) {
|
|
35443
35483
|
case 0:
|
|
@@ -35516,8 +35556,8 @@
|
|
|
35516
35556
|
return _context4.a(2, json.result);
|
|
35517
35557
|
case 13:
|
|
35518
35558
|
_context4.p = 13;
|
|
35519
|
-
|
|
35520
|
-
console.log(
|
|
35559
|
+
_t3 = _context4.v;
|
|
35560
|
+
console.log(_t3);
|
|
35521
35561
|
return _context4.a(2, ERROR_MESSAGES_FLAG.DEFAULT);
|
|
35522
35562
|
}
|
|
35523
35563
|
}, _callee4, null, [[7, 13]]);
|
|
@@ -35549,7 +35589,7 @@
|
|
|
35549
35589
|
}
|
|
35550
35590
|
function _SAFE() {
|
|
35551
35591
|
_SAFE = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6(address, utility, chain, limit, offset) {
|
|
35552
|
-
var apiKey, chainIdentifier, url, response, json,
|
|
35592
|
+
var apiKey, chainIdentifier, url, response, json, _t4;
|
|
35553
35593
|
return _regenerator().w(function (_context6) {
|
|
35554
35594
|
while (1) switch (_context6.n) {
|
|
35555
35595
|
case 0:
|
|
@@ -35619,8 +35659,8 @@
|
|
|
35619
35659
|
}));
|
|
35620
35660
|
case 11:
|
|
35621
35661
|
_context6.p = 11;
|
|
35622
|
-
|
|
35623
|
-
console.log(
|
|
35662
|
+
_t4 = _context6.v;
|
|
35663
|
+
console.log(_t4);
|
|
35624
35664
|
return _context6.a(2, "ERROR IN FETCHING");
|
|
35625
35665
|
}
|
|
35626
35666
|
}, _callee6, null, [[6, 11]]);
|