From c1c91a6bf85a6b743a87236a15d88372a3440f72 Mon Sep 17 00:00:00 2001 From: fedorovdg Date: Tue, 12 Nov 2024 23:50:31 +0400 Subject: [PATCH 1/2] feat: add nativeCurrencySymbol to _getCurveLiteNetworks --- src/external-api.ts | 1 + src/interfaces.ts | 1 + src/utils.ts | 8 -------- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/external-api.ts b/src/external-api.ts index 9e2435e4..380a707c 100644 --- a/src/external-api.ts +++ b/src/external-api.ts @@ -317,6 +317,7 @@ export const _getCurveLiteNetworks = memoize( rpcUrl: metadata.rpcUrl, chainId: metadata.chainId, explorerUrl: metadata.explorerBaseUrl, + nativeCurrencySymbol: metadata.nativeCurrencySymbol, }; }) .filter((network): network is ICurveLiteNetwork => network !== null); diff --git a/src/interfaces.ts b/src/interfaces.ts index a3eb4576..6bc50b51 100644 --- a/src/interfaces.ts +++ b/src/interfaces.ts @@ -288,6 +288,7 @@ export interface ICurveLiteNetwork { name: string rpcUrl: string explorerUrl: string + nativeCurrencySymbol: string } export type TVoteType = "PARAMETER" | "OWNERSHIP" diff --git a/src/utils.ts b/src/utils.ts index 65f57672..995cdb26 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -425,10 +425,6 @@ export const _getRewardsFromApi = async (): Promise> => const _usdRatesCache: IDict<{ rate: number, time: number }> = {} export const _getUsdRate = async (assetId: string): Promise => { - if(curve.isLiteChain) { - throw Error('This method is not supported for the lite version') - } - if (curve.chainId === 1 && assetId.toLowerCase() === '0x8762db106b2c2a0bccb3a80d1ed41273552616e8') return 0; // RSR const pricesFromApi = await _getUsdPricesFromApi(); if (assetId.toLowerCase() in pricesFromApi) return pricesFromApi[assetId.toLowerCase()]; @@ -515,10 +511,6 @@ export const _getUsdRate = async (assetId: string): Promise => { } export const getUsdRate = async (coin: string): Promise => { - if(curve.isLiteChain) { - throw Error('This method is not supported for the lite version') - } - const [coinAddress] = _getCoinAddressesNoCheck(coin); return await _getUsdRate(coinAddress); } From 376774bd58822f38be5cdc8b6f5224cf86fa3393 Mon Sep 17 00:00:00 2001 From: fedorovdg Date: Wed, 13 Nov 2024 00:03:44 +0400 Subject: [PATCH 2/2] build: v2.65.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4b8ec511..79df4a8b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@curvefi/api", - "version": "2.65.2", + "version": "2.65.3", "description": "JavaScript library for curve.fi", "main": "lib/index.js", "author": "Macket",