@fileverse-dev/formulajs 4.4.11-mod-40 → 4.4.11-mod-41-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.
- package/lib/browser/formula.js +147 -21
- package/lib/browser/formula.min.js +2 -2
- package/lib/browser/formula.min.js.map +1 -1
- package/lib/cjs/index.cjs +50 -10
- package/lib/esm/crypto-constants.mjs +236 -184
- package/lib/esm/index.mjs +45 -11
- package/package.json +1 -1
- package/types/cjs/index.d.cts +6 -0
- package/types/esm/index.d.mts +6 -0
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-41-patch-1 */
|
|
2
2
|
var _excluded = [ "confirmations", "dataDecoded" ];
|
|
3
3
|
|
|
4
4
|
function _objectWithoutProperties(e, t) {
|
|
@@ -115,6 +115,10 @@ function _createForOfIteratorHelper(r, e) {
|
|
|
115
115
|
};
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
+
function _readOnlyError(r) {
|
|
119
|
+
throw new TypeError('"' + r + '" is read-only');
|
|
120
|
+
}
|
|
121
|
+
|
|
118
122
|
function _regeneratorRuntime() {
|
|
119
123
|
"use strict";
|
|
120
124
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() {
|
|
@@ -10943,7 +10947,8 @@ function _typeof(o) {
|
|
|
10943
10947
|
Basescan: "BASESCAN_API_KEY",
|
|
10944
10948
|
Gnosisscan: "GNOSIS_API_KEY",
|
|
10945
10949
|
Firefly: "FIRE_FLY_API_KEY",
|
|
10946
|
-
GnosisPay: "GNOSIS_API_KEY"
|
|
10950
|
+
GnosisPay: "GNOSIS_API_KEY",
|
|
10951
|
+
Neynar: "NEYNAR_API_KEY"
|
|
10947
10952
|
};
|
|
10948
10953
|
var fromTimeStampToBlock = function() {
|
|
10949
10954
|
var _ref = _asyncToGenerator(_regeneratorRuntime().mark((function _callee(timestamp, chain, apiKey) {
|
|
@@ -11675,7 +11680,7 @@ function _typeof(o) {
|
|
|
11675
11680
|
}
|
|
11676
11681
|
function _COINGECKO() {
|
|
11677
11682
|
_COINGECKO = _asyncToGenerator(_regeneratorRuntime().mark((function _callee0(category, param1, param2) {
|
|
11678
|
-
var page, perPage, API_KEY, headers, url, lowerCategory,
|
|
11683
|
+
var page, perPage, API_KEY, headers, url, lowerCategory, vsCurrencies, token, ecosystemMap, key, categoryVal, trend, _category, _trend, exchange, response, json, _json$status, message, output, _i11, _Object$entries2, _Object$entries2$_i, _token, prices, _i12, _Object$entries3, _Object$entries3$_i, currency, _value6, _key4, _data, flatArray, _args0 = arguments;
|
|
11679
11684
|
return _regeneratorRuntime().wrap((function _callee0$(_context0) {
|
|
11680
11685
|
while (1) switch (_context0.prev = _context0.next) {
|
|
11681
11686
|
case 0:
|
|
@@ -11700,8 +11705,8 @@ function _typeof(o) {
|
|
|
11700
11705
|
break;
|
|
11701
11706
|
|
|
11702
11707
|
case 11:
|
|
11703
|
-
|
|
11704
|
-
|
|
11708
|
+
vsCurrencies = param1;
|
|
11709
|
+
token = param2;
|
|
11705
11710
|
if (!(!token || !vsCurrencies)) {
|
|
11706
11711
|
_context0.next = 15;
|
|
11707
11712
|
break;
|
|
@@ -11709,14 +11714,15 @@ function _typeof(o) {
|
|
|
11709
11714
|
return _context0.abrupt("return", "".concat(SERVICE_API_KEY.Coingecko).concat(ERROR_MESSAGES_FLAG.INVALID_PARAM));
|
|
11710
11715
|
|
|
11711
11716
|
case 15:
|
|
11712
|
-
url = "https://api.coingecko.com/api/v3/simple/price?vs_currencies=".concat(vsCurrencies, "&
|
|
11717
|
+
url = "https://api.coingecko.com/api/v3/simple/price?vs_currencies=".concat(vsCurrencies ? vsCurrencies : "usd", "&symbols=").concat(token);
|
|
11713
11718
|
return _context0.abrupt("break", 35);
|
|
11714
11719
|
|
|
11715
11720
|
case 17:
|
|
11716
11721
|
ecosystemMap = {
|
|
11717
|
-
|
|
11722
|
+
all: "",
|
|
11723
|
+
ethereum: "ethereum-ecosystem",
|
|
11718
11724
|
base: "base-ecosystem",
|
|
11719
|
-
|
|
11725
|
+
solana: "solana-ecosystem",
|
|
11720
11726
|
gnosis: "gnosis-chain",
|
|
11721
11727
|
hyperliquid: "hyperliquid",
|
|
11722
11728
|
bitcoin: "bitcoin-ecosystem",
|
|
@@ -11747,10 +11753,10 @@ function _typeof(o) {
|
|
|
11747
11753
|
|
|
11748
11754
|
case 31:
|
|
11749
11755
|
exchange = param1;
|
|
11750
|
-
if (exchange) {
|
|
11751
|
-
url = "https://api.coingecko.com/api/v3/derivatives
|
|
11756
|
+
if (!exchange || exchange === "all") {
|
|
11757
|
+
url = "https://api.coingecko.com/api/v3/derivatives";
|
|
11752
11758
|
} else {
|
|
11753
|
-
url = "https://api.coingecko.com/api/v3/derivatives
|
|
11759
|
+
url = "https://api.coingecko.com/api/v3/derivatives/exchanges/".concat(exchange, "?include_tickers=all");
|
|
11754
11760
|
}
|
|
11755
11761
|
return _context0.abrupt("break", 35);
|
|
11756
11762
|
|
|
@@ -11809,7 +11815,13 @@ function _typeof(o) {
|
|
|
11809
11815
|
return _context0.abrupt("return", [ output ]);
|
|
11810
11816
|
|
|
11811
11817
|
case 52:
|
|
11812
|
-
|
|
11818
|
+
_data = json;
|
|
11819
|
+
if (lowerCategory === "derivatives") {
|
|
11820
|
+
if (json && json.tickers && json.tickers.tickers) {
|
|
11821
|
+
json.tickers.tickers, _readOnlyError("data");
|
|
11822
|
+
}
|
|
11823
|
+
}
|
|
11824
|
+
flatArray = Array.isArray(_data) ? _data : [ _data ];
|
|
11813
11825
|
return _context0.abrupt("return", flatArray.map((function(item) {
|
|
11814
11826
|
var flat = {};
|
|
11815
11827
|
for (var _i13 = 0, _Object$entries4 = Object.entries(item); _i13 < _Object$entries4.length; _i13++) {
|
|
@@ -11821,17 +11833,17 @@ function _typeof(o) {
|
|
|
11821
11833
|
return flat;
|
|
11822
11834
|
})));
|
|
11823
11835
|
|
|
11824
|
-
case
|
|
11825
|
-
_context0.prev =
|
|
11836
|
+
case 58:
|
|
11837
|
+
_context0.prev = 58;
|
|
11826
11838
|
_context0.t1 = _context0["catch"](35);
|
|
11827
11839
|
console.error(_context0.t1);
|
|
11828
11840
|
return _context0.abrupt("return", ERROR_MESSAGES_FLAG.DEFAULT);
|
|
11829
11841
|
|
|
11830
|
-
case
|
|
11842
|
+
case 62:
|
|
11831
11843
|
case "end":
|
|
11832
11844
|
return _context0.stop();
|
|
11833
11845
|
}
|
|
11834
|
-
}), _callee0, null, [ [ 35,
|
|
11846
|
+
}), _callee0, null, [ [ 35, 58 ] ]);
|
|
11835
11847
|
})));
|
|
11836
11848
|
return _COINGECKO.apply(this, arguments);
|
|
11837
11849
|
}
|
|
@@ -11982,7 +11994,7 @@ function _typeof(o) {
|
|
|
11982
11994
|
_iterator2 = _createForOfIteratorHelper(CHAINS);
|
|
11983
11995
|
_context12.prev = 42;
|
|
11984
11996
|
_loop = _regeneratorRuntime().mark((function _loop() {
|
|
11985
|
-
var chain, chainId, i, slice, action, url,
|
|
11997
|
+
var chain, chainId, i, slice, action, url, _data2, startBlock, endBlock, _loop2, _ret2, _i14, _ADDRS;
|
|
11986
11998
|
return _regeneratorRuntime().wrap((function _loop$(_context10) {
|
|
11987
11999
|
while (1) switch (_context10.prev = _context10.next) {
|
|
11988
12000
|
case 0:
|
|
@@ -12015,17 +12027,17 @@ function _typeof(o) {
|
|
|
12015
12027
|
return fetchJSON(url);
|
|
12016
12028
|
|
|
12017
12029
|
case 12:
|
|
12018
|
-
|
|
12019
|
-
if (!(typeof
|
|
12030
|
+
_data2 = _context10.sent;
|
|
12031
|
+
if (!(typeof _data2 === "string")) {
|
|
12020
12032
|
_context10.next = 15;
|
|
12021
12033
|
break;
|
|
12022
12034
|
}
|
|
12023
12035
|
return _context10.abrupt("return", {
|
|
12024
|
-
v:
|
|
12036
|
+
v: _data2
|
|
12025
12037
|
});
|
|
12026
12038
|
|
|
12027
12039
|
case 15:
|
|
12028
|
-
(Array.isArray(
|
|
12040
|
+
(Array.isArray(_data2) ? _data2 : [ _data2 ]).forEach((function(r) {
|
|
12029
12041
|
return out.push(_objectSpread(_objectSpread({
|
|
12030
12042
|
chain: chain
|
|
12031
12043
|
}, r), {}, {
|
|
@@ -12319,6 +12331,114 @@ function _typeof(o) {
|
|
|
12319
12331
|
})));
|
|
12320
12332
|
return _SAFE.apply(this, arguments);
|
|
12321
12333
|
}
|
|
12334
|
+
function POLYMARKET() {
|
|
12335
|
+
return _POLYMARKET.apply(this, arguments);
|
|
12336
|
+
}
|
|
12337
|
+
function _POLYMARKET() {
|
|
12338
|
+
_POLYMARKET = _asyncToGenerator(_regeneratorRuntime().mark((function _callee13() {
|
|
12339
|
+
return _regeneratorRuntime().wrap((function _callee13$(_context15) {
|
|
12340
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
12341
|
+
case 0:
|
|
12342
|
+
return _context15.abrupt("return", "Coming Soon");
|
|
12343
|
+
|
|
12344
|
+
case 1:
|
|
12345
|
+
case "end":
|
|
12346
|
+
return _context15.stop();
|
|
12347
|
+
}
|
|
12348
|
+
}), _callee13);
|
|
12349
|
+
})));
|
|
12350
|
+
return _POLYMARKET.apply(this, arguments);
|
|
12351
|
+
}
|
|
12352
|
+
function PRIVACYPOOL() {
|
|
12353
|
+
return _PRIVACYPOOL.apply(this, arguments);
|
|
12354
|
+
}
|
|
12355
|
+
function _PRIVACYPOOL() {
|
|
12356
|
+
_PRIVACYPOOL = _asyncToGenerator(_regeneratorRuntime().mark((function _callee14() {
|
|
12357
|
+
return _regeneratorRuntime().wrap((function _callee14$(_context16) {
|
|
12358
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
12359
|
+
case 0:
|
|
12360
|
+
return _context16.abrupt("return", "Coming Soon");
|
|
12361
|
+
|
|
12362
|
+
case 1:
|
|
12363
|
+
case "end":
|
|
12364
|
+
return _context16.stop();
|
|
12365
|
+
}
|
|
12366
|
+
}), _callee14);
|
|
12367
|
+
})));
|
|
12368
|
+
return _PRIVACYPOOL.apply(this, arguments);
|
|
12369
|
+
}
|
|
12370
|
+
function ROTKI() {
|
|
12371
|
+
return _ROTKI.apply(this, arguments);
|
|
12372
|
+
}
|
|
12373
|
+
function _ROTKI() {
|
|
12374
|
+
_ROTKI = _asyncToGenerator(_regeneratorRuntime().mark((function _callee15() {
|
|
12375
|
+
return _regeneratorRuntime().wrap((function _callee15$(_context17) {
|
|
12376
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
12377
|
+
case 0:
|
|
12378
|
+
return _context17.abrupt("return", "Coming Soon");
|
|
12379
|
+
|
|
12380
|
+
case 1:
|
|
12381
|
+
case "end":
|
|
12382
|
+
return _context17.stop();
|
|
12383
|
+
}
|
|
12384
|
+
}), _callee15);
|
|
12385
|
+
})));
|
|
12386
|
+
return _ROTKI.apply(this, arguments);
|
|
12387
|
+
}
|
|
12388
|
+
function MEERKAT() {
|
|
12389
|
+
return _MEERKAT.apply(this, arguments);
|
|
12390
|
+
}
|
|
12391
|
+
function _MEERKAT() {
|
|
12392
|
+
_MEERKAT = _asyncToGenerator(_regeneratorRuntime().mark((function _callee16() {
|
|
12393
|
+
return _regeneratorRuntime().wrap((function _callee16$(_context18) {
|
|
12394
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
12395
|
+
case 0:
|
|
12396
|
+
return _context18.abrupt("return", "Coming Soon");
|
|
12397
|
+
|
|
12398
|
+
case 1:
|
|
12399
|
+
case "end":
|
|
12400
|
+
return _context18.stop();
|
|
12401
|
+
}
|
|
12402
|
+
}), _callee16);
|
|
12403
|
+
})));
|
|
12404
|
+
return _MEERKAT.apply(this, arguments);
|
|
12405
|
+
}
|
|
12406
|
+
function ARTEMIS() {
|
|
12407
|
+
return _ARTEMIS.apply(this, arguments);
|
|
12408
|
+
}
|
|
12409
|
+
function _ARTEMIS() {
|
|
12410
|
+
_ARTEMIS = _asyncToGenerator(_regeneratorRuntime().mark((function _callee17() {
|
|
12411
|
+
return _regeneratorRuntime().wrap((function _callee17$(_context19) {
|
|
12412
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
12413
|
+
case 0:
|
|
12414
|
+
return _context19.abrupt("return", "Coming Soon");
|
|
12415
|
+
|
|
12416
|
+
case 1:
|
|
12417
|
+
case "end":
|
|
12418
|
+
return _context19.stop();
|
|
12419
|
+
}
|
|
12420
|
+
}), _callee17);
|
|
12421
|
+
})));
|
|
12422
|
+
return _ARTEMIS.apply(this, arguments);
|
|
12423
|
+
}
|
|
12424
|
+
function TALLY() {
|
|
12425
|
+
return _TALLY.apply(this, arguments);
|
|
12426
|
+
}
|
|
12427
|
+
function _TALLY() {
|
|
12428
|
+
_TALLY = _asyncToGenerator(_regeneratorRuntime().mark((function _callee18() {
|
|
12429
|
+
return _regeneratorRuntime().wrap((function _callee18$(_context20) {
|
|
12430
|
+
while (1) switch (_context20.prev = _context20.next) {
|
|
12431
|
+
case 0:
|
|
12432
|
+
return _context20.abrupt("return", "Coming Soon");
|
|
12433
|
+
|
|
12434
|
+
case 1:
|
|
12435
|
+
case "end":
|
|
12436
|
+
return _context20.stop();
|
|
12437
|
+
}
|
|
12438
|
+
}), _callee18);
|
|
12439
|
+
})));
|
|
12440
|
+
return _TALLY.apply(this, arguments);
|
|
12441
|
+
}
|
|
12322
12442
|
var utils = {
|
|
12323
12443
|
errors: errors,
|
|
12324
12444
|
symbols: symbols,
|
|
@@ -12333,6 +12453,7 @@ function _typeof(o) {
|
|
|
12333
12453
|
exports.AGGREGATE = AGGREGATE;
|
|
12334
12454
|
exports.AND = AND;
|
|
12335
12455
|
exports.ARABIC = ARABIC;
|
|
12456
|
+
exports.ARTEMIS = ARTEMIS;
|
|
12336
12457
|
exports.ASIN = ASIN;
|
|
12337
12458
|
exports.ASINH = ASINH;
|
|
12338
12459
|
exports.ATAN = ATAN;
|
|
@@ -12561,6 +12682,7 @@ function _typeof(o) {
|
|
|
12561
12682
|
exports.MAXA = MAXA;
|
|
12562
12683
|
exports.MAXIFS = MAXIFS;
|
|
12563
12684
|
exports.MEDIAN = MEDIAN;
|
|
12685
|
+
exports.MEERKAT = MEERKAT;
|
|
12564
12686
|
exports.MID = MID;
|
|
12565
12687
|
exports.MIN = MIN;
|
|
12566
12688
|
exports.MINA = MINA;
|
|
@@ -12616,9 +12738,11 @@ function _typeof(o) {
|
|
|
12616
12738
|
exports.PNL = PNL;
|
|
12617
12739
|
exports.POISSON = POISSON;
|
|
12618
12740
|
exports.POISSONDIST = POISSONDIST;
|
|
12741
|
+
exports.POLYMARKET = POLYMARKET;
|
|
12619
12742
|
exports.POWER = POWER;
|
|
12620
12743
|
exports.PPMT = PPMT;
|
|
12621
12744
|
exports.PRICEDISC = PRICEDISC;
|
|
12745
|
+
exports.PRIVACYPOOL = PRIVACYPOOL;
|
|
12622
12746
|
exports.PROB = PROB;
|
|
12623
12747
|
exports.PRODUCT = PRODUCT;
|
|
12624
12748
|
exports.PROPER = PROPER;
|
|
@@ -12638,6 +12762,7 @@ function _typeof(o) {
|
|
|
12638
12762
|
exports.REPT = REPT;
|
|
12639
12763
|
exports.RIGHT = RIGHT;
|
|
12640
12764
|
exports.ROMAN = ROMAN;
|
|
12765
|
+
exports.ROTKI = ROTKI;
|
|
12641
12766
|
exports.ROUND = ROUND;
|
|
12642
12767
|
exports.ROUNDDOWN = ROUNDDOWN;
|
|
12643
12768
|
exports.ROUNDUP = ROUNDUP;
|
|
@@ -12682,6 +12807,7 @@ function _typeof(o) {
|
|
|
12682
12807
|
exports.SWITCH = SWITCH;
|
|
12683
12808
|
exports.SYD = SYD;
|
|
12684
12809
|
exports.T = T;
|
|
12810
|
+
exports.TALLY = TALLY;
|
|
12685
12811
|
exports.TAN = TAN;
|
|
12686
12812
|
exports.TANH = TANH;
|
|
12687
12813
|
exports.TBILLEQ = TBILLEQ;
|