@fileverse-dev/formulajs 4.4.11-mod-81 → 4.4.11-mod-83

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