@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.
@@ -1,4 +1,4 @@
1
- /* @fileverse-dev/formulajs v4.4.11-mod-81 */
1
+ /* @fileverse-dev/formulajs v4.4.11-mod-82 */
2
2
  var _excluded = [ "confirmations", "dataDecoded" ];
3
3
 
4
4
  function _objectWithoutProperties(e, t) {
@@ -11126,44 +11126,52 @@ 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
+ 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
+ };
11165
11172
  }
11166
- };
11173
+ return PROXY_MAP;
11174
+ }
11167
11175
  function removeUrlParams(url, paramsToRemove) {
11168
11176
  if (!paramsToRemove || paramsToRemove.length === 0) {
11169
11177
  return url;
@@ -11178,9 +11186,10 @@ function _typeof(o) {
11178
11186
  }
11179
11187
  function getUrlAndHeaders(_ref) {
11180
11188
  var url = _ref.url, serviceName = _ref.serviceName, _ref$headers = _ref.headers, headers = _ref$headers === void 0 ? {} : _ref$headers;
11189
+ var proxyMap = initializeProxyMap();
11181
11190
  var apiKeyLS = window.localStorage.getItem(SERVICES_API_KEY[serviceName]);
11182
11191
  var isProxyModeEnabledValue = apiKeyLS === "DEFAULT_PROXY_MODE";
11183
- var proxyConfig = PROXY_MAP[serviceName];
11192
+ var proxyConfig = proxyMap[serviceName];
11184
11193
  if (!proxyConfig && SERVICES_API_KEY[serviceName] && (!apiKeyLS || apiKeyLS === "")) {
11185
11194
  throw new MissingApiKeyError(SERVICES_API_KEY[serviceName]);
11186
11195
  }