@fileverse-dev/formulajs 4.4.11-mod-18-safe-patch-1 → 4.4.11-mod-19-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.
@@ -1,26 +1,4 @@
1
- /* @fileverse-dev/formulajs v4.4.11-mod-18 */
2
- var _excluded = [ "confirmations", "dataDecoded" ];
3
-
4
- function _objectWithoutProperties(e, t) {
5
- if (null == e) return {};
6
- var o, r, i = _objectWithoutPropertiesLoose(e, t);
7
- if (Object.getOwnPropertySymbols) {
8
- var n = Object.getOwnPropertySymbols(e);
9
- for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
10
- }
11
- return i;
12
- }
13
-
14
- function _objectWithoutPropertiesLoose(r, e) {
15
- if (null == r) return {};
16
- var t = {};
17
- for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
18
- if (-1 !== e.indexOf(n)) continue;
19
- t[n] = r[n];
20
- }
21
- return t;
22
- }
23
-
1
+ /* @fileverse-dev/formulajs v4.4.11-mod-19-patch-1 */
24
2
  function _regeneratorRuntime() {
25
3
  "use strict";
26
4
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() {
@@ -795,9 +773,20 @@ function _typeof(o) {
795
773
  return serialToDate(d);
796
774
  }
797
775
  if (typeof date === "string") {
798
- date = /(\d{4})-(\d\d?)-(\d\d?)$/.test(date) ? new Date(date + "T00:00:00.000") : new Date(date);
799
- if (!isNaN(date)) {
800
- return date;
776
+ if (/^\d{4}-\d{1,2}-\d{1,2}$/.test(date)) {
777
+ return new Date(date + "T00:00:00.000");
778
+ }
779
+ var match = /^(\d{1,2})\/(\d{1,2})\/(\d{4})$/.exec(date);
780
+ if (match) {
781
+ var _match$map = match.map(Number), _match$map2 = _slicedToArray(_match$map, 4), day = _match$map2[1], month = _match$map2[2], year = _match$map2[3];
782
+ var _d = new Date(year, month - 1, day);
783
+ if (!isNaN(_d)) {
784
+ return _d;
785
+ }
786
+ }
787
+ var parsed = new Date(date);
788
+ if (!isNaN(parsed)) {
789
+ return parsed;
801
790
  }
802
791
  }
803
792
  return value;
@@ -10786,18 +10775,13 @@ function _typeof(o) {
10786
10775
  }
10787
10776
  var SERVICE_API_KEY = {
10788
10777
  Etherscan: "ETHERSCAN_API_KEY",
10789
- Coingecko: "COINGECKO_API_KEY",
10790
- Safe: "SAFE_API_KEY"
10778
+ Coingecko: "COINGECKO_API_KEY"
10791
10779
  };
10792
10780
  var CHAIN_ID_MAP = {
10793
10781
  ethereum: 1,
10794
10782
  gnosis: 100,
10795
10783
  base: 8453
10796
10784
  };
10797
- var SAFE_CHAIN_MAP = {
10798
- ethereum: "eth",
10799
- gnosis: "gno"
10800
- };
10801
10785
  var fromTimeStampToBlock = function() {
10802
10786
  var _ref = _asyncToGenerator(_regeneratorRuntime().mark((function _callee(timestamp, chain, apiKey) {
10803
10787
  var chainId, url, res, json;
@@ -10957,11 +10941,11 @@ function _typeof(o) {
10957
10941
  })));
10958
10942
  return _GETPRICE.apply(this, arguments);
10959
10943
  }
10960
- function OX(_x9, _x0, _x1, _x10, _x11) {
10961
- return _OX.apply(this, arguments);
10944
+ function EOA(_x9, _x0, _x1, _x10, _x11) {
10945
+ return _EOA.apply(this, arguments);
10962
10946
  }
10963
- function _OX() {
10964
- _OX = _asyncToGenerator(_regeneratorRuntime().mark((function _callee4(address, categories, chain, startTime, endTime) {
10947
+ function _EOA() {
10948
+ _EOA = _asyncToGenerator(_regeneratorRuntime().mark((function _callee4(address, categories, chain, startTime, endTime) {
10965
10949
  var API_KEYS, apiKey, chainId, action, timeQuery, startBlock, endBlock, url, _json$result, _json$result$includes, response, json;
10966
10950
  return _regeneratorRuntime().wrap((function _callee4$(_context4) {
10967
10951
  while (1) switch (_context4.prev = _context4.next) {
@@ -11056,7 +11040,7 @@ function _typeof(o) {
11056
11040
  }
11057
11041
  }), _callee4, null, [ [ 24, 38 ] ]);
11058
11042
  })));
11059
- return _OX.apply(this, arguments);
11043
+ return _EOA.apply(this, arguments);
11060
11044
  }
11061
11045
  function FLVURL(_x12, _x13) {
11062
11046
  return _FLVURL.apply(this, arguments);
@@ -11082,101 +11066,6 @@ function _typeof(o) {
11082
11066
  })));
11083
11067
  return _FLVURL.apply(this, arguments);
11084
11068
  }
11085
- function SAFE(_x14, _x15, _x16, _x17, _x18) {
11086
- return _SAFE.apply(this, arguments);
11087
- }
11088
- function _SAFE() {
11089
- _SAFE = _asyncToGenerator(_regeneratorRuntime().mark((function _callee6(address, utility, chain, limit, offset) {
11090
- var apiKey, chainIdentifier, url, response, json;
11091
- return _regeneratorRuntime().wrap((function _callee6$(_context6) {
11092
- while (1) switch (_context6.prev = _context6.next) {
11093
- case 0:
11094
- if (!(typeof limit !== "number" || limit < 0)) {
11095
- _context6.next = 2;
11096
- break;
11097
- }
11098
- return _context6.abrupt("return", "INVALID_LIMIT");
11099
-
11100
- case 2:
11101
- if (!(typeof offset !== "number" || offset < 0)) {
11102
- _context6.next = 4;
11103
- break;
11104
- }
11105
- return _context6.abrupt("return", "INVALID_OFFSET");
11106
-
11107
- case 4:
11108
- if (!(utility !== "txns")) {
11109
- _context6.next = 6;
11110
- break;
11111
- }
11112
- return _context6.abrupt("return", "UTILITY IS NOT SUPPORTED");
11113
-
11114
- case 6:
11115
- apiKey = window.localStorage.getItem(SERVICE_API_KEY.Safe);
11116
- chainIdentifier = SAFE_CHAIN_MAP[chain];
11117
- if (apiKey) {
11118
- _context6.next = 10;
11119
- break;
11120
- }
11121
- return _context6.abrupt("return", "".concat(SERVICE_API_KEY.Safe, "_MISSING"));
11122
-
11123
- case 10:
11124
- if (chainIdentifier) {
11125
- _context6.next = 12;
11126
- break;
11127
- }
11128
- return _context6.abrupt("return", "CHAIN IS NOT SUPPORTED");
11129
-
11130
- case 12:
11131
- url = "https://api.safe.global/tx-service/".concat(chainIdentifier, "/api/v2/safes/").concat(address, "/multisig-transactions?limit=").concat(limit, "&offset=").concat(offset);
11132
- _context6.prev = 13;
11133
- _context6.next = 16;
11134
- return fetch(url, {
11135
- headers: {
11136
- Authorization: "Bearer ".concat(apiKey)
11137
- }
11138
- });
11139
-
11140
- case 16:
11141
- response = _context6.sent;
11142
- if (response.ok) {
11143
- _context6.next = 19;
11144
- break;
11145
- }
11146
- throw new Error("HTTP error! Status: ".concat(response.status));
11147
-
11148
- case 19:
11149
- _context6.next = 21;
11150
- return response.json();
11151
-
11152
- case 21:
11153
- json = _context6.sent;
11154
- if (Array.isArray(json.results)) {
11155
- _context6.next = 24;
11156
- break;
11157
- }
11158
- return _context6.abrupt("return", "INVALID API RESPONSE");
11159
-
11160
- case 24:
11161
- return _context6.abrupt("return", json.results.map((function(_ref2) {
11162
- var confirmations = _ref2.confirmations, dataDecoded = _ref2.dataDecoded, rest = _objectWithoutProperties(_ref2, _excluded);
11163
- return rest;
11164
- })));
11165
-
11166
- case 27:
11167
- _context6.prev = 27;
11168
- _context6.t0 = _context6["catch"](13);
11169
- console.log(_context6.t0);
11170
- return _context6.abrupt("return", "ERROR IN FETCHING");
11171
-
11172
- case 31:
11173
- case "end":
11174
- return _context6.stop();
11175
- }
11176
- }), _callee6, null, [ [ 13, 27 ] ]);
11177
- })));
11178
- return _SAFE.apply(this, arguments);
11179
- }
11180
11069
  var utils = {
11181
11070
  errors: errors,
11182
11071
  symbols: symbols,
@@ -11294,6 +11183,7 @@ function _typeof(o) {
11294
11183
  exports.DVARP = DVARP;
11295
11184
  exports.EDATE = EDATE;
11296
11185
  exports.EFFECT = EFFECT;
11186
+ exports.EOA = EOA;
11297
11187
  exports.EOMONTH = EOMONTH;
11298
11188
  exports.ERF = ERF;
11299
11189
  exports.ERFC = ERFC;
@@ -11451,7 +11341,6 @@ function _typeof(o) {
11451
11341
  exports.OCT2HEX = OCT2HEX;
11452
11342
  exports.ODD = ODD;
11453
11343
  exports.OR = OR;
11454
- exports.OX = OX;
11455
11344
  exports.PDURATION = PDURATION;
11456
11345
  exports.PEARSON = PEARSON;
11457
11346
  exports.PERCENTILE = PERCENTILE;
@@ -11497,7 +11386,6 @@ function _typeof(o) {
11497
11386
  exports.ROWS = ROWS;
11498
11387
  exports.RRI = RRI;
11499
11388
  exports.RSQ = RSQ;
11500
- exports.SAFE = SAFE;
11501
11389
  exports.SEARCH = SEARCH;
11502
11390
  exports.SEC = SEC;
11503
11391
  exports.SECH = SECH;