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

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
@@ -13111,29 +13111,33 @@ if(!timestamp || !chain || !apiKey) return
13111
13111
  };
13112
13112
 
13113
13113
  async function ETHERSCAN(address, page, offset) {
13114
+
13115
+
13116
+ const API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Etherscan);
13117
+ if(API_KEY === 'xxxx'){
13114
13118
  return `${SERVICE_API_KEY.Etherscan}${ERROR_MESSAGES_FLAG.RATE_LIMIT}`
13115
- // const API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Etherscan);
13116
- // 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}`
13117
-
13118
- // try {
13119
- // const response = await fetch(url)
13120
- // if (!response.ok) {
13121
- // throw new Error(`HTTP error! Status: ${response.status}`)
13122
- // }
13123
- // const json = await response.json()
13124
- // if (json.result.includes("Invalid API Key")) {
13125
- // return `${SERVICE_API_KEY.Etherscan}${ERROR_MESSAGES_FLAG.INVALID_API_KEY}`
13126
- // }
13127
- // if(json.result.includes('Max rate limit reached')){
13128
- // return `${SERVICE_API_KEY.Etherscan}${ERROR_MESSAGES_FLAG.RATE_LIMIT}`
13129
- // }
13130
- // /*
13131
- // [{blockNumber: '0x1d3d1', timeStamp: '0x5f7e4f', hash: '0x3c3c3c3c', nonce: '0x1',}]
13132
- // */
13133
- // return json.result;
13134
- // } catch (error) {
13135
- // return ERROR_MESSAGES_FLAG.DEFAULT
13136
- // }
13119
+ }
13120
+ 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}`;
13121
+
13122
+ try {
13123
+ const response = await fetch(url);
13124
+ if (!response.ok) {
13125
+ throw new Error(`HTTP error! Status: ${response.status}`)
13126
+ }
13127
+ const json = await response.json();
13128
+ if (json.result.includes("Invalid API Key")) {
13129
+ return `${SERVICE_API_KEY.Etherscan}${ERROR_MESSAGES_FLAG.INVALID_API_KEY}`
13130
+ }
13131
+ if(json.result.includes('Max rate limit reached')){
13132
+ return `${SERVICE_API_KEY.Etherscan}${ERROR_MESSAGES_FLAG.RATE_LIMIT}`
13133
+ }
13134
+ /*
13135
+ [{blockNumber: '0x1d3d1', timeStamp: '0x5f7e4f', hash: '0x3c3c3c3c', nonce: '0x1',}]
13136
+ */
13137
+ return json.result;
13138
+ } catch (error) {
13139
+ return ERROR_MESSAGES_FLAG.DEFAULT
13140
+ }
13137
13141
  }
13138
13142
 
13139
13143
  async function COINGECKO(token, vs_currencies) {
package/lib/esm/index.mjs CHANGED
@@ -13109,29 +13109,33 @@ if(!timestamp || !chain || !apiKey) return
13109
13109
  };
13110
13110
 
13111
13111
  async function ETHERSCAN(address, page, offset) {
13112
+
13113
+
13114
+ const API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Etherscan);
13115
+ if(API_KEY === 'xxxx'){
13112
13116
  return `${SERVICE_API_KEY.Etherscan}${ERROR_MESSAGES_FLAG.RATE_LIMIT}`
13113
- // const API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Etherscan);
13114
- // 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}`
13115
-
13116
- // try {
13117
- // const response = await fetch(url)
13118
- // if (!response.ok) {
13119
- // throw new Error(`HTTP error! Status: ${response.status}`)
13120
- // }
13121
- // const json = await response.json()
13122
- // if (json.result.includes("Invalid API Key")) {
13123
- // return `${SERVICE_API_KEY.Etherscan}${ERROR_MESSAGES_FLAG.INVALID_API_KEY}`
13124
- // }
13125
- // if(json.result.includes('Max rate limit reached')){
13126
- // return `${SERVICE_API_KEY.Etherscan}${ERROR_MESSAGES_FLAG.RATE_LIMIT}`
13127
- // }
13128
- // /*
13129
- // [{blockNumber: '0x1d3d1', timeStamp: '0x5f7e4f', hash: '0x3c3c3c3c', nonce: '0x1',}]
13130
- // */
13131
- // return json.result;
13132
- // } catch (error) {
13133
- // return ERROR_MESSAGES_FLAG.DEFAULT
13134
- // }
13117
+ }
13118
+ 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}`;
13119
+
13120
+ try {
13121
+ const response = await fetch(url);
13122
+ if (!response.ok) {
13123
+ throw new Error(`HTTP error! Status: ${response.status}`)
13124
+ }
13125
+ const json = await response.json();
13126
+ if (json.result.includes("Invalid API Key")) {
13127
+ return `${SERVICE_API_KEY.Etherscan}${ERROR_MESSAGES_FLAG.INVALID_API_KEY}`
13128
+ }
13129
+ if(json.result.includes('Max rate limit reached')){
13130
+ return `${SERVICE_API_KEY.Etherscan}${ERROR_MESSAGES_FLAG.RATE_LIMIT}`
13131
+ }
13132
+ /*
13133
+ [{blockNumber: '0x1d3d1', timeStamp: '0x5f7e4f', hash: '0x3c3c3c3c', nonce: '0x1',}]
13134
+ */
13135
+ return json.result;
13136
+ } catch (error) {
13137
+ return ERROR_MESSAGES_FLAG.DEFAULT
13138
+ }
13135
13139
  }
13136
13140
 
13137
13141
  async function COINGECKO(token, vs_currencies) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fileverse-dev/formulajs",
3
- "version": "4.4.11-mod-21-patch-2",
3
+ "version": "4.4.11-mod-21-patch-3",
4
4
  "description": "JavaScript implementation of most Microsoft Excel formula functions",
5
5
  "author": "Formulajs",
6
6
  "publishConfig": {
@@ -1329,7 +1329,7 @@ export const ERFPRECISE: any;
1329
1329
  export namespace ERROR {
1330
1330
  function TYPE(error_val: any): Error | 1 | 2 | 3 | 4 | 8 | 5 | 6 | 7;
1331
1331
  }
1332
- export function ETHERSCAN(address: any, page: any, offset: any): Promise<string>;
1332
+ export function ETHERSCAN(address: any, page: any, offset: any): Promise<any>;
1333
1333
  /**
1334
1334
  * Rounds a number up to the nearest even integer.
1335
1335
  *
@@ -1329,7 +1329,7 @@ export const ERFPRECISE: any;
1329
1329
  export namespace ERROR {
1330
1330
  function TYPE(error_val: any): Error | 1 | 2 | 3 | 4 | 8 | 5 | 6 | 7;
1331
1331
  }
1332
- export function ETHERSCAN(address: any, page: any, offset: any): Promise<string>;
1332
+ export function ETHERSCAN(address: any, page: any, offset: any): Promise<any>;
1333
1333
  /**
1334
1334
  * Rounds a number up to the nearest even integer.
1335
1335
  *