@fileverse-dev/formulajs 4.4.11-mod-21-patch-3 → 4.4.11-mod-22
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 +34 -26
- package/lib/browser/formula.min.js +2 -2
- package/lib/browser/formula.min.js.map +1 -1
- package/lib/cjs/index.cjs +14 -15
- package/lib/esm/crypto-constants.mjs +24 -0
- package/lib/esm/index.mjs +14 -15
- package/package.json +1 -1
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: '
|
|
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) => {
|
|
@@ -13111,10 +13112,12 @@ if(!timestamp || !chain || !apiKey) return
|
|
|
13111
13112
|
};
|
|
13112
13113
|
|
|
13113
13114
|
async function ETHERSCAN(address, page, offset) {
|
|
13114
|
-
|
|
13115
|
-
|
|
13116
13115
|
const API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Etherscan);
|
|
13117
|
-
|
|
13116
|
+
if(!API_KEY){
|
|
13117
|
+
return `${SERVICE_API_KEY.Etherscan}${ERROR_MESSAGES_FLAG.MISSING_KEY}`
|
|
13118
|
+
}
|
|
13119
|
+
// temporary added for testing rate limit flow
|
|
13120
|
+
if(API_KEY === 'xxxx'){
|
|
13118
13121
|
return `${SERVICE_API_KEY.Etherscan}${ERROR_MESSAGES_FLAG.RATE_LIMIT}`
|
|
13119
13122
|
}
|
|
13120
13123
|
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}`;
|
|
@@ -13220,10 +13223,6 @@ async function EOA(address, categories, chain, startTime, endTime) {
|
|
|
13220
13223
|
}
|
|
13221
13224
|
}
|
|
13222
13225
|
|
|
13223
|
-
|
|
13224
|
-
|
|
13225
|
-
|
|
13226
|
-
|
|
13227
13226
|
async function FLVURL(token, vs_currencies) {
|
|
13228
13227
|
return new Promise((resolve) => {
|
|
13229
13228
|
setTimeout(() => {
|
|
@@ -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",
|
|
@@ -125,6 +142,10 @@ var FUNCTION_LOCALE = [
|
|
|
125
142
|
]
|
|
126
143
|
},
|
|
127
144
|
{
|
|
145
|
+
API_KEY: SERVICE_API_KEY.Etherscan,
|
|
146
|
+
LOGO: "https://safe-transaction-mainnet.safe.global/static/safe/favicon.png",
|
|
147
|
+
BRAND_COLOR: "#ebf9f3",
|
|
148
|
+
BRAND_SECONDARY_COLOR: "#00B460",
|
|
128
149
|
n: "SAFE",
|
|
129
150
|
t: 20,
|
|
130
151
|
d: "Query the list of transactions performed by a Safe address, with optional pagination.",
|
|
@@ -190,6 +211,9 @@ var FUNCTION_LOCALE = [
|
|
|
190
211
|
}
|
|
191
212
|
];
|
|
192
213
|
export {
|
|
214
|
+
CHAIN_ID_MAP,
|
|
215
|
+
ERROR_MESSAGES_FLAG,
|
|
193
216
|
FUNCTION_LOCALE,
|
|
217
|
+
SAFE_CHAIN_MAP,
|
|
194
218
|
SERVICE_API_KEY
|
|
195
219
|
};
|
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: '
|
|
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) => {
|
|
@@ -13109,10 +13110,12 @@ if(!timestamp || !chain || !apiKey) return
|
|
|
13109
13110
|
};
|
|
13110
13111
|
|
|
13111
13112
|
async function ETHERSCAN(address, page, offset) {
|
|
13112
|
-
|
|
13113
|
-
|
|
13114
13113
|
const API_KEY = window.localStorage.getItem(SERVICE_API_KEY.Etherscan);
|
|
13115
|
-
|
|
13114
|
+
if(!API_KEY){
|
|
13115
|
+
return `${SERVICE_API_KEY.Etherscan}${ERROR_MESSAGES_FLAG.MISSING_KEY}`
|
|
13116
|
+
}
|
|
13117
|
+
// temporary added for testing rate limit flow
|
|
13118
|
+
if(API_KEY === 'xxxx'){
|
|
13116
13119
|
return `${SERVICE_API_KEY.Etherscan}${ERROR_MESSAGES_FLAG.RATE_LIMIT}`
|
|
13117
13120
|
}
|
|
13118
13121
|
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}`;
|
|
@@ -13218,10 +13221,6 @@ async function EOA(address, categories, chain, startTime, endTime) {
|
|
|
13218
13221
|
}
|
|
13219
13222
|
}
|
|
13220
13223
|
|
|
13221
|
-
|
|
13222
|
-
|
|
13223
|
-
|
|
13224
|
-
|
|
13225
13224
|
async function FLVURL(token, vs_currencies) {
|
|
13226
13225
|
return new Promise((resolve) => {
|
|
13227
13226
|
setTimeout(() => {
|
package/package.json
CHANGED