@curvefi/api 2.70.0 → 2.70.2

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.
@@ -100,7 +100,7 @@ export function routeFinderWorker() {
100
100
  }
101
101
  return _removeDuplications(targetRoutesByTvl, targetRoutesByLength).map((r) => r.route);
102
102
  };
103
- if (typeof addEventListener === 'undefined') {
103
+ if (typeof Worker === 'undefined') {
104
104
  return findRoutes; // for nodejs
105
105
  }
106
106
  addEventListener('message', (e) => {
@@ -531,7 +531,7 @@ export function routeGraphWorker() {
531
531
  console.log(`Read ${allPools.length} pools`, `${Date.now() - start}ms, routerGraph: ${Object.keys(routerGraph).length} items`);
532
532
  return routerGraph;
533
533
  };
534
- if (typeof addEventListener === 'undefined') {
534
+ if (typeof Worker === 'undefined') {
535
535
  return createRouteGraph; // for nodejs
536
536
  }
537
537
  addEventListener('message', (e) => {
package/lib/utils.js CHANGED
@@ -348,6 +348,11 @@ export function _getUsdRate(assetId) {
348
348
  if (this.chainId === ARC_CHAIN_ID && (this.isEth(assetId) ||
349
349
  assetId.toLowerCase() === this.constants.NATIVE_TOKEN.wrappedAddress.toLowerCase()))
350
350
  return 1;
351
+ if (this.isEth(assetId)) {
352
+ const wrappedPrice = pricesFromApi[this.constants.NATIVE_TOKEN.wrappedAddress.toLowerCase()];
353
+ if (wrappedPrice)
354
+ return wrappedPrice;
355
+ }
351
356
  let chainName = this.isLiteChain ? yield this.constants.NETWORK_NAME : {
352
357
  1: 'ethereum',
353
358
  10: 'optimistic-ethereum',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@curvefi/api",
3
- "version": "2.70.0",
3
+ "version": "2.70.2",
4
4
  "description": "JavaScript library for curve.finance",
5
5
  "main": "lib/index.js",
6
6
  "author": "Macket",