diff --git a/package.json b/package.json index a9d8c999..74f2603a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@curvefi/api", - "version": "2.65.23", + "version": "2.65.24", "description": "JavaScript library for curve.fi", "main": "lib/index.js", "author": "Macket", diff --git a/src/external-api.ts b/src/external-api.ts index 23fa9bb7..f2e2c5ce 100644 --- a/src/external-api.ts +++ b/src/external-api.ts @@ -291,7 +291,7 @@ export const _getLiteNetworksData = memoize( wrappedAddress: wrapped_native_token, }, API_CONSTANTS: { - nativeTokenName: config.native_currency_coingecko_id || config.platform_coingecko_id, + nativeTokenName: config.native_currency_coingecko_id, wrappedNativeTokenAddress: config.wrapped_native_token, }, }; diff --git a/src/utils.ts b/src/utils.ts index 7f77e0dc..2de4ec47 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -476,7 +476,11 @@ export const _getUsdRate = async (assetId: string): Promise => { } if (nativeTokenName === undefined) { - throw Error('nativeTokenName not found') + if(curve.isLiteChain && curve.constants.API_CONSTANTS?.wrappedNativeTokenAddress.toLowerCase() && curve.constants.API_CONSTANTS?.wrappedNativeTokenAddress.toLowerCase() in pricesFromApi) { + return pricesFromApi[curve.constants.API_CONSTANTS?.wrappedNativeTokenAddress.toLowerCase()]; + } else { + throw Error('nativeTokenName not found') + } } assetId = {