@fileverse-dev/formulajs 4.4.11-mod-0 → 4.4.11-mod-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/lib/browser/formula.js +86 -94
- package/lib/browser/formula.min.js +2 -2
- package/lib/browser/formula.min.js.map +1 -1
- package/lib/cjs/index.cjs +62 -38
- package/lib/esm/index.mjs +61 -38
- package/package.json +1 -1
- package/types/cjs/index.d.cts +24 -1
- package/types/esm/index.d.mts +24 -1
package/lib/browser/formula.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @
|
|
1
|
+
/* @fileverse-dev/formulajs v4.4.11-mod-2 */
|
|
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,89 @@ function _typeof(o) {
|
|
|
10874
10782
|
}
|
|
10875
10783
|
return result;
|
|
10876
10784
|
}
|
|
10785
|
+
var SERVICE_API_KEY = {
|
|
10786
|
+
Etherscan: "ETHERSCAN_API_KEY"
|
|
10787
|
+
};
|
|
10788
|
+
var FUNCTION_LOCALE = [ {
|
|
10789
|
+
n: "GETTXLIST",
|
|
10790
|
+
t: 20,
|
|
10791
|
+
d: "Returns the list of transactions performed by an address, with optional pagination.",
|
|
10792
|
+
a: "Returns the list of transactions performed by an address, with optional pagination.",
|
|
10793
|
+
p: [ {
|
|
10794
|
+
name: "value1",
|
|
10795
|
+
detail: "The address string representing the addresses to check for balance",
|
|
10796
|
+
example: '"0xc5102fE9359FD9a28f877a67E36B0F050d81a3CC"',
|
|
10797
|
+
require: "m"
|
|
10798
|
+
}, {
|
|
10799
|
+
name: "value2",
|
|
10800
|
+
detail: "Page number.",
|
|
10801
|
+
example: "1",
|
|
10802
|
+
require: "o",
|
|
10803
|
+
repeat: "n",
|
|
10804
|
+
type: "rangenumber"
|
|
10805
|
+
}, {
|
|
10806
|
+
name: "value3",
|
|
10807
|
+
detail: "Page size(offset).",
|
|
10808
|
+
example: "100",
|
|
10809
|
+
require: "o",
|
|
10810
|
+
repeat: "n",
|
|
10811
|
+
type: "rangenumber"
|
|
10812
|
+
} ]
|
|
10813
|
+
} ];
|
|
10814
|
+
function GETTXLIST(_x, _x2, _x3) {
|
|
10815
|
+
return _GETTXLIST.apply(this, arguments);
|
|
10816
|
+
}
|
|
10817
|
+
function _GETTXLIST() {
|
|
10818
|
+
_GETTXLIST = _asyncToGenerator(_regeneratorRuntime().mark((function _callee(address, page, offset) {
|
|
10819
|
+
var API_KEY, url, response, json;
|
|
10820
|
+
return _regeneratorRuntime().wrap((function _callee$(_context) {
|
|
10821
|
+
while (1) switch (_context.prev = _context.next) {
|
|
10822
|
+
case 0:
|
|
10823
|
+
API_KEY = window.localStorage.getItem("ETHERSCAN_API_KEY");
|
|
10824
|
+
console.log("FORMULA JS API KEY ETHERSCAN NOT FOUND", API_KEY);
|
|
10825
|
+
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);
|
|
10826
|
+
_context.prev = 3;
|
|
10827
|
+
_context.next = 6;
|
|
10828
|
+
return fetch(url);
|
|
10829
|
+
|
|
10830
|
+
case 6:
|
|
10831
|
+
response = _context.sent;
|
|
10832
|
+
if (response.ok) {
|
|
10833
|
+
_context.next = 9;
|
|
10834
|
+
break;
|
|
10835
|
+
}
|
|
10836
|
+
throw new Error("HTTP error! Status: ".concat(response.status));
|
|
10837
|
+
|
|
10838
|
+
case 9:
|
|
10839
|
+
_context.next = 11;
|
|
10840
|
+
return response.json();
|
|
10841
|
+
|
|
10842
|
+
case 11:
|
|
10843
|
+
json = _context.sent;
|
|
10844
|
+
console.log(json.result);
|
|
10845
|
+
if (!json.result.includes("Invalid API Key")) {
|
|
10846
|
+
_context.next = 15;
|
|
10847
|
+
break;
|
|
10848
|
+
}
|
|
10849
|
+
return _context.abrupt("return", "".concat(SERVICE_API_KEY.Etherscan, "_MISSING"));
|
|
10850
|
+
|
|
10851
|
+
case 15:
|
|
10852
|
+
return _context.abrupt("return", json.result);
|
|
10853
|
+
|
|
10854
|
+
case 18:
|
|
10855
|
+
_context.prev = 18;
|
|
10856
|
+
_context.t0 = _context["catch"](3);
|
|
10857
|
+
console.error("API call failed:", _context.t0);
|
|
10858
|
+
return _context.abrupt("return", "ERROR IN FETCHING");
|
|
10859
|
+
|
|
10860
|
+
case 22:
|
|
10861
|
+
case "end":
|
|
10862
|
+
return _context.stop();
|
|
10863
|
+
}
|
|
10864
|
+
}), _callee, null, [ [ 3, 18 ] ]);
|
|
10865
|
+
})));
|
|
10866
|
+
return _GETTXLIST.apply(this, arguments);
|
|
10867
|
+
}
|
|
10877
10868
|
var utils = {
|
|
10878
10869
|
errors: errors,
|
|
10879
10870
|
symbols: symbols
|
|
@@ -11032,6 +11023,7 @@ function _typeof(o) {
|
|
|
11032
11023
|
exports.FORECAST = FORECAST;
|
|
11033
11024
|
exports.FREQUENCY = FREQUENCY;
|
|
11034
11025
|
exports.FTEST = FTEST;
|
|
11026
|
+
exports.FUNCTION_LOCALE = FUNCTION_LOCALE;
|
|
11035
11027
|
exports.FV = FV;
|
|
11036
11028
|
exports.FVSCHEDULE = FVSCHEDULE;
|
|
11037
11029
|
exports.GAMMA = GAMMA;
|
|
@@ -11086,7 +11078,6 @@ function _typeof(o) {
|
|
|
11086
11078
|
exports.INFO = INFO;
|
|
11087
11079
|
exports.INT = INT;
|
|
11088
11080
|
exports.INTERCEPT = INTERCEPT;
|
|
11089
|
-
exports.INTERNALTX = INTERNALTX;
|
|
11090
11081
|
exports.INTRATE = INTRATE;
|
|
11091
11082
|
exports.IPMT = IPMT;
|
|
11092
11083
|
exports.IRR = IRR;
|
|
@@ -11221,6 +11212,7 @@ function _typeof(o) {
|
|
|
11221
11212
|
exports.SECH = SECH;
|
|
11222
11213
|
exports.SECOND = SECOND;
|
|
11223
11214
|
exports.SERIESSUM = SERIESSUM;
|
|
11215
|
+
exports.SERVICE_API_KEY = SERVICE_API_KEY;
|
|
11224
11216
|
exports.SHEET = SHEET;
|
|
11225
11217
|
exports.SHEETS = SHEETS;
|
|
11226
11218
|
exports.SIGN = SIGN;
|