From 9e4fe6ccef5ec13a06172a4856c8849ef0f34f30 Mon Sep 17 00:00:00 2001 From: Max Strasinsky Date: Thu, 19 Dec 2024 08:49:46 +0100 Subject: [PATCH] Add voting power related fields to NeuronInfo --- packages/nns/src/canisters/governance/response.converters.ts | 4 ++++ packages/nns/src/types/governance_converters.ts | 3 +++ 2 files changed, 7 insertions(+) diff --git a/packages/nns/src/canisters/governance/response.converters.ts b/packages/nns/src/canisters/governance/response.converters.ts index 2304efdda..a10cfcc2e 100644 --- a/packages/nns/src/canisters/governance/response.converters.ts +++ b/packages/nns/src/canisters/governance/response.converters.ts @@ -142,7 +142,11 @@ export const toNeuronInfo = ({ ? neuronInfo.joined_community_fund_timestamp_seconds[0] : undefined, retrievedAtTimestampSeconds: neuronInfo.retrieved_at_timestamp_seconds, + /** @deprecated */ votingPower: neuronInfo.voting_power, + votingPowerRefreshedTimestampSeconds : fromNullable(neuronInfo.voting_power_refreshed_timestamp_seconds), + decidingVotingPower : fromNullable(neuronInfo.deciding_voting_power), + potentialVotingPower : fromNullable(neuronInfo.potential_voting_power), ageSeconds: neuronInfo.age_seconds, visibility: fromNullable(neuronInfo.visibility) as | NeuronVisibility diff --git a/packages/nns/src/types/governance_converters.ts b/packages/nns/src/types/governance_converters.ts index f565d50b1..8b81a3be9 100644 --- a/packages/nns/src/types/governance_converters.ts +++ b/packages/nns/src/types/governance_converters.ts @@ -393,6 +393,9 @@ export interface NeuronInfo { joinedCommunityFundTimestampSeconds: Option; retrievedAtTimestampSeconds: bigint; votingPower: bigint; + votingPowerRefreshedTimestampSeconds: Option; + decidingVotingPower: Option; + potentialVotingPower: Option; ageSeconds: bigint; fullNeuron: Option; visibility: Option;