@fileverse-dev/formulajs 4.4.11-mod-21-patch-1 → 4.4.11-mod-21-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.
@@ -1,4 +1,26 @@
1
- /* @fileverse-dev/formulajs v4.4.11-mod-21-patch-1 */
1
+ /* @fileverse-dev/formulajs v4.4.11-mod-21-patch-2 */
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
+
2
24
  function _regeneratorRuntime() {
3
25
  "use strict";
4
26
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() {
@@ -10806,13 +10828,18 @@ function _typeof(o) {
10806
10828
  }
10807
10829
  var SERVICE_API_KEY = {
10808
10830
  Etherscan: "ETHERSCAN_API_KEY",
10809
- Coingecko: "COINGECKO_API_KEY"
10831
+ Coingecko: "COINGECKO_API_KEY",
10832
+ Safe: "SAFE_API_KEY"
10810
10833
  };
10811
10834
  var CHAIN_ID_MAP = {
10812
10835
  ethereum: 1,
10813
10836
  gnosis: 100,
10814
10837
  base: 8453
10815
10838
  };
10839
+ var SAFE_CHAIN_MAP = {
10840
+ ethereum: "eth",
10841
+ gnosis: "gno"
10842
+ };
10816
10843
  var ERROR_MESSAGES_FLAG = {
10817
10844
  INVALID_API_KEY: "_MISSING",
10818
10845
  RATE_LIMIT: "_RATE_LIMIT_REACHED",
@@ -11083,6 +11110,101 @@ function _typeof(o) {
11083
11110
  })));
11084
11111
  return _FLVURL.apply(this, arguments);
11085
11112
  }
11113
+ function SAFE(_x14, _x15, _x16, _x17, _x18) {
11114
+ return _SAFE.apply(this, arguments);
11115
+ }
11116
+ function _SAFE() {
11117
+ _SAFE = _asyncToGenerator(_regeneratorRuntime().mark((function _callee6(address, utility, chain, limit, offset) {
11118
+ var apiKey, chainIdentifier, url, response, json;
11119
+ return _regeneratorRuntime().wrap((function _callee6$(_context6) {
11120
+ while (1) switch (_context6.prev = _context6.next) {
11121
+ case 0:
11122
+ if (!(typeof limit !== "number" || limit < 0)) {
11123
+ _context6.next = 2;
11124
+ break;
11125
+ }
11126
+ return _context6.abrupt("return", "INVALID_LIMIT");
11127
+
11128
+ case 2:
11129
+ if (!(typeof offset !== "number" || offset < 0)) {
11130
+ _context6.next = 4;
11131
+ break;
11132
+ }
11133
+ return _context6.abrupt("return", "INVALID_OFFSET");
11134
+
11135
+ case 4:
11136
+ if (!(utility !== "txns")) {
11137
+ _context6.next = 6;
11138
+ break;
11139
+ }
11140
+ return _context6.abrupt("return", "UTILITY IS NOT SUPPORTED");
11141
+
11142
+ case 6:
11143
+ apiKey = window.localStorage.getItem(SERVICE_API_KEY.Safe);
11144
+ chainIdentifier = SAFE_CHAIN_MAP[chain];
11145
+ if (apiKey) {
11146
+ _context6.next = 10;
11147
+ break;
11148
+ }
11149
+ return _context6.abrupt("return", "".concat(SERVICE_API_KEY.Safe, "_MISSING"));
11150
+
11151
+ case 10:
11152
+ if (chainIdentifier) {
11153
+ _context6.next = 12;
11154
+ break;
11155
+ }
11156
+ return _context6.abrupt("return", "CHAIN IS NOT SUPPORTED");
11157
+
11158
+ case 12:
11159
+ url = "https://api.safe.global/tx-service/".concat(chainIdentifier, "/api/v2/safes/").concat(address, "/multisig-transactions?limit=").concat(limit, "&offset=").concat(offset);
11160
+ _context6.prev = 13;
11161
+ _context6.next = 16;
11162
+ return fetch(url, {
11163
+ headers: {
11164
+ Authorization: "Bearer ".concat(apiKey)
11165
+ }
11166
+ });
11167
+
11168
+ case 16:
11169
+ response = _context6.sent;
11170
+ if (response.ok) {
11171
+ _context6.next = 19;
11172
+ break;
11173
+ }
11174
+ throw new Error("HTTP error! Status: ".concat(response.status));
11175
+
11176
+ case 19:
11177
+ _context6.next = 21;
11178
+ return response.json();
11179
+
11180
+ case 21:
11181
+ json = _context6.sent;
11182
+ if (Array.isArray(json.results)) {
11183
+ _context6.next = 24;
11184
+ break;
11185
+ }
11186
+ return _context6.abrupt("return", "INVALID API RESPONSE");
11187
+
11188
+ case 24:
11189
+ return _context6.abrupt("return", json.results.map((function(_ref2) {
11190
+ var confirmations = _ref2.confirmations, dataDecoded = _ref2.dataDecoded, rest = _objectWithoutProperties(_ref2, _excluded);
11191
+ return rest;
11192
+ })));
11193
+
11194
+ case 27:
11195
+ _context6.prev = 27;
11196
+ _context6.t0 = _context6["catch"](13);
11197
+ console.log(_context6.t0);
11198
+ return _context6.abrupt("return", "ERROR IN FETCHING");
11199
+
11200
+ case 31:
11201
+ case "end":
11202
+ return _context6.stop();
11203
+ }
11204
+ }), _callee6, null, [ [ 13, 27 ] ]);
11205
+ })));
11206
+ return _SAFE.apply(this, arguments);
11207
+ }
11086
11208
  var utils = {
11087
11209
  errors: errors,
11088
11210
  symbols: symbols,
@@ -11405,6 +11527,7 @@ function _typeof(o) {
11405
11527
  exports.ROWS = ROWS;
11406
11528
  exports.RRI = RRI;
11407
11529
  exports.RSQ = RSQ;
11530
+ exports.SAFE = SAFE;
11408
11531
  exports.SEARCH = SEARCH;
11409
11532
  exports.SEC = SEC;
11410
11533
  exports.SECH = SECH;