@fileverse-dev/formulajs 4.4.11-mod-21-patch-3 → 4.4.11-mod-21-patch-4

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/cjs/index.cjs CHANGED
@@ -13077,12 +13077,6 @@ function SWITCH() {
13077
13077
  return result
13078
13078
  }
13079
13079
 
13080
- const SERVICE_API_KEY = {
13081
- Etherscan: "ETHERSCAN_API_KEY",
13082
- Coingecko: "COINGECKO_API_KEY",
13083
- Safe: "SAFE_API_KEY",
13084
- };
13085
-
13086
13080
  const CHAIN_ID_MAP = {
13087
13081
  ethereum: 1,
13088
13082
  gnosis: 100,
@@ -13095,9 +13089,16 @@ const SAFE_CHAIN_MAP = {
13095
13089
  };
13096
13090
 
13097
13091
  const ERROR_MESSAGES_FLAG = {
13098
- INVALID_API_KEY: '_MISSING',
13092
+ INVALID_API_KEY: '_INVALID_KEY',
13099
13093
  RATE_LIMIT: '_RATE_LIMIT_REACHED',
13100
- DEFAULT: 'FETCH_ERROR'
13094
+ DEFAULT: 'FETCH_ERROR',
13095
+ MISSING_KEY: '_MISSING'
13096
+ };
13097
+
13098
+ const SERVICE_API_KEY = {
13099
+ Etherscan: "ETHERSCAN_API_KEY",
13100
+ Coingecko: "COINGECKO_API_KEY",
13101
+ Safe: "SAFE_API_KEY",
13101
13102
  };
13102
13103
 
13103
13104
  const fromTimeStampToBlock = async (timestamp, chain, apiKey) => {
@@ -13114,7 +13115,10 @@ async function ETHERSCAN(address, page, offset) {
13114
13115
 
13115
13116
 
13116
13117
  const API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Etherscan);
13117
- if(API_KEY === 'xxxx'){
13118
+ if(!API_KEY){
13119
+ return `${SERVICE_API_KEY.Etherscan}${ERROR_MESSAGES_FLAG.MISSING_KEY}`
13120
+ }
13121
+ if(API_KEY === 'xxxx'){
13118
13122
  return `${SERVICE_API_KEY.Etherscan}${ERROR_MESSAGES_FLAG.RATE_LIMIT}`
13119
13123
  }
13120
13124
  const url = `https://api.etherscan.io/v2/api?chainid=1&module=account&action=txlist&address=${address}&startblock=0&endblock=99999999&page=${page || 1}&offset=${offset || 10}&sort=asc&apikey=${API_KEY}`;
@@ -1,3 +1,20 @@
1
+ // src/utils/constants.js
2
+ var CHAIN_ID_MAP = {
3
+ ethereum: 1,
4
+ gnosis: 100,
5
+ base: 8453
6
+ };
7
+ var SAFE_CHAIN_MAP = {
8
+ ethereum: "eth",
9
+ gnosis: "gno"
10
+ };
11
+ var ERROR_MESSAGES_FLAG = {
12
+ INVALID_API_KEY: "_INVALID_KEY",
13
+ RATE_LIMIT: "_RATE_LIMIT_REACHED",
14
+ DEFAULT: "FETCH_ERROR",
15
+ MISSING_KEY: "_MISSING"
16
+ };
17
+
1
18
  // src/crypto-constants.js
2
19
  var SERVICE_API_KEY = {
3
20
  Etherscan: "ETHERSCAN_API_KEY",
@@ -190,6 +207,9 @@ var FUNCTION_LOCALE = [
190
207
  }
191
208
  ];
192
209
  export {
210
+ CHAIN_ID_MAP,
211
+ ERROR_MESSAGES_FLAG,
193
212
  FUNCTION_LOCALE,
213
+ SAFE_CHAIN_MAP,
194
214
  SERVICE_API_KEY
195
215
  };
package/lib/esm/index.mjs CHANGED
@@ -13075,12 +13075,6 @@ function SWITCH() {
13075
13075
  return result
13076
13076
  }
13077
13077
 
13078
- const SERVICE_API_KEY = {
13079
- Etherscan: "ETHERSCAN_API_KEY",
13080
- Coingecko: "COINGECKO_API_KEY",
13081
- Safe: "SAFE_API_KEY",
13082
- };
13083
-
13084
13078
  const CHAIN_ID_MAP = {
13085
13079
  ethereum: 1,
13086
13080
  gnosis: 100,
@@ -13093,9 +13087,16 @@ const SAFE_CHAIN_MAP = {
13093
13087
  };
13094
13088
 
13095
13089
  const ERROR_MESSAGES_FLAG = {
13096
- INVALID_API_KEY: '_MISSING',
13090
+ INVALID_API_KEY: '_INVALID_KEY',
13097
13091
  RATE_LIMIT: '_RATE_LIMIT_REACHED',
13098
- DEFAULT: 'FETCH_ERROR'
13092
+ DEFAULT: 'FETCH_ERROR',
13093
+ MISSING_KEY: '_MISSING'
13094
+ };
13095
+
13096
+ const SERVICE_API_KEY = {
13097
+ Etherscan: "ETHERSCAN_API_KEY",
13098
+ Coingecko: "COINGECKO_API_KEY",
13099
+ Safe: "SAFE_API_KEY",
13099
13100
  };
13100
13101
 
13101
13102
  const fromTimeStampToBlock = async (timestamp, chain, apiKey) => {
@@ -13112,7 +13113,10 @@ async function ETHERSCAN(address, page, offset) {
13112
13113
 
13113
13114
 
13114
13115
  const API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Etherscan);
13115
- if(API_KEY === 'xxxx'){
13116
+ if(!API_KEY){
13117
+ return `${SERVICE_API_KEY.Etherscan}${ERROR_MESSAGES_FLAG.MISSING_KEY}`
13118
+ }
13119
+ if(API_KEY === 'xxxx'){
13116
13120
  return `${SERVICE_API_KEY.Etherscan}${ERROR_MESSAGES_FLAG.RATE_LIMIT}`
13117
13121
  }
13118
13122
  const url = `https://api.etherscan.io/v2/api?chainid=1&module=account&action=txlist&address=${address}&startblock=0&endblock=99999999&page=${page || 1}&offset=${offset || 10}&sort=asc&apikey=${API_KEY}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fileverse-dev/formulajs",
3
- "version": "4.4.11-mod-21-patch-3",
3
+ "version": "4.4.11-mod-21-patch-4",
4
4
  "description": "JavaScript implementation of most Microsoft Excel formula functions",
5
5
  "author": "Formulajs",
6
6
  "publishConfig": {