@fileverse-dev/formulajs 4.4.11-mod-80 → 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.
@@ -1,4 +1,4 @@
1
- /* @fileverse-dev/formulajs v4.4.11-mod-80 */
1
+ /* @fileverse-dev/formulajs v4.4.11-mod-82 */
2
2
  var _excluded = [ "confirmations", "dataDecoded" ];
3
3
 
4
4
  function _objectWithoutProperties(e, t) {
@@ -11126,45 +11126,52 @@ function _typeof(o) {
11126
11126
  _inherits(InvalidApiKeyError, _Error6);
11127
11127
  return _createClass(InvalidApiKeyError);
11128
11128
  }(_wrapNativeSuper(Error));
11129
- var fileverseProxyUrl = "".concat(window.NEXT_PUBLIC_PROXY_BASE_URL, "/proxy");
11130
- var PROXY_MAP = {
11131
- Etherscan: {
11132
- url: fileverseProxyUrl,
11133
- removeParams: [ "apikey" ]
11134
- },
11135
- Basescan: {
11136
- url: fileverseProxyUrl,
11137
- removeParams: [ "apikey" ]
11138
- },
11139
- Gnosisscan: {
11140
- url: fileverseProxyUrl,
11141
- removeParams: [ "apikey" ]
11142
- },
11143
- Coingecko: {
11144
- url: fileverseProxyUrl,
11145
- removeParams: [ "apikey" ]
11146
- },
11147
- Firefly: {
11148
- url: fileverseProxyUrl,
11149
- removeParams: [ "apikey" ]
11150
- },
11151
- Neynar: {
11152
- url: fileverseProxyUrl,
11153
- removeParams: [ "api_key" ]
11154
- },
11155
- Safe: {
11156
- url: fileverseProxyUrl,
11157
- removeParams: [ "api_key" ]
11158
- },
11159
- Defillama: {
11160
- url: fileverseProxyUrl,
11161
- removeParams: [ "api_key" ]
11162
- },
11163
- GnosisPay: {
11164
- url: fileverseProxyUrl,
11165
- removeParams: [ "api_key" ]
11129
+ var PROXY_MAP;
11130
+ function initializeProxyMap() {
11131
+ console.log("initializeProxyMap", window.NEXT_PUBLIC_PROXY_BASE_URL);
11132
+ if (!PROXY_MAP) {
11133
+ var fileverseProxyUrl = "".concat(window.NEXT_PUBLIC_PROXY_BASE_URL, "/proxy");
11134
+ PROXY_MAP = {
11135
+ Etherscan: {
11136
+ url: "".concat(fileverseProxyUrl, "/proxy"),
11137
+ removeParams: [ "apikey" ]
11138
+ },
11139
+ Basescan: {
11140
+ url: "".concat(fileverseProxyUrl, "/proxy"),
11141
+ removeParams: [ "apikey" ]
11142
+ },
11143
+ Gnosisscan: {
11144
+ url: "".concat(fileverseProxyUrl, "/proxy"),
11145
+ removeParams: [ "apikey" ]
11146
+ },
11147
+ Coingecko: {
11148
+ url: "".concat(fileverseProxyUrl, "/proxy"),
11149
+ removeParams: [ "apikey" ]
11150
+ },
11151
+ Firefly: {
11152
+ url: "".concat(fileverseProxyUrl, "/proxy"),
11153
+ removeParams: [ "apikey" ]
11154
+ },
11155
+ Neynar: {
11156
+ url: "".concat(fileverseProxyUrl, "/proxy"),
11157
+ removeParams: [ "api_key" ]
11158
+ },
11159
+ Safe: {
11160
+ url: "".concat(fileverseProxyUrl, "/proxy"),
11161
+ removeParams: [ "api_key" ]
11162
+ },
11163
+ Defillama: {
11164
+ url: "".concat(fileverseProxyUrl, "/proxy"),
11165
+ removeParams: [ "api_key" ]
11166
+ },
11167
+ GnosisPay: {
11168
+ url: "".concat(fileverseProxyUrl, "/proxy"),
11169
+ removeParams: [ "api_key" ]
11170
+ }
11171
+ };
11166
11172
  }
11167
- };
11173
+ return PROXY_MAP;
11174
+ }
11168
11175
  function removeUrlParams(url, paramsToRemove) {
11169
11176
  if (!paramsToRemove || paramsToRemove.length === 0) {
11170
11177
  return url;
@@ -11179,9 +11186,10 @@ function _typeof(o) {
11179
11186
  }
11180
11187
  function getUrlAndHeaders(_ref) {
11181
11188
  var url = _ref.url, serviceName = _ref.serviceName, _ref$headers = _ref.headers, headers = _ref$headers === void 0 ? {} : _ref$headers;
11189
+ var proxyMap = initializeProxyMap();
11182
11190
  var apiKeyLS = window.localStorage.getItem(SERVICES_API_KEY[serviceName]);
11183
11191
  var isProxyModeEnabledValue = apiKeyLS === "DEFAULT_PROXY_MODE";
11184
- var proxyConfig = PROXY_MAP[serviceName];
11192
+ var proxyConfig = proxyMap[serviceName];
11185
11193
  if (!proxyConfig && SERVICES_API_KEY[serviceName] && (!apiKeyLS || apiKeyLS === "")) {
11186
11194
  throw new MissingApiKeyError(SERVICES_API_KEY[serviceName]);
11187
11195
  }