From 2c2c23591e2aab985b3d459158488a8fd2747b09 Mon Sep 17 00:00:00 2001 From: fedorovdg Date: Wed, 4 Sep 2024 23:45:45 +0400 Subject: [PATCH 1/2] fix: fixed userGaugeVotes --- src/dao.ts | 16 ++++++++-------- src/interfaces.ts | 3 ++- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/dao.ts b/src/dao.ts index c9bc8ed3..3ed2e160 100644 --- a/src/dao.ts +++ b/src/dao.ts @@ -226,11 +226,11 @@ export const getVotingGaugeList = async (): Promise => { for (let i = 0; i < gaugeData.length; i++) { if ((gaugeData[i].is_killed || gaugeData[i].hasNoCrv) && Number(gaugeData[i].gauge_controller.gauge_relative_weight) === 0) continue; res.push({ - poolUrl: gaugeData[i].poolUrls.swap[0], - network: _extractNetworkFromPoolUrl(gaugeData[i].poolUrls.swap[0]), + poolUrl: gaugeData[i].poolUrls?.swap[0] || '', + network: gaugeData[i].blockchainId, gaugeAddress: gaugeData[i].gauge, - poolAddress: gaugeData[i].swap, - lpTokenAddress: gaugeData[i].swap_token, + poolAddress: gaugeData[i].swap || '', + lpTokenAddress: gaugeData[i].swap_token || '', poolName: gaugeData[i].shortName, totalVeCrv: curve.formatUnits(gaugeData[i].gauge_controller.get_gauge_weight, 18), relativeWeight: curve.formatUnits(gaugeData[i].gauge_controller.gauge_relative_weight, 16), @@ -267,11 +267,11 @@ export const userGaugeVotes = async (address = ""): Promise<{ gauges: IGaugeUser userFutureVeCrv: curve.formatUnits(veCrvBalance * votes[i][1] / BigInt(10000), 18), expired: dt === BigInt(0), gaugeData: { - poolUrl: gaugeData[i].poolUrls.swap[0], - network: _extractNetworkFromPoolUrl(gaugeData[i].poolUrls.swap[0]), + poolUrl: gaugeData[i].poolUrls?.swap[0] || '', + network: gaugeData[i].blockchainId, gaugeAddress: gaugeData[i].gauge, - poolAddress: gaugeData[i].swap, - lpTokenAddress: gaugeData[i].swap_token, + poolAddress: gaugeData[i].swap || '', + lpTokenAddress: gaugeData[i].swap_token || '', poolName: gaugeData[i].shortName, totalVeCrv: curve.formatUnits(gaugeData[i].gauge_controller.get_gauge_weight, 18), relativeWeight: curve.formatUnits(gaugeData[i].gauge_controller.gauge_relative_weight, 16), diff --git a/src/interfaces.ts b/src/interfaces.ts index 945ca146..ec3bfa96 100644 --- a/src/interfaces.ts +++ b/src/interfaces.ts @@ -176,6 +176,7 @@ export interface IProfit { } export interface IGaugesDataFromApi { + blockchainId: string; gauge: string, swap: string, swap_token: string, @@ -184,7 +185,7 @@ export interface IGaugesDataFromApi { gauge_relative_weight: string, get_gauge_weight: string, }, - poolUrls: { + poolUrls?: { swap: string[], } is_killed?: boolean, From a7a676213c0ca6a3cddc381ccdcb2528eba355f0 Mon Sep 17 00:00:00 2001 From: fedorovdg Date: Wed, 4 Sep 2024 23:46:27 +0400 Subject: [PATCH 2/2] build: v2.63.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 09406a0c..d375ed17 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@curvefi/api", - "version": "2.63.2", + "version": "2.63.3", "description": "JavaScript library for curve.fi", "main": "lib/index.js", "author": "Macket",