Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fixed dao userGaugeVotes #447

Merged
merged 3 commits into from
Feb 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@curvefi/api",
"version": "2.66.5",
"version": "2.66.6",
"description": "JavaScript library for curve.fi",
"main": "lib/index.js",
"author": "Macket",
Expand Down
3 changes: 2 additions & 1 deletion src/dao.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@

// ----------------- Gauge weights -----------------

const _extractNetworkFromPoolUrl = (poolUrl: string): string => {

Check warning on line 217 in src/dao.ts

View workflow job for this annotation

GitHub Actions / test

'_extractNetworkFromPoolUrl' is assigned a value but never used
if (!poolUrl) return "unknown";
return poolUrl.split("/")[4]
}
Expand Down Expand Up @@ -250,7 +250,8 @@
const gaugeData = Object.values(await _getAllGauges());
const calls: any[] = [veMulticallContract.balanceOf(address)];
for (const d of gaugeData) {
calls.push(gcMulticallContract.vote_user_slopes(address, d.gauge));
const gaugeAddress = d.rootGauge ? d.rootGauge : d.gauge;
calls.push(gcMulticallContract.vote_user_slopes(address, gaugeAddress));
}
const [veCrvBalance, ...votes] = await curve.multicallProvider.all(calls) as [bigint, bigint[]];

Expand Down
1 change: 1 addition & 0 deletions src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ export interface IProfit {
export interface IGaugesDataFromApi {
blockchainId: string;
gauge: string,
rootGauge?: string,
swap: string,
swap_token: string,
shortName: string,
Expand Down
Loading