@fileverse-dev/formulajs 4.4.11-mod-0 → 4.4.11-mod-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.
- package/lib/browser/formula.js +59 -94
- package/lib/browser/formula.min.js +2 -2
- package/lib/browser/formula.min.js.map +1 -1
- package/lib/cjs/index.cjs +27 -38
- package/lib/esm/index.mjs +27 -38
- package/package.json +1 -1
- package/types/cjs/index.d.cts +3 -1
- package/types/esm/index.d.mts +3 -1
package/lib/browser/formula.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @
|
|
1
|
+
/* @fileverse-dev/formulajs v4.4.11-mod-1 */
|
|
2
2
|
function _regeneratorRuntime() {
|
|
3
3
|
"use strict";
|
|
4
4
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() {
|
|
@@ -7468,98 +7468,6 @@ function _typeof(o) {
|
|
|
7468
7468
|
}));
|
|
7469
7469
|
return result;
|
|
7470
7470
|
}
|
|
7471
|
-
function INTERNALTX(_x) {
|
|
7472
|
-
return _INTERNALTX.apply(this, arguments);
|
|
7473
|
-
}
|
|
7474
|
-
function _INTERNALTX() {
|
|
7475
|
-
_INTERNALTX = _asyncToGenerator(_regeneratorRuntime().mark((function _callee(tx) {
|
|
7476
|
-
var url, response, json;
|
|
7477
|
-
return _regeneratorRuntime().wrap((function _callee$(_context) {
|
|
7478
|
-
while (1) switch (_context.prev = _context.next) {
|
|
7479
|
-
case 0:
|
|
7480
|
-
console.log("called internal tx", tx);
|
|
7481
|
-
url = "https://api.etherscan.io/api?module=account&action=txlistinternal&txhash=".concat(tx, "&apikey=J9JHHA7TBTKXGTZGPJV2PHV7S2RTJI2BYN");
|
|
7482
|
-
_context.prev = 2;
|
|
7483
|
-
_context.next = 5;
|
|
7484
|
-
return fetch(url);
|
|
7485
|
-
|
|
7486
|
-
case 5:
|
|
7487
|
-
response = _context.sent;
|
|
7488
|
-
if (response.ok) {
|
|
7489
|
-
_context.next = 8;
|
|
7490
|
-
break;
|
|
7491
|
-
}
|
|
7492
|
-
throw new Error("HTTP error! Status: ".concat(response.status));
|
|
7493
|
-
|
|
7494
|
-
case 8:
|
|
7495
|
-
_context.next = 10;
|
|
7496
|
-
return response.json();
|
|
7497
|
-
|
|
7498
|
-
case 10:
|
|
7499
|
-
json = _context.sent;
|
|
7500
|
-
console.log(json.result);
|
|
7501
|
-
return _context.abrupt("return", json.result);
|
|
7502
|
-
|
|
7503
|
-
case 15:
|
|
7504
|
-
_context.prev = 15;
|
|
7505
|
-
_context.t0 = _context["catch"](2);
|
|
7506
|
-
console.error("API call failed:", _context.t0);
|
|
7507
|
-
return _context.abrupt("return", []);
|
|
7508
|
-
|
|
7509
|
-
case 19:
|
|
7510
|
-
case "end":
|
|
7511
|
-
return _context.stop();
|
|
7512
|
-
}
|
|
7513
|
-
}), _callee, null, [ [ 2, 15 ] ]);
|
|
7514
|
-
})));
|
|
7515
|
-
return _INTERNALTX.apply(this, arguments);
|
|
7516
|
-
}
|
|
7517
|
-
function GETTXLIST(_x2, _x3, _x4) {
|
|
7518
|
-
return _GETTXLIST.apply(this, arguments);
|
|
7519
|
-
}
|
|
7520
|
-
function _GETTXLIST() {
|
|
7521
|
-
_GETTXLIST = _asyncToGenerator(_regeneratorRuntime().mark((function _callee2(address, page, offset) {
|
|
7522
|
-
var url, response, json;
|
|
7523
|
-
return _regeneratorRuntime().wrap((function _callee2$(_context2) {
|
|
7524
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
7525
|
-
case 0:
|
|
7526
|
-
console.log("called internal tx", address);
|
|
7527
|
-
url = "https://api.etherscan.io/api?module=account&action=txlist&address=".concat(address, "&startblock=0&endblock=99999999&page=").concat(page, "&offset=").concat(offset, "&sort=asc&apikey=J9JHHA7TBTKXGTZGPJV2PHV7S2RTJI2BYN");
|
|
7528
|
-
_context2.prev = 2;
|
|
7529
|
-
_context2.next = 5;
|
|
7530
|
-
return fetch(url);
|
|
7531
|
-
|
|
7532
|
-
case 5:
|
|
7533
|
-
response = _context2.sent;
|
|
7534
|
-
if (response.ok) {
|
|
7535
|
-
_context2.next = 8;
|
|
7536
|
-
break;
|
|
7537
|
-
}
|
|
7538
|
-
throw new Error("HTTP error! Status: ".concat(response.status));
|
|
7539
|
-
|
|
7540
|
-
case 8:
|
|
7541
|
-
_context2.next = 10;
|
|
7542
|
-
return response.json();
|
|
7543
|
-
|
|
7544
|
-
case 10:
|
|
7545
|
-
json = _context2.sent;
|
|
7546
|
-
console.log(json.result);
|
|
7547
|
-
return _context2.abrupt("return", json.result);
|
|
7548
|
-
|
|
7549
|
-
case 15:
|
|
7550
|
-
_context2.prev = 15;
|
|
7551
|
-
_context2.t0 = _context2["catch"](2);
|
|
7552
|
-
console.error("API call failed:", _context2.t0);
|
|
7553
|
-
return _context2.abrupt("return", []);
|
|
7554
|
-
|
|
7555
|
-
case 19:
|
|
7556
|
-
case "end":
|
|
7557
|
-
return _context2.stop();
|
|
7558
|
-
}
|
|
7559
|
-
}), _callee2, null, [ [ 2, 15 ] ]);
|
|
7560
|
-
})));
|
|
7561
|
-
return _GETTXLIST.apply(this, arguments);
|
|
7562
|
-
}
|
|
7563
7471
|
function SUMIF(range, criteria, sum_range) {
|
|
7564
7472
|
range = flatten(range);
|
|
7565
7473
|
sum_range = sum_range ? flatten(sum_range) : range;
|
|
@@ -10874,6 +10782,63 @@ function _typeof(o) {
|
|
|
10874
10782
|
}
|
|
10875
10783
|
return result;
|
|
10876
10784
|
}
|
|
10785
|
+
var SERVICE_API_KEY = {
|
|
10786
|
+
Etherscan: "ETHERSCAN_API_KEY"
|
|
10787
|
+
};
|
|
10788
|
+
function GETTXLIST(_x, _x2, _x3) {
|
|
10789
|
+
return _GETTXLIST.apply(this, arguments);
|
|
10790
|
+
}
|
|
10791
|
+
function _GETTXLIST() {
|
|
10792
|
+
_GETTXLIST = _asyncToGenerator(_regeneratorRuntime().mark((function _callee(address, page, offset) {
|
|
10793
|
+
var API_KEY, url, response, json;
|
|
10794
|
+
return _regeneratorRuntime().wrap((function _callee$(_context) {
|
|
10795
|
+
while (1) switch (_context.prev = _context.next) {
|
|
10796
|
+
case 0:
|
|
10797
|
+
API_KEY = window.localStorage.getItem("ETHERSCAN_API_KEY");
|
|
10798
|
+
console.log("FORMULA JS API KEY ETHERSCAN NOT FOUND", API_KEY);
|
|
10799
|
+
url = "https://api.etherscan.io/api?module=account&action=txlist&address=".concat(address, "&startblock=0&endblock=99999999&page=").concat(page, "&offset=").concat(offset, "&sort=asc&apikey=").concat(API_KEY);
|
|
10800
|
+
_context.prev = 3;
|
|
10801
|
+
_context.next = 6;
|
|
10802
|
+
return fetch(url);
|
|
10803
|
+
|
|
10804
|
+
case 6:
|
|
10805
|
+
response = _context.sent;
|
|
10806
|
+
if (response.ok) {
|
|
10807
|
+
_context.next = 9;
|
|
10808
|
+
break;
|
|
10809
|
+
}
|
|
10810
|
+
throw new Error("HTTP error! Status: ".concat(response.status));
|
|
10811
|
+
|
|
10812
|
+
case 9:
|
|
10813
|
+
_context.next = 11;
|
|
10814
|
+
return response.json();
|
|
10815
|
+
|
|
10816
|
+
case 11:
|
|
10817
|
+
json = _context.sent;
|
|
10818
|
+
console.log(json.result);
|
|
10819
|
+
if (!json.result.includes("Invalid API Key")) {
|
|
10820
|
+
_context.next = 15;
|
|
10821
|
+
break;
|
|
10822
|
+
}
|
|
10823
|
+
return _context.abrupt("return", "".concat(SERVICE_API_KEY.Etherscan, "_MISSING"));
|
|
10824
|
+
|
|
10825
|
+
case 15:
|
|
10826
|
+
return _context.abrupt("return", json.result);
|
|
10827
|
+
|
|
10828
|
+
case 18:
|
|
10829
|
+
_context.prev = 18;
|
|
10830
|
+
_context.t0 = _context["catch"](3);
|
|
10831
|
+
console.error("API call failed:", _context.t0);
|
|
10832
|
+
return _context.abrupt("return", "ERROR IN FETCHING");
|
|
10833
|
+
|
|
10834
|
+
case 22:
|
|
10835
|
+
case "end":
|
|
10836
|
+
return _context.stop();
|
|
10837
|
+
}
|
|
10838
|
+
}), _callee, null, [ [ 3, 18 ] ]);
|
|
10839
|
+
})));
|
|
10840
|
+
return _GETTXLIST.apply(this, arguments);
|
|
10841
|
+
}
|
|
10877
10842
|
var utils = {
|
|
10878
10843
|
errors: errors,
|
|
10879
10844
|
symbols: symbols
|
|
@@ -11086,7 +11051,6 @@ function _typeof(o) {
|
|
|
11086
11051
|
exports.INFO = INFO;
|
|
11087
11052
|
exports.INT = INT;
|
|
11088
11053
|
exports.INTERCEPT = INTERCEPT;
|
|
11089
|
-
exports.INTERNALTX = INTERNALTX;
|
|
11090
11054
|
exports.INTRATE = INTRATE;
|
|
11091
11055
|
exports.IPMT = IPMT;
|
|
11092
11056
|
exports.IRR = IRR;
|
|
@@ -11221,6 +11185,7 @@ function _typeof(o) {
|
|
|
11221
11185
|
exports.SECH = SECH;
|
|
11222
11186
|
exports.SECOND = SECOND;
|
|
11223
11187
|
exports.SERIESSUM = SERIESSUM;
|
|
11188
|
+
exports.SERVICE_API_KEY = SERVICE_API_KEY;
|
|
11224
11189
|
exports.SHEET = SHEET;
|
|
11225
11190
|
exports.SHEETS = SHEETS;
|
|
11226
11191
|
exports.SIGN = SIGN;
|