@fileverse-dev/formulajs 4.4.11-mod-81 → 4.4.11-mod-82
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 +48 -39
- package/lib/browser/formula.min.js +2 -2
- package/lib/browser/formula.min.js.map +1 -1
- package/lib/cjs/index.cjs +65 -12
- package/lib/esm/index.mjs +65 -12
- package/package.json +1 -1
package/lib/cjs/index.cjs
CHANGED
|
@@ -13189,47 +13189,99 @@ class InvalidApiKeyError extends Error {
|
|
|
13189
13189
|
}
|
|
13190
13190
|
}
|
|
13191
13191
|
|
|
13192
|
-
|
|
13193
|
-
|
|
13192
|
+
let PROXY_MAP;
|
|
13193
|
+
|
|
13194
|
+
function initializeProxyMap() {
|
|
13195
|
+
console.log('initializeProxyMap', window.NEXT_PUBLIC_PROXY_BASE_URL);
|
|
13196
|
+
if (!PROXY_MAP) {
|
|
13197
|
+
const fileverseProxyUrl = `${window.NEXT_PUBLIC_PROXY_BASE_URL}/proxy`;
|
|
13198
|
+
|
|
13199
|
+
PROXY_MAP = {
|
|
13194
13200
|
Etherscan: {
|
|
13195
|
-
url: `${
|
|
13201
|
+
url: `${fileverseProxyUrl}/proxy`,
|
|
13196
13202
|
removeParams: ['apikey']
|
|
13197
13203
|
},
|
|
13198
13204
|
Basescan: {
|
|
13199
|
-
url: `${
|
|
13205
|
+
url: `${fileverseProxyUrl}/proxy`,
|
|
13200
13206
|
removeParams: ['apikey']
|
|
13201
13207
|
},
|
|
13202
13208
|
Gnosisscan: {
|
|
13203
|
-
url: `${
|
|
13209
|
+
url: `${fileverseProxyUrl}/proxy`,
|
|
13204
13210
|
removeParams: ['apikey']
|
|
13205
13211
|
},
|
|
13206
13212
|
Coingecko: {
|
|
13207
|
-
url: `${
|
|
13213
|
+
url: `${fileverseProxyUrl}/proxy`,
|
|
13208
13214
|
removeParams: ['apikey']
|
|
13209
13215
|
},
|
|
13210
13216
|
Firefly: {
|
|
13211
|
-
url: `${
|
|
13217
|
+
url: `${fileverseProxyUrl}/proxy`,
|
|
13212
13218
|
removeParams: ['apikey']
|
|
13213
13219
|
},
|
|
13214
13220
|
Neynar: {
|
|
13215
|
-
url: `${
|
|
13221
|
+
url: `${fileverseProxyUrl}/proxy`,
|
|
13216
13222
|
removeParams: ['api_key']
|
|
13217
13223
|
},
|
|
13218
13224
|
Safe: {
|
|
13219
|
-
url: `${
|
|
13225
|
+
url: `${fileverseProxyUrl}/proxy`,
|
|
13220
13226
|
removeParams: ['api_key']
|
|
13221
13227
|
},
|
|
13222
13228
|
Defillama: {
|
|
13223
|
-
url: `${
|
|
13229
|
+
url: `${fileverseProxyUrl}/proxy`,
|
|
13224
13230
|
removeParams: ['api_key']
|
|
13225
13231
|
},
|
|
13226
13232
|
GnosisPay: {
|
|
13227
|
-
url: `${
|
|
13233
|
+
url: `${fileverseProxyUrl}/proxy`,
|
|
13228
13234
|
removeParams: ['api_key']
|
|
13229
13235
|
},
|
|
13230
13236
|
// Add more services as needed. It can be direct url instead of ENV variable
|
|
13231
13237
|
// ANOTHER_SERVICE: "https://another-proxy-url.com"
|
|
13232
13238
|
};
|
|
13239
|
+
}
|
|
13240
|
+
return PROXY_MAP;
|
|
13241
|
+
}
|
|
13242
|
+
|
|
13243
|
+
// const fileverseProxyUrl = `${window.NEXT_PUBLIC_PROXY_BASE_URL}/proxy`
|
|
13244
|
+
// // Proxy map configuration
|
|
13245
|
+
// const PROXY_MAP = {
|
|
13246
|
+
// Etherscan: {
|
|
13247
|
+
// url: `${process.env.NEXT_PUBLIC_PROXY_BASE_URL}/proxy`,
|
|
13248
|
+
// removeParams: ['apikey']
|
|
13249
|
+
// },
|
|
13250
|
+
// Basescan: {
|
|
13251
|
+
// url: `${process.env.NEXT_PUBLIC_PROXY_BASE_URL}/proxy`,
|
|
13252
|
+
// removeParams: ['apikey']
|
|
13253
|
+
// },
|
|
13254
|
+
// Gnosisscan: {
|
|
13255
|
+
// url: `${process.env.NEXT_PUBLIC_PROXY_BASE_URL}/proxy`,
|
|
13256
|
+
// removeParams: ['apikey']
|
|
13257
|
+
// },
|
|
13258
|
+
// Coingecko: {
|
|
13259
|
+
// url: `${process.env.NEXT_PUBLIC_PROXY_BASE_URL}/proxy`,
|
|
13260
|
+
// removeParams: ['apikey']
|
|
13261
|
+
// },
|
|
13262
|
+
// Firefly: {
|
|
13263
|
+
// url: `${process.env.NEXT_PUBLIC_PROXY_BASE_URL}/proxy`,
|
|
13264
|
+
// removeParams: ['apikey']
|
|
13265
|
+
// },
|
|
13266
|
+
// Neynar: {
|
|
13267
|
+
// url: `${process.env.NEXT_PUBLIC_PROXY_BASE_URL}/proxy`,
|
|
13268
|
+
// removeParams: ['api_key']
|
|
13269
|
+
// },
|
|
13270
|
+
// Safe: {
|
|
13271
|
+
// url: `${process.env.NEXT_PUBLIC_PROXY_BASE_URL}/proxy`,
|
|
13272
|
+
// removeParams: ['api_key']
|
|
13273
|
+
// },
|
|
13274
|
+
// Defillama: {
|
|
13275
|
+
// url: `${process.env.NEXT_PUBLIC_PROXY_BASE_URL}/proxy`,
|
|
13276
|
+
// removeParams: ['api_key']
|
|
13277
|
+
// },
|
|
13278
|
+
// GnosisPay: {
|
|
13279
|
+
// url: `${process.env.NEXT_PUBLIC_PROXY_BASE_URL}/proxy`,
|
|
13280
|
+
// removeParams: ['api_key']
|
|
13281
|
+
// },
|
|
13282
|
+
// // Add more services as needed. It can be direct url instead of ENV variable
|
|
13283
|
+
// // ANOTHER_SERVICE: "https://another-proxy-url.com"
|
|
13284
|
+
// };
|
|
13233
13285
|
|
|
13234
13286
|
/**
|
|
13235
13287
|
* Removes specified parameters from a URL
|
|
@@ -13261,12 +13313,13 @@ function removeUrlParams(url, paramsToRemove) {
|
|
|
13261
13313
|
* @returns {Object} Object containing URL and HEADERS for the fetch request
|
|
13262
13314
|
*/
|
|
13263
13315
|
function getUrlAndHeaders({ url, serviceName, headers = {} }) {
|
|
13316
|
+
const proxyMap = initializeProxyMap();
|
|
13264
13317
|
// Check if proxy is enabled in localStorage
|
|
13265
13318
|
const apiKeyLS = window.localStorage.getItem(SERVICES_API_KEY[serviceName]);
|
|
13266
13319
|
const isProxyModeEnabledValue = apiKeyLS === 'DEFAULT_PROXY_MODE';
|
|
13267
13320
|
|
|
13268
13321
|
// Check if proxy URL exists for this service
|
|
13269
|
-
const proxyConfig =
|
|
13322
|
+
const proxyConfig = proxyMap[serviceName];
|
|
13270
13323
|
|
|
13271
13324
|
if (!proxyConfig && SERVICES_API_KEY[serviceName] && (!apiKeyLS || apiKeyLS === '')) {
|
|
13272
13325
|
throw new MissingApiKeyError(SERVICES_API_KEY[serviceName])
|
package/lib/esm/index.mjs
CHANGED
|
@@ -13187,47 +13187,99 @@ class InvalidApiKeyError extends Error {
|
|
|
13187
13187
|
}
|
|
13188
13188
|
}
|
|
13189
13189
|
|
|
13190
|
-
|
|
13191
|
-
|
|
13190
|
+
let PROXY_MAP;
|
|
13191
|
+
|
|
13192
|
+
function initializeProxyMap() {
|
|
13193
|
+
console.log('initializeProxyMap', window.NEXT_PUBLIC_PROXY_BASE_URL);
|
|
13194
|
+
if (!PROXY_MAP) {
|
|
13195
|
+
const fileverseProxyUrl = `${window.NEXT_PUBLIC_PROXY_BASE_URL}/proxy`;
|
|
13196
|
+
|
|
13197
|
+
PROXY_MAP = {
|
|
13192
13198
|
Etherscan: {
|
|
13193
|
-
url: `${
|
|
13199
|
+
url: `${fileverseProxyUrl}/proxy`,
|
|
13194
13200
|
removeParams: ['apikey']
|
|
13195
13201
|
},
|
|
13196
13202
|
Basescan: {
|
|
13197
|
-
url: `${
|
|
13203
|
+
url: `${fileverseProxyUrl}/proxy`,
|
|
13198
13204
|
removeParams: ['apikey']
|
|
13199
13205
|
},
|
|
13200
13206
|
Gnosisscan: {
|
|
13201
|
-
url: `${
|
|
13207
|
+
url: `${fileverseProxyUrl}/proxy`,
|
|
13202
13208
|
removeParams: ['apikey']
|
|
13203
13209
|
},
|
|
13204
13210
|
Coingecko: {
|
|
13205
|
-
url: `${
|
|
13211
|
+
url: `${fileverseProxyUrl}/proxy`,
|
|
13206
13212
|
removeParams: ['apikey']
|
|
13207
13213
|
},
|
|
13208
13214
|
Firefly: {
|
|
13209
|
-
url: `${
|
|
13215
|
+
url: `${fileverseProxyUrl}/proxy`,
|
|
13210
13216
|
removeParams: ['apikey']
|
|
13211
13217
|
},
|
|
13212
13218
|
Neynar: {
|
|
13213
|
-
url: `${
|
|
13219
|
+
url: `${fileverseProxyUrl}/proxy`,
|
|
13214
13220
|
removeParams: ['api_key']
|
|
13215
13221
|
},
|
|
13216
13222
|
Safe: {
|
|
13217
|
-
url: `${
|
|
13223
|
+
url: `${fileverseProxyUrl}/proxy`,
|
|
13218
13224
|
removeParams: ['api_key']
|
|
13219
13225
|
},
|
|
13220
13226
|
Defillama: {
|
|
13221
|
-
url: `${
|
|
13227
|
+
url: `${fileverseProxyUrl}/proxy`,
|
|
13222
13228
|
removeParams: ['api_key']
|
|
13223
13229
|
},
|
|
13224
13230
|
GnosisPay: {
|
|
13225
|
-
url: `${
|
|
13231
|
+
url: `${fileverseProxyUrl}/proxy`,
|
|
13226
13232
|
removeParams: ['api_key']
|
|
13227
13233
|
},
|
|
13228
13234
|
// Add more services as needed. It can be direct url instead of ENV variable
|
|
13229
13235
|
// ANOTHER_SERVICE: "https://another-proxy-url.com"
|
|
13230
13236
|
};
|
|
13237
|
+
}
|
|
13238
|
+
return PROXY_MAP;
|
|
13239
|
+
}
|
|
13240
|
+
|
|
13241
|
+
// const fileverseProxyUrl = `${window.NEXT_PUBLIC_PROXY_BASE_URL}/proxy`
|
|
13242
|
+
// // Proxy map configuration
|
|
13243
|
+
// const PROXY_MAP = {
|
|
13244
|
+
// Etherscan: {
|
|
13245
|
+
// url: `${process.env.NEXT_PUBLIC_PROXY_BASE_URL}/proxy`,
|
|
13246
|
+
// removeParams: ['apikey']
|
|
13247
|
+
// },
|
|
13248
|
+
// Basescan: {
|
|
13249
|
+
// url: `${process.env.NEXT_PUBLIC_PROXY_BASE_URL}/proxy`,
|
|
13250
|
+
// removeParams: ['apikey']
|
|
13251
|
+
// },
|
|
13252
|
+
// Gnosisscan: {
|
|
13253
|
+
// url: `${process.env.NEXT_PUBLIC_PROXY_BASE_URL}/proxy`,
|
|
13254
|
+
// removeParams: ['apikey']
|
|
13255
|
+
// },
|
|
13256
|
+
// Coingecko: {
|
|
13257
|
+
// url: `${process.env.NEXT_PUBLIC_PROXY_BASE_URL}/proxy`,
|
|
13258
|
+
// removeParams: ['apikey']
|
|
13259
|
+
// },
|
|
13260
|
+
// Firefly: {
|
|
13261
|
+
// url: `${process.env.NEXT_PUBLIC_PROXY_BASE_URL}/proxy`,
|
|
13262
|
+
// removeParams: ['apikey']
|
|
13263
|
+
// },
|
|
13264
|
+
// Neynar: {
|
|
13265
|
+
// url: `${process.env.NEXT_PUBLIC_PROXY_BASE_URL}/proxy`,
|
|
13266
|
+
// removeParams: ['api_key']
|
|
13267
|
+
// },
|
|
13268
|
+
// Safe: {
|
|
13269
|
+
// url: `${process.env.NEXT_PUBLIC_PROXY_BASE_URL}/proxy`,
|
|
13270
|
+
// removeParams: ['api_key']
|
|
13271
|
+
// },
|
|
13272
|
+
// Defillama: {
|
|
13273
|
+
// url: `${process.env.NEXT_PUBLIC_PROXY_BASE_URL}/proxy`,
|
|
13274
|
+
// removeParams: ['api_key']
|
|
13275
|
+
// },
|
|
13276
|
+
// GnosisPay: {
|
|
13277
|
+
// url: `${process.env.NEXT_PUBLIC_PROXY_BASE_URL}/proxy`,
|
|
13278
|
+
// removeParams: ['api_key']
|
|
13279
|
+
// },
|
|
13280
|
+
// // Add more services as needed. It can be direct url instead of ENV variable
|
|
13281
|
+
// // ANOTHER_SERVICE: "https://another-proxy-url.com"
|
|
13282
|
+
// };
|
|
13231
13283
|
|
|
13232
13284
|
/**
|
|
13233
13285
|
* Removes specified parameters from a URL
|
|
@@ -13259,12 +13311,13 @@ function removeUrlParams(url, paramsToRemove) {
|
|
|
13259
13311
|
* @returns {Object} Object containing URL and HEADERS for the fetch request
|
|
13260
13312
|
*/
|
|
13261
13313
|
function getUrlAndHeaders({ url, serviceName, headers = {} }) {
|
|
13314
|
+
const proxyMap = initializeProxyMap();
|
|
13262
13315
|
// Check if proxy is enabled in localStorage
|
|
13263
13316
|
const apiKeyLS = window.localStorage.getItem(SERVICES_API_KEY[serviceName]);
|
|
13264
13317
|
const isProxyModeEnabledValue = apiKeyLS === 'DEFAULT_PROXY_MODE';
|
|
13265
13318
|
|
|
13266
13319
|
// Check if proxy URL exists for this service
|
|
13267
|
-
const proxyConfig =
|
|
13320
|
+
const proxyConfig = proxyMap[serviceName];
|
|
13268
13321
|
|
|
13269
13322
|
if (!proxyConfig && SERVICES_API_KEY[serviceName] && (!apiKeyLS || apiKeyLS === '')) {
|
|
13270
13323
|
throw new MissingApiKeyError(SERVICES_API_KEY[serviceName])
|