@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/browser/formula.js +50 -3
- package/lib/browser/formula.min.js +2 -2
- package/lib/browser/formula.min.js.map +1 -1
- package/lib/cjs/index.cjs +26 -22
- package/lib/esm/index.mjs +26 -22
- package/package.json +1 -1
- package/types/cjs/index.d.cts +1 -1
- package/types/esm/index.d.mts +1 -1
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
|
-
|
|
13116
|
-
|
|
13117
|
-
|
|
13118
|
-
|
|
13119
|
-
|
|
13120
|
-
|
|
13121
|
-
|
|
13122
|
-
|
|
13123
|
-
|
|
13124
|
-
|
|
13125
|
-
|
|
13126
|
-
|
|
13127
|
-
|
|
13128
|
-
|
|
13129
|
-
|
|
13130
|
-
|
|
13131
|
-
|
|
13132
|
-
|
|
13133
|
-
|
|
13134
|
-
|
|
13135
|
-
|
|
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
|
-
|
|
13114
|
-
|
|
13115
|
-
|
|
13116
|
-
|
|
13117
|
-
|
|
13118
|
-
|
|
13119
|
-
|
|
13120
|
-
|
|
13121
|
-
|
|
13122
|
-
|
|
13123
|
-
|
|
13124
|
-
|
|
13125
|
-
|
|
13126
|
-
|
|
13127
|
-
|
|
13128
|
-
|
|
13129
|
-
|
|
13130
|
-
|
|
13131
|
-
|
|
13132
|
-
|
|
13133
|
-
|
|
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
package/types/cjs/index.d.cts
CHANGED
|
@@ -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<
|
|
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
|
*
|
package/types/esm/index.d.mts
CHANGED
|
@@ -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<
|
|
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
|
*
|