From e314c91e0f69f60e1dda749d8f177839f3ec5078 Mon Sep 17 00:00:00 2001 From: Max Strasinsky <98811342+mstrasinskis@users.noreply.github.com> Date: Thu, 7 Dec 2023 14:55:18 +0100 Subject: [PATCH] Upgrade nns governance candid 2023 12 06 (#497) # Motivation Upgrade `nns/governance` and `nns/governance-test` to latest `ic` version. # Changes - `./scripts/import-candid` - `./scripts/compile-idl-js` - update response converters - nns size limit increased 35 -> 40KB # Tests - works # Todos - [ ] Add entry to changelog (if necessary). Not necessary --------- Co-authored-by: Carly Gundy <47304080+cgundy@users.noreply.github.com> Co-authored-by: Formatting Committer --- package.json | 2 +- .../nns/candid/governance.certified.idl.js | 107 ++++++++++++++++-- packages/nns/candid/governance.d.ts | 66 +++++++++-- packages/nns/candid/governance.did | 57 ++++++++-- packages/nns/candid/governance.idl.js | 107 ++++++++++++++++-- .../candid/governance_test.certified.idl.js | 107 ++++++++++++++++-- packages/nns/candid/governance_test.d.ts | 66 +++++++++-- packages/nns/candid/governance_test.did | 57 ++++++++-- packages/nns/candid/governance_test.idl.js | 107 ++++++++++++++++-- .../governance/response.converters.ts | 11 +- packages/nns/src/enums/governance.enums.ts | 13 +++ packages/nns/src/mocks/governance.mock.ts | 2 + .../nns/src/types/governance_converters.ts | 3 + 13 files changed, 631 insertions(+), 74 deletions(-) diff --git a/package.json b/package.json index d1992692..93b98775 100644 --- a/package.json +++ b/package.json @@ -109,7 +109,7 @@ { "name": "@dfinity/nns", "path": "./packages/nns/dist/index.js", - "limit": "35 kB", + "limit": "40 kB", "ignore": [ "@dfinity/agent", "@dfinity/candid", diff --git a/packages/nns/candid/governance.certified.idl.js b/packages/nns/candid/governance.certified.idl.js index 771383c0..6f4f77cc 100644 --- a/packages/nns/candid/governance.certified.idl.js +++ b/packages/nns/candid/governance.certified.idl.js @@ -293,6 +293,14 @@ export const idlFactory = ({ IDL }) => { 'caller' : IDL.Opt(IDL.Principal), 'proposer_id' : IDL.Opt(NeuronId), }); + const SeedAccount = IDL.Record({ + 'error_count' : IDL.Nat64, + 'account_id' : IDL.Text, + 'neuron_type' : IDL.Int32, + 'tag_end_timestamp_seconds' : IDL.Opt(IDL.Nat64), + 'tag_start_timestamp_seconds' : IDL.Opt(IDL.Nat64), + }); + const SeedAccounts = IDL.Record({ 'accounts' : IDL.Vec(SeedAccount) }); const MostRecentMonthlyNodeProviderRewards = IDL.Record({ 'timestamp' : IDL.Nat64, 'rewards' : IDL.Vec(RewardNodeProvider), @@ -311,17 +319,27 @@ export const idlFactory = ({ IDL }) => { 'not_dissolving_neurons_count_buckets' : IDL.Vec( IDL.Tuple(IDL.Nat64, IDL.Nat64) ), + 'ect_neuron_count' : IDL.Nat64, 'total_supply_icp' : IDL.Nat64, 'neurons_with_less_than_6_months_dissolve_delay_count' : IDL.Nat64, 'dissolved_neurons_count' : IDL.Nat64, 'community_fund_total_maturity_e8s_equivalent' : IDL.Nat64, + 'total_staked_e8s_seed' : IDL.Nat64, + 'total_staked_maturity_e8s_equivalent_ect' : IDL.Nat64, 'total_staked_e8s' : IDL.Nat64, 'not_dissolving_neurons_count' : IDL.Nat64, 'total_locked_e8s' : IDL.Nat64, 'neurons_fund_total_active_neurons' : IDL.Nat64, 'total_staked_maturity_e8s_equivalent' : IDL.Nat64, + 'not_dissolving_neurons_e8s_buckets_ect' : IDL.Vec( + IDL.Tuple(IDL.Nat64, IDL.Float64) + ), + 'total_staked_e8s_ect' : IDL.Nat64, 'not_dissolving_neurons_staked_maturity_e8s_equivalent_sum' : IDL.Nat64, 'dissolved_neurons_e8s' : IDL.Nat64, + 'dissolving_neurons_e8s_buckets_seed' : IDL.Vec( + IDL.Tuple(IDL.Nat64, IDL.Float64) + ), 'neurons_with_less_than_6_months_dissolve_delay_e8s' : IDL.Nat64, 'not_dissolving_neurons_staked_maturity_e8s_equivalent_buckets' : IDL.Vec( IDL.Tuple(IDL.Nat64, IDL.Float64) @@ -329,12 +347,20 @@ export const idlFactory = ({ IDL }) => { 'dissolving_neurons_count_buckets' : IDL.Vec( IDL.Tuple(IDL.Nat64, IDL.Nat64) ), + 'dissolving_neurons_e8s_buckets_ect' : IDL.Vec( + IDL.Tuple(IDL.Nat64, IDL.Float64) + ), 'dissolving_neurons_count' : IDL.Nat64, 'dissolving_neurons_e8s_buckets' : IDL.Vec( IDL.Tuple(IDL.Nat64, IDL.Float64) ), + 'total_staked_maturity_e8s_equivalent_seed' : IDL.Nat64, 'community_fund_total_staked_e8s' : IDL.Nat64, + 'not_dissolving_neurons_e8s_buckets_seed' : IDL.Vec( + IDL.Tuple(IDL.Nat64, IDL.Float64) + ), 'timestamp_seconds' : IDL.Nat64, + 'seed_neuron_count' : IDL.Nat64, }); const RewardEvent = IDL.Record({ 'rounds_since_last_distribution' : IDL.Opt(IDL.Nat64), @@ -354,6 +380,10 @@ export const idlFactory = ({ IDL }) => { 'transfer_timestamp' : IDL.Nat64, 'block_height' : IDL.Nat64, }); + const Followers = IDL.Record({ 'followers' : IDL.Vec(NeuronId) }); + const FollowersMap = IDL.Record({ + 'followers_map' : IDL.Vec(IDL.Tuple(IDL.Nat64, Followers)), + }); const Progress = IDL.Variant({ 'LastNeuronId' : NeuronId }); const Migration = IDL.Record({ 'status' : IDL.Opt(IDL.Int32), @@ -407,6 +437,7 @@ export const idlFactory = ({ IDL }) => { 'ideal_matched_participation_function' : IDL.Opt( IdealMatchedParticipationFunction ), + 'allocated_neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64), }); const NeuronsFundData = IDL.Record({ 'final_neurons_fund_participation' : IDL.Opt(NeuronsFundParticipation), @@ -499,6 +530,7 @@ export const idlFactory = ({ IDL }) => { 'controller' : IDL.Opt(IDL.Principal), 'recent_ballots' : IDL.Vec(BallotInfo), 'kyc_verified' : IDL.Bool, + 'neuron_type' : IDL.Opt(IDL.Int32), 'not_for_profit' : IDL.Bool, 'maturity_e8s_equivalent' : IDL.Nat64, 'cached_neuron_stake_e8s' : IDL.Nat64, @@ -518,6 +550,7 @@ export const idlFactory = ({ IDL }) => { const Governance = IDL.Record({ 'default_followees' : IDL.Vec(IDL.Tuple(IDL.Int32, Followees)), 'making_sns_proposal' : IDL.Opt(MakingSnsProposal), + 'seed_accounts' : IDL.Opt(SeedAccounts), 'most_recent_monthly_node_provider_rewards' : IDL.Opt( MostRecentMonthlyNodeProviderRewards ), @@ -534,6 +567,7 @@ export const idlFactory = ({ IDL }) => { 'latest_reward_event' : IDL.Opt(RewardEvent), 'to_claim_transfers' : IDL.Vec(NeuronStakeTransfer), 'short_voting_period_seconds' : IDL.Nat64, + 'topic_followee_index' : IDL.Vec(IDL.Tuple(IDL.Int32, FollowersMap)), 'migrations' : IDL.Opt(Migrations), 'proposals' : IDL.Vec(IDL.Tuple(IDL.Nat64, ProposalData)), 'in_flight_commands' : IDL.Vec(IDL.Tuple(IDL.Nat64, NeuronInFlightCommand)), @@ -560,6 +594,7 @@ export const idlFactory = ({ IDL }) => { const NeuronInfo = IDL.Record({ 'dissolve_delay_seconds' : IDL.Nat64, 'recent_ballots' : IDL.Vec(BallotInfo), + 'neuron_type' : IDL.Opt(IDL.Int32), 'created_timestamp_seconds' : IDL.Nat64, 'state' : IDL.Int32, 'stake_e8s' : IDL.Nat64, @@ -570,7 +605,22 @@ export const idlFactory = ({ IDL }) => { 'age_seconds' : IDL.Nat64, }); const Result_5 = IDL.Variant({ 'Ok' : NeuronInfo, 'Err' : GovernanceError }); - const Result_6 = IDL.Variant({ + const GetNeuronsFundAuditInfoRequest = IDL.Record({ + 'nns_proposal_id' : IDL.Opt(NeuronId), + }); + const NeuronsFundAuditInfo = IDL.Record({ + 'final_neurons_fund_participation' : IDL.Opt(NeuronsFundParticipation), + 'initial_neurons_fund_participation' : IDL.Opt(NeuronsFundParticipation), + 'neurons_fund_refunds' : IDL.Opt(NeuronsFundSnapshot), + }); + const Ok = IDL.Record({ + 'neurons_fund_audit_info' : IDL.Opt(NeuronsFundAuditInfo), + }); + const Result_6 = IDL.Variant({ 'Ok' : Ok, 'Err' : GovernanceError }); + const GetNeuronsFundAuditInfoResponse = IDL.Record({ + 'result' : IDL.Opt(Result_6), + }); + const Result_7 = IDL.Variant({ 'Ok' : NodeProvider, 'Err' : GovernanceError, }); @@ -662,12 +712,12 @@ export const idlFactory = ({ IDL }) => { 'total_neurons_fund_contribution_icp_e8s' : IDL.Opt(IDL.Nat64), 'sns_governance_canister_id' : IDL.Opt(IDL.Principal), }); - const Result_7 = IDL.Variant({ + const Result_8 = IDL.Variant({ 'Committed' : Committed, 'Aborted' : IDL.Record({}), }); const SettleCommunityFundParticipation = IDL.Record({ - 'result' : IDL.Opt(Result_7), + 'result' : IDL.Opt(Result_8), 'open_sns_token_swap_proposal_id' : IDL.Opt(IDL.Nat64), }); const Committed_1 = IDL.Record({ @@ -675,12 +725,12 @@ export const idlFactory = ({ IDL }) => { 'total_neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64), 'sns_governance_canister_id' : IDL.Opt(IDL.Principal), }); - const Result_8 = IDL.Variant({ + const Result_9 = IDL.Variant({ 'Committed' : Committed_1, 'Aborted' : IDL.Record({}), }); const SettleNeuronsFundParticipationRequest = IDL.Record({ - 'result' : IDL.Opt(Result_8), + 'result' : IDL.Opt(Result_9), 'nns_proposal_id' : IDL.Opt(IDL.Nat64), }); const NeuronsFundNeuron = IDL.Record({ @@ -689,12 +739,12 @@ export const idlFactory = ({ IDL }) => { 'nns_neuron_id' : IDL.Opt(IDL.Nat64), 'amount_icp_e8s' : IDL.Opt(IDL.Nat64), }); - const Ok = IDL.Record({ + const Ok_1 = IDL.Record({ 'neurons_fund_neuron_portions' : IDL.Vec(NeuronsFundNeuron), }); - const Result_9 = IDL.Variant({ 'Ok' : Ok, 'Err' : GovernanceError }); + const Result_10 = IDL.Variant({ 'Ok' : Ok_1, 'Err' : GovernanceError }); const SettleNeuronsFundParticipationResponse = IDL.Record({ - 'result' : IDL.Opt(Result_9), + 'result' : IDL.Opt(Result_10), }); const UpdateNodeProvider = IDL.Record({ 'reward_account' : IDL.Opt(AccountIdentifier), @@ -733,7 +783,12 @@ export const idlFactory = ({ IDL }) => { [Result_5], [], ), - 'get_node_provider_by_caller' : IDL.Func([IDL.Null], [Result_6], []), + 'get_neurons_fund_audit_info' : IDL.Func( + [GetNeuronsFundAuditInfoRequest], + [GetNeuronsFundAuditInfoResponse], + [], + ), + 'get_node_provider_by_caller' : IDL.Func([IDL.Null], [Result_7], []), 'get_pending_proposals' : IDL.Func([], [IDL.Vec(ProposalInfo)], []), 'get_proposal_info' : IDL.Func([IDL.Nat64], [IDL.Opt(ProposalInfo)], []), 'list_known_neurons' : IDL.Func([], [ListKnownNeuronsResponse], []), @@ -1058,6 +1113,14 @@ export const init = ({ IDL }) => { 'caller' : IDL.Opt(IDL.Principal), 'proposer_id' : IDL.Opt(NeuronId), }); + const SeedAccount = IDL.Record({ + 'error_count' : IDL.Nat64, + 'account_id' : IDL.Text, + 'neuron_type' : IDL.Int32, + 'tag_end_timestamp_seconds' : IDL.Opt(IDL.Nat64), + 'tag_start_timestamp_seconds' : IDL.Opt(IDL.Nat64), + }); + const SeedAccounts = IDL.Record({ 'accounts' : IDL.Vec(SeedAccount) }); const MostRecentMonthlyNodeProviderRewards = IDL.Record({ 'timestamp' : IDL.Nat64, 'rewards' : IDL.Vec(RewardNodeProvider), @@ -1076,17 +1139,27 @@ export const init = ({ IDL }) => { 'not_dissolving_neurons_count_buckets' : IDL.Vec( IDL.Tuple(IDL.Nat64, IDL.Nat64) ), + 'ect_neuron_count' : IDL.Nat64, 'total_supply_icp' : IDL.Nat64, 'neurons_with_less_than_6_months_dissolve_delay_count' : IDL.Nat64, 'dissolved_neurons_count' : IDL.Nat64, 'community_fund_total_maturity_e8s_equivalent' : IDL.Nat64, + 'total_staked_e8s_seed' : IDL.Nat64, + 'total_staked_maturity_e8s_equivalent_ect' : IDL.Nat64, 'total_staked_e8s' : IDL.Nat64, 'not_dissolving_neurons_count' : IDL.Nat64, 'total_locked_e8s' : IDL.Nat64, 'neurons_fund_total_active_neurons' : IDL.Nat64, 'total_staked_maturity_e8s_equivalent' : IDL.Nat64, + 'not_dissolving_neurons_e8s_buckets_ect' : IDL.Vec( + IDL.Tuple(IDL.Nat64, IDL.Float64) + ), + 'total_staked_e8s_ect' : IDL.Nat64, 'not_dissolving_neurons_staked_maturity_e8s_equivalent_sum' : IDL.Nat64, 'dissolved_neurons_e8s' : IDL.Nat64, + 'dissolving_neurons_e8s_buckets_seed' : IDL.Vec( + IDL.Tuple(IDL.Nat64, IDL.Float64) + ), 'neurons_with_less_than_6_months_dissolve_delay_e8s' : IDL.Nat64, 'not_dissolving_neurons_staked_maturity_e8s_equivalent_buckets' : IDL.Vec( IDL.Tuple(IDL.Nat64, IDL.Float64) @@ -1094,12 +1167,20 @@ export const init = ({ IDL }) => { 'dissolving_neurons_count_buckets' : IDL.Vec( IDL.Tuple(IDL.Nat64, IDL.Nat64) ), + 'dissolving_neurons_e8s_buckets_ect' : IDL.Vec( + IDL.Tuple(IDL.Nat64, IDL.Float64) + ), 'dissolving_neurons_count' : IDL.Nat64, 'dissolving_neurons_e8s_buckets' : IDL.Vec( IDL.Tuple(IDL.Nat64, IDL.Float64) ), + 'total_staked_maturity_e8s_equivalent_seed' : IDL.Nat64, 'community_fund_total_staked_e8s' : IDL.Nat64, + 'not_dissolving_neurons_e8s_buckets_seed' : IDL.Vec( + IDL.Tuple(IDL.Nat64, IDL.Float64) + ), 'timestamp_seconds' : IDL.Nat64, + 'seed_neuron_count' : IDL.Nat64, }); const RewardEvent = IDL.Record({ 'rounds_since_last_distribution' : IDL.Opt(IDL.Nat64), @@ -1119,6 +1200,10 @@ export const init = ({ IDL }) => { 'transfer_timestamp' : IDL.Nat64, 'block_height' : IDL.Nat64, }); + const Followers = IDL.Record({ 'followers' : IDL.Vec(NeuronId) }); + const FollowersMap = IDL.Record({ + 'followers_map' : IDL.Vec(IDL.Tuple(IDL.Nat64, Followers)), + }); const Progress = IDL.Variant({ 'LastNeuronId' : NeuronId }); const Migration = IDL.Record({ 'status' : IDL.Opt(IDL.Int32), @@ -1172,6 +1257,7 @@ export const init = ({ IDL }) => { 'ideal_matched_participation_function' : IDL.Opt( IdealMatchedParticipationFunction ), + 'allocated_neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64), }); const NeuronsFundData = IDL.Record({ 'final_neurons_fund_participation' : IDL.Opt(NeuronsFundParticipation), @@ -1264,6 +1350,7 @@ export const init = ({ IDL }) => { 'controller' : IDL.Opt(IDL.Principal), 'recent_ballots' : IDL.Vec(BallotInfo), 'kyc_verified' : IDL.Bool, + 'neuron_type' : IDL.Opt(IDL.Int32), 'not_for_profit' : IDL.Bool, 'maturity_e8s_equivalent' : IDL.Nat64, 'cached_neuron_stake_e8s' : IDL.Nat64, @@ -1283,6 +1370,7 @@ export const init = ({ IDL }) => { const Governance = IDL.Record({ 'default_followees' : IDL.Vec(IDL.Tuple(IDL.Int32, Followees)), 'making_sns_proposal' : IDL.Opt(MakingSnsProposal), + 'seed_accounts' : IDL.Opt(SeedAccounts), 'most_recent_monthly_node_provider_rewards' : IDL.Opt( MostRecentMonthlyNodeProviderRewards ), @@ -1299,6 +1387,7 @@ export const init = ({ IDL }) => { 'latest_reward_event' : IDL.Opt(RewardEvent), 'to_claim_transfers' : IDL.Vec(NeuronStakeTransfer), 'short_voting_period_seconds' : IDL.Nat64, + 'topic_followee_index' : IDL.Vec(IDL.Tuple(IDL.Int32, FollowersMap)), 'migrations' : IDL.Opt(Migrations), 'proposals' : IDL.Vec(IDL.Tuple(IDL.Nat64, ProposalData)), 'in_flight_commands' : IDL.Vec(IDL.Tuple(IDL.Nat64, NeuronInFlightCommand)), diff --git a/packages/nns/candid/governance.d.ts b/packages/nns/candid/governance.d.ts index c366b47b..47c2c19e 100644 --- a/packages/nns/candid/governance.d.ts +++ b/packages/nns/candid/governance.d.ts @@ -186,12 +186,25 @@ export interface Follow { export interface Followees { followees: Array; } +export interface Followers { + followers: Array; +} +export interface FollowersMap { + followers_map: Array<[bigint, Followers]>; +} +export interface GetNeuronsFundAuditInfoRequest { + nns_proposal_id: [] | [NeuronId]; +} +export interface GetNeuronsFundAuditInfoResponse { + result: [] | [Result_6]; +} export interface GlobalTimeOfDay { seconds_after_utc_midnight: [] | [bigint]; } export interface Governance { default_followees: Array<[number, Followees]>; making_sns_proposal: [] | [MakingSnsProposal]; + seed_accounts: [] | [SeedAccounts]; most_recent_monthly_node_provider_rewards: | [] | [MostRecentMonthlyNodeProviderRewards]; @@ -206,6 +219,7 @@ export interface Governance { latest_reward_event: [] | [RewardEvent]; to_claim_transfers: Array; short_voting_period_seconds: bigint; + topic_followee_index: Array<[number, FollowersMap]>; migrations: [] | [Migrations]; proposals: Array<[bigint, ProposalData]>; in_flight_commands: Array<[bigint, NeuronInFlightCommand]>; @@ -222,26 +236,36 @@ export interface GovernanceCachedMetrics { >; neurons_with_invalid_stake_count: bigint; not_dissolving_neurons_count_buckets: Array<[bigint, bigint]>; + ect_neuron_count: bigint; total_supply_icp: bigint; neurons_with_less_than_6_months_dissolve_delay_count: bigint; dissolved_neurons_count: bigint; community_fund_total_maturity_e8s_equivalent: bigint; + total_staked_e8s_seed: bigint; + total_staked_maturity_e8s_equivalent_ect: bigint; total_staked_e8s: bigint; not_dissolving_neurons_count: bigint; total_locked_e8s: bigint; neurons_fund_total_active_neurons: bigint; total_staked_maturity_e8s_equivalent: bigint; + not_dissolving_neurons_e8s_buckets_ect: Array<[bigint, number]>; + total_staked_e8s_ect: bigint; not_dissolving_neurons_staked_maturity_e8s_equivalent_sum: bigint; dissolved_neurons_e8s: bigint; + dissolving_neurons_e8s_buckets_seed: Array<[bigint, number]>; neurons_with_less_than_6_months_dissolve_delay_e8s: bigint; not_dissolving_neurons_staked_maturity_e8s_equivalent_buckets: Array< [bigint, number] >; dissolving_neurons_count_buckets: Array<[bigint, bigint]>; + dissolving_neurons_e8s_buckets_ect: Array<[bigint, number]>; dissolving_neurons_count: bigint; dissolving_neurons_e8s_buckets: Array<[bigint, number]>; + total_staked_maturity_e8s_equivalent_seed: bigint; community_fund_total_staked_e8s: bigint; + not_dissolving_neurons_e8s_buckets_seed: Array<[bigint, number]>; timestamp_seconds: bigint; + seed_neuron_count: bigint; } export interface GovernanceError { error_message: string; @@ -377,6 +401,7 @@ export interface Neuron { controller: [] | [Principal]; recent_ballots: Array; kyc_verified: boolean; + neuron_type: [] | [number]; not_for_profit: boolean; maturity_e8s_equivalent: bigint; cached_neuron_stake_e8s: bigint; @@ -421,6 +446,7 @@ export interface NeuronInFlightCommand { export interface NeuronInfo { dissolve_delay_seconds: bigint; recent_ballots: Array; + neuron_type: [] | [number]; created_timestamp_seconds: bigint; state: number; stake_e8s: bigint; @@ -439,6 +465,11 @@ export interface NeuronStakeTransfer { transfer_timestamp: bigint; block_height: bigint; } +export interface NeuronsFundAuditInfo { + final_neurons_fund_participation: [] | [NeuronsFundParticipation]; + initial_neurons_fund_participation: [] | [NeuronsFundParticipation]; + neurons_fund_refunds: [] | [NeuronsFundSnapshot]; +} export interface NeuronsFundData { final_neurons_fund_participation: [] | [NeuronsFundParticipation]; initial_neurons_fund_participation: [] | [NeuronsFundParticipation]; @@ -467,6 +498,7 @@ export interface NeuronsFundParticipation { ideal_matched_participation_function: | [] | [IdealMatchedParticipationFunction]; + allocated_neurons_fund_participation_icp_e8s: [] | [bigint]; } export interface NeuronsFundSnapshot { neurons_fund_neuron_portions: Array; @@ -476,6 +508,9 @@ export interface NodeProvider { reward_account: [] | [AccountIdentifier]; } export interface Ok { + neurons_fund_audit_info: [] | [NeuronsFundAuditInfo]; +} +export interface Ok_1 { neurons_fund_neuron_portions: Array; } export interface OpenSnsTokenSwap { @@ -566,16 +601,17 @@ export interface RemoveHotKey { } export type Result = { Ok: null } | { Err: GovernanceError }; export type Result_1 = { Error: GovernanceError } | { NeuronId: NeuronId }; +export type Result_10 = { Ok: Ok_1 } | { Err: GovernanceError }; export type Result_2 = { Ok: Neuron } | { Err: GovernanceError }; export type Result_3 = | { Ok: GovernanceCachedMetrics } | { Err: GovernanceError }; export type Result_4 = { Ok: RewardNodeProviders } | { Err: GovernanceError }; export type Result_5 = { Ok: NeuronInfo } | { Err: GovernanceError }; -export type Result_6 = { Ok: NodeProvider } | { Err: GovernanceError }; -export type Result_7 = { Committed: Committed } | { Aborted: {} }; -export type Result_8 = { Committed: Committed_1 } | { Aborted: {} }; -export type Result_9 = { Ok: Ok } | { Err: GovernanceError }; +export type Result_6 = { Ok: Ok } | { Err: GovernanceError }; +export type Result_7 = { Ok: NodeProvider } | { Err: GovernanceError }; +export type Result_8 = { Committed: Committed } | { Aborted: {} }; +export type Result_9 = { Committed: Committed_1 } | { Aborted: {} }; export interface RewardEvent { rounds_since_last_distribution: [] | [bigint]; day_after_genesis: bigint; @@ -603,6 +639,16 @@ export interface RewardToAccount { export interface RewardToNeuron { dissolve_delay_seconds: bigint; } +export interface SeedAccount { + error_count: bigint; + account_id: string; + neuron_type: number; + tag_end_timestamp_seconds: [] | [bigint]; + tag_start_timestamp_seconds: [] | [bigint]; +} +export interface SeedAccounts { + accounts: Array; +} export interface SetDefaultFollowees { default_followees: Array<[number, Followees]>; } @@ -617,15 +663,15 @@ export interface SetSnsTokenSwapOpenTimeWindow { swap_canister_id: [] | [Principal]; } export interface SettleCommunityFundParticipation { - result: [] | [Result_7]; + result: [] | [Result_8]; open_sns_token_swap_proposal_id: [] | [bigint]; } export interface SettleNeuronsFundParticipationRequest { - result: [] | [Result_8]; + result: [] | [Result_9]; nns_proposal_id: [] | [bigint]; } export interface SettleNeuronsFundParticipationResponse { - result: [] | [Result_9]; + result: [] | [Result_10]; } export interface Spawn { percentage_to_spawn: [] | [number]; @@ -732,7 +778,11 @@ export interface _SERVICE { [NeuronIdOrSubaccount], Result_5 >; - get_node_provider_by_caller: ActorMethod<[null], Result_6>; + get_neurons_fund_audit_info: ActorMethod< + [GetNeuronsFundAuditInfoRequest], + GetNeuronsFundAuditInfoResponse + >; + get_node_provider_by_caller: ActorMethod<[null], Result_7>; get_pending_proposals: ActorMethod<[], Array>; get_proposal_info: ActorMethod<[bigint], [] | [ProposalInfo]>; list_known_neurons: ActorMethod<[], ListKnownNeuronsResponse>; diff --git a/packages/nns/candid/governance.did b/packages/nns/candid/governance.did index 5690e754..60480a02 100644 --- a/packages/nns/candid/governance.did +++ b/packages/nns/candid/governance.did @@ -1,4 +1,4 @@ -// Generated from IC repo commit 1a01f85fc1994e69dd5ba72b4d87fe9f9c4093ee 'rs/nns/governance/canister/governance.did' by import-candid +// Generated from IC repo commit 0ee9960d6 (2023-12-06) 'rs/nns/governance/canister/governance.did' by import-candid type AccountIdentifier = record { hash : vec nat8 }; type Action = variant { RegisterKnownNeuron : KnownNeuron; @@ -150,10 +150,15 @@ type Duration = record { seconds : opt nat64 }; type ExecuteNnsFunction = record { nns_function : int32; payload : vec nat8 }; type Follow = record { topic : int32; followees : vec NeuronId }; type Followees = record { followees : vec NeuronId }; +type Followers = record { followers : vec NeuronId }; +type FollowersMap = record { followers_map : vec record { nat64; Followers } }; +type GetNeuronsFundAuditInfoRequest = record { nns_proposal_id : opt NeuronId }; +type GetNeuronsFundAuditInfoResponse = record { result : opt Result_6 }; type GlobalTimeOfDay = record { seconds_after_utc_midnight : opt nat64 }; type Governance = record { default_followees : vec record { int32; Followees }; making_sns_proposal : opt MakingSnsProposal; + seed_accounts : opt SeedAccounts; most_recent_monthly_node_provider_rewards : opt MostRecentMonthlyNodeProviderRewards; maturity_modulation_last_updated_at_timestamp_seconds : opt nat64; wait_for_quiet_threshold_seconds : nat64; @@ -166,6 +171,7 @@ type Governance = record { latest_reward_event : opt RewardEvent; to_claim_transfers : vec NeuronStakeTransfer; short_voting_period_seconds : nat64; + topic_followee_index : vec record { int32; FollowersMap }; migrations : opt Migrations; proposals : vec record { nat64; ProposalData }; in_flight_commands : vec record { nat64; NeuronInFlightCommand }; @@ -183,27 +189,37 @@ type GovernanceCachedMetrics = record { }; neurons_with_invalid_stake_count : nat64; not_dissolving_neurons_count_buckets : vec record { nat64; nat64 }; + ect_neuron_count : nat64; total_supply_icp : nat64; neurons_with_less_than_6_months_dissolve_delay_count : nat64; dissolved_neurons_count : nat64; community_fund_total_maturity_e8s_equivalent : nat64; + total_staked_e8s_seed : nat64; + total_staked_maturity_e8s_equivalent_ect : nat64; total_staked_e8s : nat64; not_dissolving_neurons_count : nat64; total_locked_e8s : nat64; neurons_fund_total_active_neurons : nat64; total_staked_maturity_e8s_equivalent : nat64; + not_dissolving_neurons_e8s_buckets_ect : vec record { nat64; float64 }; + total_staked_e8s_ect : nat64; not_dissolving_neurons_staked_maturity_e8s_equivalent_sum : nat64; dissolved_neurons_e8s : nat64; + dissolving_neurons_e8s_buckets_seed : vec record { nat64; float64 }; neurons_with_less_than_6_months_dissolve_delay_e8s : nat64; not_dissolving_neurons_staked_maturity_e8s_equivalent_buckets : vec record { nat64; float64; }; dissolving_neurons_count_buckets : vec record { nat64; nat64 }; + dissolving_neurons_e8s_buckets_ect : vec record { nat64; float64 }; dissolving_neurons_count : nat64; dissolving_neurons_e8s_buckets : vec record { nat64; float64 }; + total_staked_maturity_e8s_equivalent_seed : nat64; community_fund_total_staked_e8s : nat64; + not_dissolving_neurons_e8s_buckets_seed : vec record { nat64; float64 }; timestamp_seconds : nat64; + seed_neuron_count : nat64; }; type GovernanceError = record { error_message : text; error_type : int32 }; type GovernanceParameters = record { @@ -315,6 +331,7 @@ type Neuron = record { controller : opt principal; recent_ballots : vec BallotInfo; kyc_verified : bool; + neuron_type : opt int32; not_for_profit : bool; maturity_e8s_equivalent : nat64; cached_neuron_stake_e8s : nat64; @@ -358,6 +375,7 @@ type NeuronInFlightCommand = record { type NeuronInfo = record { dissolve_delay_seconds : nat64; recent_ballots : vec BallotInfo; + neuron_type : opt int32; created_timestamp_seconds : nat64; state : int32; stake_e8s : nat64; @@ -376,6 +394,11 @@ type NeuronStakeTransfer = record { transfer_timestamp : nat64; block_height : nat64; }; +type NeuronsFundAuditInfo = record { + final_neurons_fund_participation : opt NeuronsFundParticipation; + initial_neurons_fund_participation : opt NeuronsFundParticipation; + neurons_fund_refunds : opt NeuronsFundSnapshot; +}; type NeuronsFundData = record { final_neurons_fund_participation : opt NeuronsFundParticipation; initial_neurons_fund_participation : opt NeuronsFundParticipation; @@ -402,6 +425,7 @@ type NeuronsFundParticipation = record { max_neurons_fund_swap_participation_icp_e8s : opt nat64; neurons_fund_reserves : opt NeuronsFundSnapshot; ideal_matched_participation_function : opt IdealMatchedParticipationFunction; + allocated_neurons_fund_participation_icp_e8s : opt nat64; }; type NeuronsFundSnapshot = record { neurons_fund_neuron_portions : vec NeuronsFundNeuronPortion; @@ -410,7 +434,8 @@ type NodeProvider = record { id : opt principal; reward_account : opt AccountIdentifier; }; -type Ok = record { neurons_fund_neuron_portions : vec NeuronsFundNeuron }; +type Ok = record { neurons_fund_audit_info : opt NeuronsFundAuditInfo }; +type Ok_1 = record { neurons_fund_neuron_portions : vec NeuronsFundNeuron }; type OpenSnsTokenSwap = record { community_fund_investment_e8s : opt nat64; target_swap_canister_id : opt principal; @@ -491,14 +516,15 @@ type RegisterVote = record { vote : int32; proposal : opt NeuronId }; type RemoveHotKey = record { hot_key_to_remove : opt principal }; type Result = variant { Ok; Err : GovernanceError }; type Result_1 = variant { Error : GovernanceError; NeuronId : NeuronId }; +type Result_10 = variant { Ok : Ok_1; Err : GovernanceError }; type Result_2 = variant { Ok : Neuron; Err : GovernanceError }; type Result_3 = variant { Ok : GovernanceCachedMetrics; Err : GovernanceError }; type Result_4 = variant { Ok : RewardNodeProviders; Err : GovernanceError }; type Result_5 = variant { Ok : NeuronInfo; Err : GovernanceError }; -type Result_6 = variant { Ok : NodeProvider; Err : GovernanceError }; -type Result_7 = variant { Committed : Committed; Aborted : record {} }; -type Result_8 = variant { Committed : Committed_1; Aborted : record {} }; -type Result_9 = variant { Ok : Ok; Err : GovernanceError }; +type Result_6 = variant { Ok : Ok; Err : GovernanceError }; +type Result_7 = variant { Ok : NodeProvider; Err : GovernanceError }; +type Result_8 = variant { Committed : Committed; Aborted : record {} }; +type Result_9 = variant { Committed : Committed_1; Aborted : record {} }; type RewardEvent = record { rounds_since_last_distribution : opt nat64; day_after_genesis : nat64; @@ -523,6 +549,14 @@ type RewardNodeProviders = record { }; type RewardToAccount = record { to_account : opt AccountIdentifier }; type RewardToNeuron = record { dissolve_delay_seconds : nat64 }; +type SeedAccount = record { + error_count : nat64; + account_id : text; + neuron_type : int32; + tag_end_timestamp_seconds : opt nat64; + tag_start_timestamp_seconds : opt nat64; +}; +type SeedAccounts = record { accounts : vec SeedAccount }; type SetDefaultFollowees = record { default_followees : vec record { int32; Followees }; }; @@ -533,14 +567,14 @@ type SetSnsTokenSwapOpenTimeWindow = record { swap_canister_id : opt principal; }; type SettleCommunityFundParticipation = record { - result : opt Result_7; + result : opt Result_8; open_sns_token_swap_proposal_id : opt nat64; }; type SettleNeuronsFundParticipationRequest = record { - result : opt Result_8; + result : opt Result_9; nns_proposal_id : opt nat64; }; -type SettleNeuronsFundParticipationResponse = record { result : opt Result_9 }; +type SettleNeuronsFundParticipationResponse = record { result : opt Result_10 }; type Spawn = record { percentage_to_spawn : opt nat32; new_controller : opt principal; @@ -626,7 +660,10 @@ service : (Governance) -> { get_neuron_info_by_id_or_subaccount : (NeuronIdOrSubaccount) -> ( Result_5, ) query; - get_node_provider_by_caller : (null) -> (Result_6) query; + get_neurons_fund_audit_info : (GetNeuronsFundAuditInfoRequest) -> ( + GetNeuronsFundAuditInfoResponse, + ) query; + get_node_provider_by_caller : (null) -> (Result_7) query; get_pending_proposals : () -> (vec ProposalInfo) query; get_proposal_info : (nat64) -> (opt ProposalInfo) query; list_known_neurons : () -> (ListKnownNeuronsResponse) query; diff --git a/packages/nns/candid/governance.idl.js b/packages/nns/candid/governance.idl.js index 3a2fd741..d27044c3 100644 --- a/packages/nns/candid/governance.idl.js +++ b/packages/nns/candid/governance.idl.js @@ -293,6 +293,14 @@ export const idlFactory = ({ IDL }) => { 'caller' : IDL.Opt(IDL.Principal), 'proposer_id' : IDL.Opt(NeuronId), }); + const SeedAccount = IDL.Record({ + 'error_count' : IDL.Nat64, + 'account_id' : IDL.Text, + 'neuron_type' : IDL.Int32, + 'tag_end_timestamp_seconds' : IDL.Opt(IDL.Nat64), + 'tag_start_timestamp_seconds' : IDL.Opt(IDL.Nat64), + }); + const SeedAccounts = IDL.Record({ 'accounts' : IDL.Vec(SeedAccount) }); const MostRecentMonthlyNodeProviderRewards = IDL.Record({ 'timestamp' : IDL.Nat64, 'rewards' : IDL.Vec(RewardNodeProvider), @@ -311,17 +319,27 @@ export const idlFactory = ({ IDL }) => { 'not_dissolving_neurons_count_buckets' : IDL.Vec( IDL.Tuple(IDL.Nat64, IDL.Nat64) ), + 'ect_neuron_count' : IDL.Nat64, 'total_supply_icp' : IDL.Nat64, 'neurons_with_less_than_6_months_dissolve_delay_count' : IDL.Nat64, 'dissolved_neurons_count' : IDL.Nat64, 'community_fund_total_maturity_e8s_equivalent' : IDL.Nat64, + 'total_staked_e8s_seed' : IDL.Nat64, + 'total_staked_maturity_e8s_equivalent_ect' : IDL.Nat64, 'total_staked_e8s' : IDL.Nat64, 'not_dissolving_neurons_count' : IDL.Nat64, 'total_locked_e8s' : IDL.Nat64, 'neurons_fund_total_active_neurons' : IDL.Nat64, 'total_staked_maturity_e8s_equivalent' : IDL.Nat64, + 'not_dissolving_neurons_e8s_buckets_ect' : IDL.Vec( + IDL.Tuple(IDL.Nat64, IDL.Float64) + ), + 'total_staked_e8s_ect' : IDL.Nat64, 'not_dissolving_neurons_staked_maturity_e8s_equivalent_sum' : IDL.Nat64, 'dissolved_neurons_e8s' : IDL.Nat64, + 'dissolving_neurons_e8s_buckets_seed' : IDL.Vec( + IDL.Tuple(IDL.Nat64, IDL.Float64) + ), 'neurons_with_less_than_6_months_dissolve_delay_e8s' : IDL.Nat64, 'not_dissolving_neurons_staked_maturity_e8s_equivalent_buckets' : IDL.Vec( IDL.Tuple(IDL.Nat64, IDL.Float64) @@ -329,12 +347,20 @@ export const idlFactory = ({ IDL }) => { 'dissolving_neurons_count_buckets' : IDL.Vec( IDL.Tuple(IDL.Nat64, IDL.Nat64) ), + 'dissolving_neurons_e8s_buckets_ect' : IDL.Vec( + IDL.Tuple(IDL.Nat64, IDL.Float64) + ), 'dissolving_neurons_count' : IDL.Nat64, 'dissolving_neurons_e8s_buckets' : IDL.Vec( IDL.Tuple(IDL.Nat64, IDL.Float64) ), + 'total_staked_maturity_e8s_equivalent_seed' : IDL.Nat64, 'community_fund_total_staked_e8s' : IDL.Nat64, + 'not_dissolving_neurons_e8s_buckets_seed' : IDL.Vec( + IDL.Tuple(IDL.Nat64, IDL.Float64) + ), 'timestamp_seconds' : IDL.Nat64, + 'seed_neuron_count' : IDL.Nat64, }); const RewardEvent = IDL.Record({ 'rounds_since_last_distribution' : IDL.Opt(IDL.Nat64), @@ -354,6 +380,10 @@ export const idlFactory = ({ IDL }) => { 'transfer_timestamp' : IDL.Nat64, 'block_height' : IDL.Nat64, }); + const Followers = IDL.Record({ 'followers' : IDL.Vec(NeuronId) }); + const FollowersMap = IDL.Record({ + 'followers_map' : IDL.Vec(IDL.Tuple(IDL.Nat64, Followers)), + }); const Progress = IDL.Variant({ 'LastNeuronId' : NeuronId }); const Migration = IDL.Record({ 'status' : IDL.Opt(IDL.Int32), @@ -407,6 +437,7 @@ export const idlFactory = ({ IDL }) => { 'ideal_matched_participation_function' : IDL.Opt( IdealMatchedParticipationFunction ), + 'allocated_neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64), }); const NeuronsFundData = IDL.Record({ 'final_neurons_fund_participation' : IDL.Opt(NeuronsFundParticipation), @@ -499,6 +530,7 @@ export const idlFactory = ({ IDL }) => { 'controller' : IDL.Opt(IDL.Principal), 'recent_ballots' : IDL.Vec(BallotInfo), 'kyc_verified' : IDL.Bool, + 'neuron_type' : IDL.Opt(IDL.Int32), 'not_for_profit' : IDL.Bool, 'maturity_e8s_equivalent' : IDL.Nat64, 'cached_neuron_stake_e8s' : IDL.Nat64, @@ -518,6 +550,7 @@ export const idlFactory = ({ IDL }) => { const Governance = IDL.Record({ 'default_followees' : IDL.Vec(IDL.Tuple(IDL.Int32, Followees)), 'making_sns_proposal' : IDL.Opt(MakingSnsProposal), + 'seed_accounts' : IDL.Opt(SeedAccounts), 'most_recent_monthly_node_provider_rewards' : IDL.Opt( MostRecentMonthlyNodeProviderRewards ), @@ -534,6 +567,7 @@ export const idlFactory = ({ IDL }) => { 'latest_reward_event' : IDL.Opt(RewardEvent), 'to_claim_transfers' : IDL.Vec(NeuronStakeTransfer), 'short_voting_period_seconds' : IDL.Nat64, + 'topic_followee_index' : IDL.Vec(IDL.Tuple(IDL.Int32, FollowersMap)), 'migrations' : IDL.Opt(Migrations), 'proposals' : IDL.Vec(IDL.Tuple(IDL.Nat64, ProposalData)), 'in_flight_commands' : IDL.Vec(IDL.Tuple(IDL.Nat64, NeuronInFlightCommand)), @@ -560,6 +594,7 @@ export const idlFactory = ({ IDL }) => { const NeuronInfo = IDL.Record({ 'dissolve_delay_seconds' : IDL.Nat64, 'recent_ballots' : IDL.Vec(BallotInfo), + 'neuron_type' : IDL.Opt(IDL.Int32), 'created_timestamp_seconds' : IDL.Nat64, 'state' : IDL.Int32, 'stake_e8s' : IDL.Nat64, @@ -570,7 +605,22 @@ export const idlFactory = ({ IDL }) => { 'age_seconds' : IDL.Nat64, }); const Result_5 = IDL.Variant({ 'Ok' : NeuronInfo, 'Err' : GovernanceError }); - const Result_6 = IDL.Variant({ + const GetNeuronsFundAuditInfoRequest = IDL.Record({ + 'nns_proposal_id' : IDL.Opt(NeuronId), + }); + const NeuronsFundAuditInfo = IDL.Record({ + 'final_neurons_fund_participation' : IDL.Opt(NeuronsFundParticipation), + 'initial_neurons_fund_participation' : IDL.Opt(NeuronsFundParticipation), + 'neurons_fund_refunds' : IDL.Opt(NeuronsFundSnapshot), + }); + const Ok = IDL.Record({ + 'neurons_fund_audit_info' : IDL.Opt(NeuronsFundAuditInfo), + }); + const Result_6 = IDL.Variant({ 'Ok' : Ok, 'Err' : GovernanceError }); + const GetNeuronsFundAuditInfoResponse = IDL.Record({ + 'result' : IDL.Opt(Result_6), + }); + const Result_7 = IDL.Variant({ 'Ok' : NodeProvider, 'Err' : GovernanceError, }); @@ -662,12 +712,12 @@ export const idlFactory = ({ IDL }) => { 'total_neurons_fund_contribution_icp_e8s' : IDL.Opt(IDL.Nat64), 'sns_governance_canister_id' : IDL.Opt(IDL.Principal), }); - const Result_7 = IDL.Variant({ + const Result_8 = IDL.Variant({ 'Committed' : Committed, 'Aborted' : IDL.Record({}), }); const SettleCommunityFundParticipation = IDL.Record({ - 'result' : IDL.Opt(Result_7), + 'result' : IDL.Opt(Result_8), 'open_sns_token_swap_proposal_id' : IDL.Opt(IDL.Nat64), }); const Committed_1 = IDL.Record({ @@ -675,12 +725,12 @@ export const idlFactory = ({ IDL }) => { 'total_neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64), 'sns_governance_canister_id' : IDL.Opt(IDL.Principal), }); - const Result_8 = IDL.Variant({ + const Result_9 = IDL.Variant({ 'Committed' : Committed_1, 'Aborted' : IDL.Record({}), }); const SettleNeuronsFundParticipationRequest = IDL.Record({ - 'result' : IDL.Opt(Result_8), + 'result' : IDL.Opt(Result_9), 'nns_proposal_id' : IDL.Opt(IDL.Nat64), }); const NeuronsFundNeuron = IDL.Record({ @@ -689,12 +739,12 @@ export const idlFactory = ({ IDL }) => { 'nns_neuron_id' : IDL.Opt(IDL.Nat64), 'amount_icp_e8s' : IDL.Opt(IDL.Nat64), }); - const Ok = IDL.Record({ + const Ok_1 = IDL.Record({ 'neurons_fund_neuron_portions' : IDL.Vec(NeuronsFundNeuron), }); - const Result_9 = IDL.Variant({ 'Ok' : Ok, 'Err' : GovernanceError }); + const Result_10 = IDL.Variant({ 'Ok' : Ok_1, 'Err' : GovernanceError }); const SettleNeuronsFundParticipationResponse = IDL.Record({ - 'result' : IDL.Opt(Result_9), + 'result' : IDL.Opt(Result_10), }); const UpdateNodeProvider = IDL.Record({ 'reward_account' : IDL.Opt(AccountIdentifier), @@ -737,7 +787,12 @@ export const idlFactory = ({ IDL }) => { [Result_5], ['query'], ), - 'get_node_provider_by_caller' : IDL.Func([IDL.Null], [Result_6], ['query']), + 'get_neurons_fund_audit_info' : IDL.Func( + [GetNeuronsFundAuditInfoRequest], + [GetNeuronsFundAuditInfoResponse], + ['query'], + ), + 'get_node_provider_by_caller' : IDL.Func([IDL.Null], [Result_7], ['query']), 'get_pending_proposals' : IDL.Func([], [IDL.Vec(ProposalInfo)], ['query']), 'get_proposal_info' : IDL.Func( [IDL.Nat64], @@ -1070,6 +1125,14 @@ export const init = ({ IDL }) => { 'caller' : IDL.Opt(IDL.Principal), 'proposer_id' : IDL.Opt(NeuronId), }); + const SeedAccount = IDL.Record({ + 'error_count' : IDL.Nat64, + 'account_id' : IDL.Text, + 'neuron_type' : IDL.Int32, + 'tag_end_timestamp_seconds' : IDL.Opt(IDL.Nat64), + 'tag_start_timestamp_seconds' : IDL.Opt(IDL.Nat64), + }); + const SeedAccounts = IDL.Record({ 'accounts' : IDL.Vec(SeedAccount) }); const MostRecentMonthlyNodeProviderRewards = IDL.Record({ 'timestamp' : IDL.Nat64, 'rewards' : IDL.Vec(RewardNodeProvider), @@ -1088,17 +1151,27 @@ export const init = ({ IDL }) => { 'not_dissolving_neurons_count_buckets' : IDL.Vec( IDL.Tuple(IDL.Nat64, IDL.Nat64) ), + 'ect_neuron_count' : IDL.Nat64, 'total_supply_icp' : IDL.Nat64, 'neurons_with_less_than_6_months_dissolve_delay_count' : IDL.Nat64, 'dissolved_neurons_count' : IDL.Nat64, 'community_fund_total_maturity_e8s_equivalent' : IDL.Nat64, + 'total_staked_e8s_seed' : IDL.Nat64, + 'total_staked_maturity_e8s_equivalent_ect' : IDL.Nat64, 'total_staked_e8s' : IDL.Nat64, 'not_dissolving_neurons_count' : IDL.Nat64, 'total_locked_e8s' : IDL.Nat64, 'neurons_fund_total_active_neurons' : IDL.Nat64, 'total_staked_maturity_e8s_equivalent' : IDL.Nat64, + 'not_dissolving_neurons_e8s_buckets_ect' : IDL.Vec( + IDL.Tuple(IDL.Nat64, IDL.Float64) + ), + 'total_staked_e8s_ect' : IDL.Nat64, 'not_dissolving_neurons_staked_maturity_e8s_equivalent_sum' : IDL.Nat64, 'dissolved_neurons_e8s' : IDL.Nat64, + 'dissolving_neurons_e8s_buckets_seed' : IDL.Vec( + IDL.Tuple(IDL.Nat64, IDL.Float64) + ), 'neurons_with_less_than_6_months_dissolve_delay_e8s' : IDL.Nat64, 'not_dissolving_neurons_staked_maturity_e8s_equivalent_buckets' : IDL.Vec( IDL.Tuple(IDL.Nat64, IDL.Float64) @@ -1106,12 +1179,20 @@ export const init = ({ IDL }) => { 'dissolving_neurons_count_buckets' : IDL.Vec( IDL.Tuple(IDL.Nat64, IDL.Nat64) ), + 'dissolving_neurons_e8s_buckets_ect' : IDL.Vec( + IDL.Tuple(IDL.Nat64, IDL.Float64) + ), 'dissolving_neurons_count' : IDL.Nat64, 'dissolving_neurons_e8s_buckets' : IDL.Vec( IDL.Tuple(IDL.Nat64, IDL.Float64) ), + 'total_staked_maturity_e8s_equivalent_seed' : IDL.Nat64, 'community_fund_total_staked_e8s' : IDL.Nat64, + 'not_dissolving_neurons_e8s_buckets_seed' : IDL.Vec( + IDL.Tuple(IDL.Nat64, IDL.Float64) + ), 'timestamp_seconds' : IDL.Nat64, + 'seed_neuron_count' : IDL.Nat64, }); const RewardEvent = IDL.Record({ 'rounds_since_last_distribution' : IDL.Opt(IDL.Nat64), @@ -1131,6 +1212,10 @@ export const init = ({ IDL }) => { 'transfer_timestamp' : IDL.Nat64, 'block_height' : IDL.Nat64, }); + const Followers = IDL.Record({ 'followers' : IDL.Vec(NeuronId) }); + const FollowersMap = IDL.Record({ + 'followers_map' : IDL.Vec(IDL.Tuple(IDL.Nat64, Followers)), + }); const Progress = IDL.Variant({ 'LastNeuronId' : NeuronId }); const Migration = IDL.Record({ 'status' : IDL.Opt(IDL.Int32), @@ -1184,6 +1269,7 @@ export const init = ({ IDL }) => { 'ideal_matched_participation_function' : IDL.Opt( IdealMatchedParticipationFunction ), + 'allocated_neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64), }); const NeuronsFundData = IDL.Record({ 'final_neurons_fund_participation' : IDL.Opt(NeuronsFundParticipation), @@ -1276,6 +1362,7 @@ export const init = ({ IDL }) => { 'controller' : IDL.Opt(IDL.Principal), 'recent_ballots' : IDL.Vec(BallotInfo), 'kyc_verified' : IDL.Bool, + 'neuron_type' : IDL.Opt(IDL.Int32), 'not_for_profit' : IDL.Bool, 'maturity_e8s_equivalent' : IDL.Nat64, 'cached_neuron_stake_e8s' : IDL.Nat64, @@ -1295,6 +1382,7 @@ export const init = ({ IDL }) => { const Governance = IDL.Record({ 'default_followees' : IDL.Vec(IDL.Tuple(IDL.Int32, Followees)), 'making_sns_proposal' : IDL.Opt(MakingSnsProposal), + 'seed_accounts' : IDL.Opt(SeedAccounts), 'most_recent_monthly_node_provider_rewards' : IDL.Opt( MostRecentMonthlyNodeProviderRewards ), @@ -1311,6 +1399,7 @@ export const init = ({ IDL }) => { 'latest_reward_event' : IDL.Opt(RewardEvent), 'to_claim_transfers' : IDL.Vec(NeuronStakeTransfer), 'short_voting_period_seconds' : IDL.Nat64, + 'topic_followee_index' : IDL.Vec(IDL.Tuple(IDL.Int32, FollowersMap)), 'migrations' : IDL.Opt(Migrations), 'proposals' : IDL.Vec(IDL.Tuple(IDL.Nat64, ProposalData)), 'in_flight_commands' : IDL.Vec(IDL.Tuple(IDL.Nat64, NeuronInFlightCommand)), diff --git a/packages/nns/candid/governance_test.certified.idl.js b/packages/nns/candid/governance_test.certified.idl.js index 709f60ae..94548e7e 100644 --- a/packages/nns/candid/governance_test.certified.idl.js +++ b/packages/nns/candid/governance_test.certified.idl.js @@ -293,6 +293,14 @@ export const idlFactory = ({ IDL }) => { 'caller' : IDL.Opt(IDL.Principal), 'proposer_id' : IDL.Opt(NeuronId), }); + const SeedAccount = IDL.Record({ + 'error_count' : IDL.Nat64, + 'account_id' : IDL.Text, + 'neuron_type' : IDL.Int32, + 'tag_end_timestamp_seconds' : IDL.Opt(IDL.Nat64), + 'tag_start_timestamp_seconds' : IDL.Opt(IDL.Nat64), + }); + const SeedAccounts = IDL.Record({ 'accounts' : IDL.Vec(SeedAccount) }); const MostRecentMonthlyNodeProviderRewards = IDL.Record({ 'timestamp' : IDL.Nat64, 'rewards' : IDL.Vec(RewardNodeProvider), @@ -311,17 +319,27 @@ export const idlFactory = ({ IDL }) => { 'not_dissolving_neurons_count_buckets' : IDL.Vec( IDL.Tuple(IDL.Nat64, IDL.Nat64) ), + 'ect_neuron_count' : IDL.Nat64, 'total_supply_icp' : IDL.Nat64, 'neurons_with_less_than_6_months_dissolve_delay_count' : IDL.Nat64, 'dissolved_neurons_count' : IDL.Nat64, 'community_fund_total_maturity_e8s_equivalent' : IDL.Nat64, + 'total_staked_e8s_seed' : IDL.Nat64, + 'total_staked_maturity_e8s_equivalent_ect' : IDL.Nat64, 'total_staked_e8s' : IDL.Nat64, 'not_dissolving_neurons_count' : IDL.Nat64, 'total_locked_e8s' : IDL.Nat64, 'neurons_fund_total_active_neurons' : IDL.Nat64, 'total_staked_maturity_e8s_equivalent' : IDL.Nat64, + 'not_dissolving_neurons_e8s_buckets_ect' : IDL.Vec( + IDL.Tuple(IDL.Nat64, IDL.Float64) + ), + 'total_staked_e8s_ect' : IDL.Nat64, 'not_dissolving_neurons_staked_maturity_e8s_equivalent_sum' : IDL.Nat64, 'dissolved_neurons_e8s' : IDL.Nat64, + 'dissolving_neurons_e8s_buckets_seed' : IDL.Vec( + IDL.Tuple(IDL.Nat64, IDL.Float64) + ), 'neurons_with_less_than_6_months_dissolve_delay_e8s' : IDL.Nat64, 'not_dissolving_neurons_staked_maturity_e8s_equivalent_buckets' : IDL.Vec( IDL.Tuple(IDL.Nat64, IDL.Float64) @@ -329,12 +347,20 @@ export const idlFactory = ({ IDL }) => { 'dissolving_neurons_count_buckets' : IDL.Vec( IDL.Tuple(IDL.Nat64, IDL.Nat64) ), + 'dissolving_neurons_e8s_buckets_ect' : IDL.Vec( + IDL.Tuple(IDL.Nat64, IDL.Float64) + ), 'dissolving_neurons_count' : IDL.Nat64, 'dissolving_neurons_e8s_buckets' : IDL.Vec( IDL.Tuple(IDL.Nat64, IDL.Float64) ), + 'total_staked_maturity_e8s_equivalent_seed' : IDL.Nat64, 'community_fund_total_staked_e8s' : IDL.Nat64, + 'not_dissolving_neurons_e8s_buckets_seed' : IDL.Vec( + IDL.Tuple(IDL.Nat64, IDL.Float64) + ), 'timestamp_seconds' : IDL.Nat64, + 'seed_neuron_count' : IDL.Nat64, }); const RewardEvent = IDL.Record({ 'rounds_since_last_distribution' : IDL.Opt(IDL.Nat64), @@ -354,6 +380,10 @@ export const idlFactory = ({ IDL }) => { 'transfer_timestamp' : IDL.Nat64, 'block_height' : IDL.Nat64, }); + const Followers = IDL.Record({ 'followers' : IDL.Vec(NeuronId) }); + const FollowersMap = IDL.Record({ + 'followers_map' : IDL.Vec(IDL.Tuple(IDL.Nat64, Followers)), + }); const Progress = IDL.Variant({ 'LastNeuronId' : NeuronId }); const Migration = IDL.Record({ 'status' : IDL.Opt(IDL.Int32), @@ -407,6 +437,7 @@ export const idlFactory = ({ IDL }) => { 'ideal_matched_participation_function' : IDL.Opt( IdealMatchedParticipationFunction ), + 'allocated_neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64), }); const NeuronsFundData = IDL.Record({ 'final_neurons_fund_participation' : IDL.Opt(NeuronsFundParticipation), @@ -499,6 +530,7 @@ export const idlFactory = ({ IDL }) => { 'controller' : IDL.Opt(IDL.Principal), 'recent_ballots' : IDL.Vec(BallotInfo), 'kyc_verified' : IDL.Bool, + 'neuron_type' : IDL.Opt(IDL.Int32), 'not_for_profit' : IDL.Bool, 'maturity_e8s_equivalent' : IDL.Nat64, 'cached_neuron_stake_e8s' : IDL.Nat64, @@ -518,6 +550,7 @@ export const idlFactory = ({ IDL }) => { const Governance = IDL.Record({ 'default_followees' : IDL.Vec(IDL.Tuple(IDL.Int32, Followees)), 'making_sns_proposal' : IDL.Opt(MakingSnsProposal), + 'seed_accounts' : IDL.Opt(SeedAccounts), 'most_recent_monthly_node_provider_rewards' : IDL.Opt( MostRecentMonthlyNodeProviderRewards ), @@ -534,6 +567,7 @@ export const idlFactory = ({ IDL }) => { 'latest_reward_event' : IDL.Opt(RewardEvent), 'to_claim_transfers' : IDL.Vec(NeuronStakeTransfer), 'short_voting_period_seconds' : IDL.Nat64, + 'topic_followee_index' : IDL.Vec(IDL.Tuple(IDL.Int32, FollowersMap)), 'migrations' : IDL.Opt(Migrations), 'proposals' : IDL.Vec(IDL.Tuple(IDL.Nat64, ProposalData)), 'in_flight_commands' : IDL.Vec(IDL.Tuple(IDL.Nat64, NeuronInFlightCommand)), @@ -560,6 +594,7 @@ export const idlFactory = ({ IDL }) => { const NeuronInfo = IDL.Record({ 'dissolve_delay_seconds' : IDL.Nat64, 'recent_ballots' : IDL.Vec(BallotInfo), + 'neuron_type' : IDL.Opt(IDL.Int32), 'created_timestamp_seconds' : IDL.Nat64, 'state' : IDL.Int32, 'stake_e8s' : IDL.Nat64, @@ -570,7 +605,22 @@ export const idlFactory = ({ IDL }) => { 'age_seconds' : IDL.Nat64, }); const Result_5 = IDL.Variant({ 'Ok' : NeuronInfo, 'Err' : GovernanceError }); - const Result_6 = IDL.Variant({ + const GetNeuronsFundAuditInfoRequest = IDL.Record({ + 'nns_proposal_id' : IDL.Opt(NeuronId), + }); + const NeuronsFundAuditInfo = IDL.Record({ + 'final_neurons_fund_participation' : IDL.Opt(NeuronsFundParticipation), + 'initial_neurons_fund_participation' : IDL.Opt(NeuronsFundParticipation), + 'neurons_fund_refunds' : IDL.Opt(NeuronsFundSnapshot), + }); + const Ok = IDL.Record({ + 'neurons_fund_audit_info' : IDL.Opt(NeuronsFundAuditInfo), + }); + const Result_6 = IDL.Variant({ 'Ok' : Ok, 'Err' : GovernanceError }); + const GetNeuronsFundAuditInfoResponse = IDL.Record({ + 'result' : IDL.Opt(Result_6), + }); + const Result_7 = IDL.Variant({ 'Ok' : NodeProvider, 'Err' : GovernanceError, }); @@ -662,12 +712,12 @@ export const idlFactory = ({ IDL }) => { 'total_neurons_fund_contribution_icp_e8s' : IDL.Opt(IDL.Nat64), 'sns_governance_canister_id' : IDL.Opt(IDL.Principal), }); - const Result_7 = IDL.Variant({ + const Result_8 = IDL.Variant({ 'Committed' : Committed, 'Aborted' : IDL.Record({}), }); const SettleCommunityFundParticipation = IDL.Record({ - 'result' : IDL.Opt(Result_7), + 'result' : IDL.Opt(Result_8), 'open_sns_token_swap_proposal_id' : IDL.Opt(IDL.Nat64), }); const Committed_1 = IDL.Record({ @@ -675,12 +725,12 @@ export const idlFactory = ({ IDL }) => { 'total_neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64), 'sns_governance_canister_id' : IDL.Opt(IDL.Principal), }); - const Result_8 = IDL.Variant({ + const Result_9 = IDL.Variant({ 'Committed' : Committed_1, 'Aborted' : IDL.Record({}), }); const SettleNeuronsFundParticipationRequest = IDL.Record({ - 'result' : IDL.Opt(Result_8), + 'result' : IDL.Opt(Result_9), 'nns_proposal_id' : IDL.Opt(IDL.Nat64), }); const NeuronsFundNeuron = IDL.Record({ @@ -689,12 +739,12 @@ export const idlFactory = ({ IDL }) => { 'nns_neuron_id' : IDL.Opt(IDL.Nat64), 'amount_icp_e8s' : IDL.Opt(IDL.Nat64), }); - const Ok = IDL.Record({ + const Ok_1 = IDL.Record({ 'neurons_fund_neuron_portions' : IDL.Vec(NeuronsFundNeuron), }); - const Result_9 = IDL.Variant({ 'Ok' : Ok, 'Err' : GovernanceError }); + const Result_10 = IDL.Variant({ 'Ok' : Ok_1, 'Err' : GovernanceError }); const SettleNeuronsFundParticipationResponse = IDL.Record({ - 'result' : IDL.Opt(Result_9), + 'result' : IDL.Opt(Result_10), }); const UpdateNodeProvider = IDL.Record({ 'reward_account' : IDL.Opt(AccountIdentifier), @@ -733,7 +783,12 @@ export const idlFactory = ({ IDL }) => { [Result_5], [], ), - 'get_node_provider_by_caller' : IDL.Func([IDL.Null], [Result_6], []), + 'get_neurons_fund_audit_info' : IDL.Func( + [GetNeuronsFundAuditInfoRequest], + [GetNeuronsFundAuditInfoResponse], + [], + ), + 'get_node_provider_by_caller' : IDL.Func([IDL.Null], [Result_7], []), 'get_pending_proposals' : IDL.Func([], [IDL.Vec(ProposalInfo)], []), 'get_proposal_info' : IDL.Func([IDL.Nat64], [IDL.Opt(ProposalInfo)], []), 'list_known_neurons' : IDL.Func([], [ListKnownNeuronsResponse], []), @@ -1059,6 +1114,14 @@ export const init = ({ IDL }) => { 'caller' : IDL.Opt(IDL.Principal), 'proposer_id' : IDL.Opt(NeuronId), }); + const SeedAccount = IDL.Record({ + 'error_count' : IDL.Nat64, + 'account_id' : IDL.Text, + 'neuron_type' : IDL.Int32, + 'tag_end_timestamp_seconds' : IDL.Opt(IDL.Nat64), + 'tag_start_timestamp_seconds' : IDL.Opt(IDL.Nat64), + }); + const SeedAccounts = IDL.Record({ 'accounts' : IDL.Vec(SeedAccount) }); const MostRecentMonthlyNodeProviderRewards = IDL.Record({ 'timestamp' : IDL.Nat64, 'rewards' : IDL.Vec(RewardNodeProvider), @@ -1077,17 +1140,27 @@ export const init = ({ IDL }) => { 'not_dissolving_neurons_count_buckets' : IDL.Vec( IDL.Tuple(IDL.Nat64, IDL.Nat64) ), + 'ect_neuron_count' : IDL.Nat64, 'total_supply_icp' : IDL.Nat64, 'neurons_with_less_than_6_months_dissolve_delay_count' : IDL.Nat64, 'dissolved_neurons_count' : IDL.Nat64, 'community_fund_total_maturity_e8s_equivalent' : IDL.Nat64, + 'total_staked_e8s_seed' : IDL.Nat64, + 'total_staked_maturity_e8s_equivalent_ect' : IDL.Nat64, 'total_staked_e8s' : IDL.Nat64, 'not_dissolving_neurons_count' : IDL.Nat64, 'total_locked_e8s' : IDL.Nat64, 'neurons_fund_total_active_neurons' : IDL.Nat64, 'total_staked_maturity_e8s_equivalent' : IDL.Nat64, + 'not_dissolving_neurons_e8s_buckets_ect' : IDL.Vec( + IDL.Tuple(IDL.Nat64, IDL.Float64) + ), + 'total_staked_e8s_ect' : IDL.Nat64, 'not_dissolving_neurons_staked_maturity_e8s_equivalent_sum' : IDL.Nat64, 'dissolved_neurons_e8s' : IDL.Nat64, + 'dissolving_neurons_e8s_buckets_seed' : IDL.Vec( + IDL.Tuple(IDL.Nat64, IDL.Float64) + ), 'neurons_with_less_than_6_months_dissolve_delay_e8s' : IDL.Nat64, 'not_dissolving_neurons_staked_maturity_e8s_equivalent_buckets' : IDL.Vec( IDL.Tuple(IDL.Nat64, IDL.Float64) @@ -1095,12 +1168,20 @@ export const init = ({ IDL }) => { 'dissolving_neurons_count_buckets' : IDL.Vec( IDL.Tuple(IDL.Nat64, IDL.Nat64) ), + 'dissolving_neurons_e8s_buckets_ect' : IDL.Vec( + IDL.Tuple(IDL.Nat64, IDL.Float64) + ), 'dissolving_neurons_count' : IDL.Nat64, 'dissolving_neurons_e8s_buckets' : IDL.Vec( IDL.Tuple(IDL.Nat64, IDL.Float64) ), + 'total_staked_maturity_e8s_equivalent_seed' : IDL.Nat64, 'community_fund_total_staked_e8s' : IDL.Nat64, + 'not_dissolving_neurons_e8s_buckets_seed' : IDL.Vec( + IDL.Tuple(IDL.Nat64, IDL.Float64) + ), 'timestamp_seconds' : IDL.Nat64, + 'seed_neuron_count' : IDL.Nat64, }); const RewardEvent = IDL.Record({ 'rounds_since_last_distribution' : IDL.Opt(IDL.Nat64), @@ -1120,6 +1201,10 @@ export const init = ({ IDL }) => { 'transfer_timestamp' : IDL.Nat64, 'block_height' : IDL.Nat64, }); + const Followers = IDL.Record({ 'followers' : IDL.Vec(NeuronId) }); + const FollowersMap = IDL.Record({ + 'followers_map' : IDL.Vec(IDL.Tuple(IDL.Nat64, Followers)), + }); const Progress = IDL.Variant({ 'LastNeuronId' : NeuronId }); const Migration = IDL.Record({ 'status' : IDL.Opt(IDL.Int32), @@ -1173,6 +1258,7 @@ export const init = ({ IDL }) => { 'ideal_matched_participation_function' : IDL.Opt( IdealMatchedParticipationFunction ), + 'allocated_neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64), }); const NeuronsFundData = IDL.Record({ 'final_neurons_fund_participation' : IDL.Opt(NeuronsFundParticipation), @@ -1265,6 +1351,7 @@ export const init = ({ IDL }) => { 'controller' : IDL.Opt(IDL.Principal), 'recent_ballots' : IDL.Vec(BallotInfo), 'kyc_verified' : IDL.Bool, + 'neuron_type' : IDL.Opt(IDL.Int32), 'not_for_profit' : IDL.Bool, 'maturity_e8s_equivalent' : IDL.Nat64, 'cached_neuron_stake_e8s' : IDL.Nat64, @@ -1284,6 +1371,7 @@ export const init = ({ IDL }) => { const Governance = IDL.Record({ 'default_followees' : IDL.Vec(IDL.Tuple(IDL.Int32, Followees)), 'making_sns_proposal' : IDL.Opt(MakingSnsProposal), + 'seed_accounts' : IDL.Opt(SeedAccounts), 'most_recent_monthly_node_provider_rewards' : IDL.Opt( MostRecentMonthlyNodeProviderRewards ), @@ -1300,6 +1388,7 @@ export const init = ({ IDL }) => { 'latest_reward_event' : IDL.Opt(RewardEvent), 'to_claim_transfers' : IDL.Vec(NeuronStakeTransfer), 'short_voting_period_seconds' : IDL.Nat64, + 'topic_followee_index' : IDL.Vec(IDL.Tuple(IDL.Int32, FollowersMap)), 'migrations' : IDL.Opt(Migrations), 'proposals' : IDL.Vec(IDL.Tuple(IDL.Nat64, ProposalData)), 'in_flight_commands' : IDL.Vec(IDL.Tuple(IDL.Nat64, NeuronInFlightCommand)), diff --git a/packages/nns/candid/governance_test.d.ts b/packages/nns/candid/governance_test.d.ts index 70449c3f..3fa74843 100644 --- a/packages/nns/candid/governance_test.d.ts +++ b/packages/nns/candid/governance_test.d.ts @@ -186,12 +186,25 @@ export interface Follow { export interface Followees { followees: Array; } +export interface Followers { + followers: Array; +} +export interface FollowersMap { + followers_map: Array<[bigint, Followers]>; +} +export interface GetNeuronsFundAuditInfoRequest { + nns_proposal_id: [] | [NeuronId]; +} +export interface GetNeuronsFundAuditInfoResponse { + result: [] | [Result_6]; +} export interface GlobalTimeOfDay { seconds_after_utc_midnight: [] | [bigint]; } export interface Governance { default_followees: Array<[number, Followees]>; making_sns_proposal: [] | [MakingSnsProposal]; + seed_accounts: [] | [SeedAccounts]; most_recent_monthly_node_provider_rewards: | [] | [MostRecentMonthlyNodeProviderRewards]; @@ -206,6 +219,7 @@ export interface Governance { latest_reward_event: [] | [RewardEvent]; to_claim_transfers: Array; short_voting_period_seconds: bigint; + topic_followee_index: Array<[number, FollowersMap]>; migrations: [] | [Migrations]; proposals: Array<[bigint, ProposalData]>; in_flight_commands: Array<[bigint, NeuronInFlightCommand]>; @@ -222,26 +236,36 @@ export interface GovernanceCachedMetrics { >; neurons_with_invalid_stake_count: bigint; not_dissolving_neurons_count_buckets: Array<[bigint, bigint]>; + ect_neuron_count: bigint; total_supply_icp: bigint; neurons_with_less_than_6_months_dissolve_delay_count: bigint; dissolved_neurons_count: bigint; community_fund_total_maturity_e8s_equivalent: bigint; + total_staked_e8s_seed: bigint; + total_staked_maturity_e8s_equivalent_ect: bigint; total_staked_e8s: bigint; not_dissolving_neurons_count: bigint; total_locked_e8s: bigint; neurons_fund_total_active_neurons: bigint; total_staked_maturity_e8s_equivalent: bigint; + not_dissolving_neurons_e8s_buckets_ect: Array<[bigint, number]>; + total_staked_e8s_ect: bigint; not_dissolving_neurons_staked_maturity_e8s_equivalent_sum: bigint; dissolved_neurons_e8s: bigint; + dissolving_neurons_e8s_buckets_seed: Array<[bigint, number]>; neurons_with_less_than_6_months_dissolve_delay_e8s: bigint; not_dissolving_neurons_staked_maturity_e8s_equivalent_buckets: Array< [bigint, number] >; dissolving_neurons_count_buckets: Array<[bigint, bigint]>; + dissolving_neurons_e8s_buckets_ect: Array<[bigint, number]>; dissolving_neurons_count: bigint; dissolving_neurons_e8s_buckets: Array<[bigint, number]>; + total_staked_maturity_e8s_equivalent_seed: bigint; community_fund_total_staked_e8s: bigint; + not_dissolving_neurons_e8s_buckets_seed: Array<[bigint, number]>; timestamp_seconds: bigint; + seed_neuron_count: bigint; } export interface GovernanceError { error_message: string; @@ -377,6 +401,7 @@ export interface Neuron { controller: [] | [Principal]; recent_ballots: Array; kyc_verified: boolean; + neuron_type: [] | [number]; not_for_profit: boolean; maturity_e8s_equivalent: bigint; cached_neuron_stake_e8s: bigint; @@ -421,6 +446,7 @@ export interface NeuronInFlightCommand { export interface NeuronInfo { dissolve_delay_seconds: bigint; recent_ballots: Array; + neuron_type: [] | [number]; created_timestamp_seconds: bigint; state: number; stake_e8s: bigint; @@ -439,6 +465,11 @@ export interface NeuronStakeTransfer { transfer_timestamp: bigint; block_height: bigint; } +export interface NeuronsFundAuditInfo { + final_neurons_fund_participation: [] | [NeuronsFundParticipation]; + initial_neurons_fund_participation: [] | [NeuronsFundParticipation]; + neurons_fund_refunds: [] | [NeuronsFundSnapshot]; +} export interface NeuronsFundData { final_neurons_fund_participation: [] | [NeuronsFundParticipation]; initial_neurons_fund_participation: [] | [NeuronsFundParticipation]; @@ -467,6 +498,7 @@ export interface NeuronsFundParticipation { ideal_matched_participation_function: | [] | [IdealMatchedParticipationFunction]; + allocated_neurons_fund_participation_icp_e8s: [] | [bigint]; } export interface NeuronsFundSnapshot { neurons_fund_neuron_portions: Array; @@ -476,6 +508,9 @@ export interface NodeProvider { reward_account: [] | [AccountIdentifier]; } export interface Ok { + neurons_fund_audit_info: [] | [NeuronsFundAuditInfo]; +} +export interface Ok_1 { neurons_fund_neuron_portions: Array; } export interface OpenSnsTokenSwap { @@ -566,16 +601,17 @@ export interface RemoveHotKey { } export type Result = { Ok: null } | { Err: GovernanceError }; export type Result_1 = { Error: GovernanceError } | { NeuronId: NeuronId }; +export type Result_10 = { Ok: Ok_1 } | { Err: GovernanceError }; export type Result_2 = { Ok: Neuron } | { Err: GovernanceError }; export type Result_3 = | { Ok: GovernanceCachedMetrics } | { Err: GovernanceError }; export type Result_4 = { Ok: RewardNodeProviders } | { Err: GovernanceError }; export type Result_5 = { Ok: NeuronInfo } | { Err: GovernanceError }; -export type Result_6 = { Ok: NodeProvider } | { Err: GovernanceError }; -export type Result_7 = { Committed: Committed } | { Aborted: {} }; -export type Result_8 = { Committed: Committed_1 } | { Aborted: {} }; -export type Result_9 = { Ok: Ok } | { Err: GovernanceError }; +export type Result_6 = { Ok: Ok } | { Err: GovernanceError }; +export type Result_7 = { Ok: NodeProvider } | { Err: GovernanceError }; +export type Result_8 = { Committed: Committed } | { Aborted: {} }; +export type Result_9 = { Committed: Committed_1 } | { Aborted: {} }; export interface RewardEvent { rounds_since_last_distribution: [] | [bigint]; day_after_genesis: bigint; @@ -603,6 +639,16 @@ export interface RewardToAccount { export interface RewardToNeuron { dissolve_delay_seconds: bigint; } +export interface SeedAccount { + error_count: bigint; + account_id: string; + neuron_type: number; + tag_end_timestamp_seconds: [] | [bigint]; + tag_start_timestamp_seconds: [] | [bigint]; +} +export interface SeedAccounts { + accounts: Array; +} export interface SetDefaultFollowees { default_followees: Array<[number, Followees]>; } @@ -617,15 +663,15 @@ export interface SetSnsTokenSwapOpenTimeWindow { swap_canister_id: [] | [Principal]; } export interface SettleCommunityFundParticipation { - result: [] | [Result_7]; + result: [] | [Result_8]; open_sns_token_swap_proposal_id: [] | [bigint]; } export interface SettleNeuronsFundParticipationRequest { - result: [] | [Result_8]; + result: [] | [Result_9]; nns_proposal_id: [] | [bigint]; } export interface SettleNeuronsFundParticipationResponse { - result: [] | [Result_9]; + result: [] | [Result_10]; } export interface Spawn { percentage_to_spawn: [] | [number]; @@ -732,7 +778,11 @@ export interface _SERVICE { [NeuronIdOrSubaccount], Result_5 >; - get_node_provider_by_caller: ActorMethod<[null], Result_6>; + get_neurons_fund_audit_info: ActorMethod< + [GetNeuronsFundAuditInfoRequest], + GetNeuronsFundAuditInfoResponse + >; + get_node_provider_by_caller: ActorMethod<[null], Result_7>; get_pending_proposals: ActorMethod<[], Array>; get_proposal_info: ActorMethod<[bigint], [] | [ProposalInfo]>; list_known_neurons: ActorMethod<[], ListKnownNeuronsResponse>; diff --git a/packages/nns/candid/governance_test.did b/packages/nns/candid/governance_test.did index 0e79f8cd..40378b94 100644 --- a/packages/nns/candid/governance_test.did +++ b/packages/nns/candid/governance_test.did @@ -1,4 +1,4 @@ -// Generated from IC repo commit 1a01f85fc1994e69dd5ba72b4d87fe9f9c4093ee 'rs/nns/governance/canister/governance_test.did' by import-candid +// Generated from IC repo commit 0ee9960d6 (2023-12-06) 'rs/nns/governance/canister/governance_test.did' by import-candid type AccountIdentifier = record { hash : vec nat8 }; type Action = variant { RegisterKnownNeuron : KnownNeuron; @@ -150,10 +150,15 @@ type Duration = record { seconds : opt nat64 }; type ExecuteNnsFunction = record { nns_function : int32; payload : vec nat8 }; type Follow = record { topic : int32; followees : vec NeuronId }; type Followees = record { followees : vec NeuronId }; +type Followers = record { followers : vec NeuronId }; +type FollowersMap = record { followers_map : vec record { nat64; Followers } }; +type GetNeuronsFundAuditInfoRequest = record { nns_proposal_id : opt NeuronId }; +type GetNeuronsFundAuditInfoResponse = record { result : opt Result_6 }; type GlobalTimeOfDay = record { seconds_after_utc_midnight : opt nat64 }; type Governance = record { default_followees : vec record { int32; Followees }; making_sns_proposal : opt MakingSnsProposal; + seed_accounts : opt SeedAccounts; most_recent_monthly_node_provider_rewards : opt MostRecentMonthlyNodeProviderRewards; maturity_modulation_last_updated_at_timestamp_seconds : opt nat64; wait_for_quiet_threshold_seconds : nat64; @@ -166,6 +171,7 @@ type Governance = record { latest_reward_event : opt RewardEvent; to_claim_transfers : vec NeuronStakeTransfer; short_voting_period_seconds : nat64; + topic_followee_index : vec record { int32; FollowersMap }; migrations : opt Migrations; proposals : vec record { nat64; ProposalData }; in_flight_commands : vec record { nat64; NeuronInFlightCommand }; @@ -183,27 +189,37 @@ type GovernanceCachedMetrics = record { }; neurons_with_invalid_stake_count : nat64; not_dissolving_neurons_count_buckets : vec record { nat64; nat64 }; + ect_neuron_count : nat64; total_supply_icp : nat64; neurons_with_less_than_6_months_dissolve_delay_count : nat64; dissolved_neurons_count : nat64; community_fund_total_maturity_e8s_equivalent : nat64; + total_staked_e8s_seed : nat64; + total_staked_maturity_e8s_equivalent_ect : nat64; total_staked_e8s : nat64; not_dissolving_neurons_count : nat64; total_locked_e8s : nat64; neurons_fund_total_active_neurons : nat64; total_staked_maturity_e8s_equivalent : nat64; + not_dissolving_neurons_e8s_buckets_ect : vec record { nat64; float64 }; + total_staked_e8s_ect : nat64; not_dissolving_neurons_staked_maturity_e8s_equivalent_sum : nat64; dissolved_neurons_e8s : nat64; + dissolving_neurons_e8s_buckets_seed : vec record { nat64; float64 }; neurons_with_less_than_6_months_dissolve_delay_e8s : nat64; not_dissolving_neurons_staked_maturity_e8s_equivalent_buckets : vec record { nat64; float64; }; dissolving_neurons_count_buckets : vec record { nat64; nat64 }; + dissolving_neurons_e8s_buckets_ect : vec record { nat64; float64 }; dissolving_neurons_count : nat64; dissolving_neurons_e8s_buckets : vec record { nat64; float64 }; + total_staked_maturity_e8s_equivalent_seed : nat64; community_fund_total_staked_e8s : nat64; + not_dissolving_neurons_e8s_buckets_seed : vec record { nat64; float64 }; timestamp_seconds : nat64; + seed_neuron_count : nat64; }; type GovernanceError = record { error_message : text; error_type : int32 }; type GovernanceParameters = record { @@ -315,6 +331,7 @@ type Neuron = record { controller : opt principal; recent_ballots : vec BallotInfo; kyc_verified : bool; + neuron_type : opt int32; not_for_profit : bool; maturity_e8s_equivalent : nat64; cached_neuron_stake_e8s : nat64; @@ -358,6 +375,7 @@ type NeuronInFlightCommand = record { type NeuronInfo = record { dissolve_delay_seconds : nat64; recent_ballots : vec BallotInfo; + neuron_type : opt int32; created_timestamp_seconds : nat64; state : int32; stake_e8s : nat64; @@ -376,6 +394,11 @@ type NeuronStakeTransfer = record { transfer_timestamp : nat64; block_height : nat64; }; +type NeuronsFundAuditInfo = record { + final_neurons_fund_participation : opt NeuronsFundParticipation; + initial_neurons_fund_participation : opt NeuronsFundParticipation; + neurons_fund_refunds : opt NeuronsFundSnapshot; +}; type NeuronsFundData = record { final_neurons_fund_participation : opt NeuronsFundParticipation; initial_neurons_fund_participation : opt NeuronsFundParticipation; @@ -402,6 +425,7 @@ type NeuronsFundParticipation = record { max_neurons_fund_swap_participation_icp_e8s : opt nat64; neurons_fund_reserves : opt NeuronsFundSnapshot; ideal_matched_participation_function : opt IdealMatchedParticipationFunction; + allocated_neurons_fund_participation_icp_e8s : opt nat64; }; type NeuronsFundSnapshot = record { neurons_fund_neuron_portions : vec NeuronsFundNeuronPortion; @@ -410,7 +434,8 @@ type NodeProvider = record { id : opt principal; reward_account : opt AccountIdentifier; }; -type Ok = record { neurons_fund_neuron_portions : vec NeuronsFundNeuron }; +type Ok = record { neurons_fund_audit_info : opt NeuronsFundAuditInfo }; +type Ok_1 = record { neurons_fund_neuron_portions : vec NeuronsFundNeuron }; type OpenSnsTokenSwap = record { community_fund_investment_e8s : opt nat64; target_swap_canister_id : opt principal; @@ -491,14 +516,15 @@ type RegisterVote = record { vote : int32; proposal : opt NeuronId }; type RemoveHotKey = record { hot_key_to_remove : opt principal }; type Result = variant { Ok; Err : GovernanceError }; type Result_1 = variant { Error : GovernanceError; NeuronId : NeuronId }; +type Result_10 = variant { Ok : Ok_1; Err : GovernanceError }; type Result_2 = variant { Ok : Neuron; Err : GovernanceError }; type Result_3 = variant { Ok : GovernanceCachedMetrics; Err : GovernanceError }; type Result_4 = variant { Ok : RewardNodeProviders; Err : GovernanceError }; type Result_5 = variant { Ok : NeuronInfo; Err : GovernanceError }; -type Result_6 = variant { Ok : NodeProvider; Err : GovernanceError }; -type Result_7 = variant { Committed : Committed; Aborted : record {} }; -type Result_8 = variant { Committed : Committed_1; Aborted : record {} }; -type Result_9 = variant { Ok : Ok; Err : GovernanceError }; +type Result_6 = variant { Ok : Ok; Err : GovernanceError }; +type Result_7 = variant { Ok : NodeProvider; Err : GovernanceError }; +type Result_8 = variant { Committed : Committed; Aborted : record {} }; +type Result_9 = variant { Committed : Committed_1; Aborted : record {} }; type RewardEvent = record { rounds_since_last_distribution : opt nat64; day_after_genesis : nat64; @@ -523,6 +549,14 @@ type RewardNodeProviders = record { }; type RewardToAccount = record { to_account : opt AccountIdentifier }; type RewardToNeuron = record { dissolve_delay_seconds : nat64 }; +type SeedAccount = record { + error_count : nat64; + account_id : text; + neuron_type : int32; + tag_end_timestamp_seconds : opt nat64; + tag_start_timestamp_seconds : opt nat64; +}; +type SeedAccounts = record { accounts : vec SeedAccount }; type SetDefaultFollowees = record { default_followees : vec record { int32; Followees }; }; @@ -533,14 +567,14 @@ type SetSnsTokenSwapOpenTimeWindow = record { swap_canister_id : opt principal; }; type SettleCommunityFundParticipation = record { - result : opt Result_7; + result : opt Result_8; open_sns_token_swap_proposal_id : opt nat64; }; type SettleNeuronsFundParticipationRequest = record { - result : opt Result_8; + result : opt Result_9; nns_proposal_id : opt nat64; }; -type SettleNeuronsFundParticipationResponse = record { result : opt Result_9 }; +type SettleNeuronsFundParticipationResponse = record { result : opt Result_10 }; type Spawn = record { percentage_to_spawn : opt nat32; new_controller : opt principal; @@ -626,7 +660,10 @@ service : (Governance) -> { get_neuron_info_by_id_or_subaccount : (NeuronIdOrSubaccount) -> ( Result_5, ) query; - get_node_provider_by_caller : (null) -> (Result_6) query; + get_neurons_fund_audit_info : (GetNeuronsFundAuditInfoRequest) -> ( + GetNeuronsFundAuditInfoResponse, + ) query; + get_node_provider_by_caller : (null) -> (Result_7) query; get_pending_proposals : () -> (vec ProposalInfo) query; get_proposal_info : (nat64) -> (opt ProposalInfo) query; list_known_neurons : () -> (ListKnownNeuronsResponse) query; diff --git a/packages/nns/candid/governance_test.idl.js b/packages/nns/candid/governance_test.idl.js index d2021a53..09ce82a3 100644 --- a/packages/nns/candid/governance_test.idl.js +++ b/packages/nns/candid/governance_test.idl.js @@ -293,6 +293,14 @@ export const idlFactory = ({ IDL }) => { 'caller' : IDL.Opt(IDL.Principal), 'proposer_id' : IDL.Opt(NeuronId), }); + const SeedAccount = IDL.Record({ + 'error_count' : IDL.Nat64, + 'account_id' : IDL.Text, + 'neuron_type' : IDL.Int32, + 'tag_end_timestamp_seconds' : IDL.Opt(IDL.Nat64), + 'tag_start_timestamp_seconds' : IDL.Opt(IDL.Nat64), + }); + const SeedAccounts = IDL.Record({ 'accounts' : IDL.Vec(SeedAccount) }); const MostRecentMonthlyNodeProviderRewards = IDL.Record({ 'timestamp' : IDL.Nat64, 'rewards' : IDL.Vec(RewardNodeProvider), @@ -311,17 +319,27 @@ export const idlFactory = ({ IDL }) => { 'not_dissolving_neurons_count_buckets' : IDL.Vec( IDL.Tuple(IDL.Nat64, IDL.Nat64) ), + 'ect_neuron_count' : IDL.Nat64, 'total_supply_icp' : IDL.Nat64, 'neurons_with_less_than_6_months_dissolve_delay_count' : IDL.Nat64, 'dissolved_neurons_count' : IDL.Nat64, 'community_fund_total_maturity_e8s_equivalent' : IDL.Nat64, + 'total_staked_e8s_seed' : IDL.Nat64, + 'total_staked_maturity_e8s_equivalent_ect' : IDL.Nat64, 'total_staked_e8s' : IDL.Nat64, 'not_dissolving_neurons_count' : IDL.Nat64, 'total_locked_e8s' : IDL.Nat64, 'neurons_fund_total_active_neurons' : IDL.Nat64, 'total_staked_maturity_e8s_equivalent' : IDL.Nat64, + 'not_dissolving_neurons_e8s_buckets_ect' : IDL.Vec( + IDL.Tuple(IDL.Nat64, IDL.Float64) + ), + 'total_staked_e8s_ect' : IDL.Nat64, 'not_dissolving_neurons_staked_maturity_e8s_equivalent_sum' : IDL.Nat64, 'dissolved_neurons_e8s' : IDL.Nat64, + 'dissolving_neurons_e8s_buckets_seed' : IDL.Vec( + IDL.Tuple(IDL.Nat64, IDL.Float64) + ), 'neurons_with_less_than_6_months_dissolve_delay_e8s' : IDL.Nat64, 'not_dissolving_neurons_staked_maturity_e8s_equivalent_buckets' : IDL.Vec( IDL.Tuple(IDL.Nat64, IDL.Float64) @@ -329,12 +347,20 @@ export const idlFactory = ({ IDL }) => { 'dissolving_neurons_count_buckets' : IDL.Vec( IDL.Tuple(IDL.Nat64, IDL.Nat64) ), + 'dissolving_neurons_e8s_buckets_ect' : IDL.Vec( + IDL.Tuple(IDL.Nat64, IDL.Float64) + ), 'dissolving_neurons_count' : IDL.Nat64, 'dissolving_neurons_e8s_buckets' : IDL.Vec( IDL.Tuple(IDL.Nat64, IDL.Float64) ), + 'total_staked_maturity_e8s_equivalent_seed' : IDL.Nat64, 'community_fund_total_staked_e8s' : IDL.Nat64, + 'not_dissolving_neurons_e8s_buckets_seed' : IDL.Vec( + IDL.Tuple(IDL.Nat64, IDL.Float64) + ), 'timestamp_seconds' : IDL.Nat64, + 'seed_neuron_count' : IDL.Nat64, }); const RewardEvent = IDL.Record({ 'rounds_since_last_distribution' : IDL.Opt(IDL.Nat64), @@ -354,6 +380,10 @@ export const idlFactory = ({ IDL }) => { 'transfer_timestamp' : IDL.Nat64, 'block_height' : IDL.Nat64, }); + const Followers = IDL.Record({ 'followers' : IDL.Vec(NeuronId) }); + const FollowersMap = IDL.Record({ + 'followers_map' : IDL.Vec(IDL.Tuple(IDL.Nat64, Followers)), + }); const Progress = IDL.Variant({ 'LastNeuronId' : NeuronId }); const Migration = IDL.Record({ 'status' : IDL.Opt(IDL.Int32), @@ -407,6 +437,7 @@ export const idlFactory = ({ IDL }) => { 'ideal_matched_participation_function' : IDL.Opt( IdealMatchedParticipationFunction ), + 'allocated_neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64), }); const NeuronsFundData = IDL.Record({ 'final_neurons_fund_participation' : IDL.Opt(NeuronsFundParticipation), @@ -499,6 +530,7 @@ export const idlFactory = ({ IDL }) => { 'controller' : IDL.Opt(IDL.Principal), 'recent_ballots' : IDL.Vec(BallotInfo), 'kyc_verified' : IDL.Bool, + 'neuron_type' : IDL.Opt(IDL.Int32), 'not_for_profit' : IDL.Bool, 'maturity_e8s_equivalent' : IDL.Nat64, 'cached_neuron_stake_e8s' : IDL.Nat64, @@ -518,6 +550,7 @@ export const idlFactory = ({ IDL }) => { const Governance = IDL.Record({ 'default_followees' : IDL.Vec(IDL.Tuple(IDL.Int32, Followees)), 'making_sns_proposal' : IDL.Opt(MakingSnsProposal), + 'seed_accounts' : IDL.Opt(SeedAccounts), 'most_recent_monthly_node_provider_rewards' : IDL.Opt( MostRecentMonthlyNodeProviderRewards ), @@ -534,6 +567,7 @@ export const idlFactory = ({ IDL }) => { 'latest_reward_event' : IDL.Opt(RewardEvent), 'to_claim_transfers' : IDL.Vec(NeuronStakeTransfer), 'short_voting_period_seconds' : IDL.Nat64, + 'topic_followee_index' : IDL.Vec(IDL.Tuple(IDL.Int32, FollowersMap)), 'migrations' : IDL.Opt(Migrations), 'proposals' : IDL.Vec(IDL.Tuple(IDL.Nat64, ProposalData)), 'in_flight_commands' : IDL.Vec(IDL.Tuple(IDL.Nat64, NeuronInFlightCommand)), @@ -560,6 +594,7 @@ export const idlFactory = ({ IDL }) => { const NeuronInfo = IDL.Record({ 'dissolve_delay_seconds' : IDL.Nat64, 'recent_ballots' : IDL.Vec(BallotInfo), + 'neuron_type' : IDL.Opt(IDL.Int32), 'created_timestamp_seconds' : IDL.Nat64, 'state' : IDL.Int32, 'stake_e8s' : IDL.Nat64, @@ -570,7 +605,22 @@ export const idlFactory = ({ IDL }) => { 'age_seconds' : IDL.Nat64, }); const Result_5 = IDL.Variant({ 'Ok' : NeuronInfo, 'Err' : GovernanceError }); - const Result_6 = IDL.Variant({ + const GetNeuronsFundAuditInfoRequest = IDL.Record({ + 'nns_proposal_id' : IDL.Opt(NeuronId), + }); + const NeuronsFundAuditInfo = IDL.Record({ + 'final_neurons_fund_participation' : IDL.Opt(NeuronsFundParticipation), + 'initial_neurons_fund_participation' : IDL.Opt(NeuronsFundParticipation), + 'neurons_fund_refunds' : IDL.Opt(NeuronsFundSnapshot), + }); + const Ok = IDL.Record({ + 'neurons_fund_audit_info' : IDL.Opt(NeuronsFundAuditInfo), + }); + const Result_6 = IDL.Variant({ 'Ok' : Ok, 'Err' : GovernanceError }); + const GetNeuronsFundAuditInfoResponse = IDL.Record({ + 'result' : IDL.Opt(Result_6), + }); + const Result_7 = IDL.Variant({ 'Ok' : NodeProvider, 'Err' : GovernanceError, }); @@ -662,12 +712,12 @@ export const idlFactory = ({ IDL }) => { 'total_neurons_fund_contribution_icp_e8s' : IDL.Opt(IDL.Nat64), 'sns_governance_canister_id' : IDL.Opt(IDL.Principal), }); - const Result_7 = IDL.Variant({ + const Result_8 = IDL.Variant({ 'Committed' : Committed, 'Aborted' : IDL.Record({}), }); const SettleCommunityFundParticipation = IDL.Record({ - 'result' : IDL.Opt(Result_7), + 'result' : IDL.Opt(Result_8), 'open_sns_token_swap_proposal_id' : IDL.Opt(IDL.Nat64), }); const Committed_1 = IDL.Record({ @@ -675,12 +725,12 @@ export const idlFactory = ({ IDL }) => { 'total_neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64), 'sns_governance_canister_id' : IDL.Opt(IDL.Principal), }); - const Result_8 = IDL.Variant({ + const Result_9 = IDL.Variant({ 'Committed' : Committed_1, 'Aborted' : IDL.Record({}), }); const SettleNeuronsFundParticipationRequest = IDL.Record({ - 'result' : IDL.Opt(Result_8), + 'result' : IDL.Opt(Result_9), 'nns_proposal_id' : IDL.Opt(IDL.Nat64), }); const NeuronsFundNeuron = IDL.Record({ @@ -689,12 +739,12 @@ export const idlFactory = ({ IDL }) => { 'nns_neuron_id' : IDL.Opt(IDL.Nat64), 'amount_icp_e8s' : IDL.Opt(IDL.Nat64), }); - const Ok = IDL.Record({ + const Ok_1 = IDL.Record({ 'neurons_fund_neuron_portions' : IDL.Vec(NeuronsFundNeuron), }); - const Result_9 = IDL.Variant({ 'Ok' : Ok, 'Err' : GovernanceError }); + const Result_10 = IDL.Variant({ 'Ok' : Ok_1, 'Err' : GovernanceError }); const SettleNeuronsFundParticipationResponse = IDL.Record({ - 'result' : IDL.Opt(Result_9), + 'result' : IDL.Opt(Result_10), }); const UpdateNodeProvider = IDL.Record({ 'reward_account' : IDL.Opt(AccountIdentifier), @@ -737,7 +787,12 @@ export const idlFactory = ({ IDL }) => { [Result_5], ['query'], ), - 'get_node_provider_by_caller' : IDL.Func([IDL.Null], [Result_6], ['query']), + 'get_neurons_fund_audit_info' : IDL.Func( + [GetNeuronsFundAuditInfoRequest], + [GetNeuronsFundAuditInfoResponse], + ['query'], + ), + 'get_node_provider_by_caller' : IDL.Func([IDL.Null], [Result_7], ['query']), 'get_pending_proposals' : IDL.Func([], [IDL.Vec(ProposalInfo)], ['query']), 'get_proposal_info' : IDL.Func( [IDL.Nat64], @@ -1071,6 +1126,14 @@ export const init = ({ IDL }) => { 'caller' : IDL.Opt(IDL.Principal), 'proposer_id' : IDL.Opt(NeuronId), }); + const SeedAccount = IDL.Record({ + 'error_count' : IDL.Nat64, + 'account_id' : IDL.Text, + 'neuron_type' : IDL.Int32, + 'tag_end_timestamp_seconds' : IDL.Opt(IDL.Nat64), + 'tag_start_timestamp_seconds' : IDL.Opt(IDL.Nat64), + }); + const SeedAccounts = IDL.Record({ 'accounts' : IDL.Vec(SeedAccount) }); const MostRecentMonthlyNodeProviderRewards = IDL.Record({ 'timestamp' : IDL.Nat64, 'rewards' : IDL.Vec(RewardNodeProvider), @@ -1089,17 +1152,27 @@ export const init = ({ IDL }) => { 'not_dissolving_neurons_count_buckets' : IDL.Vec( IDL.Tuple(IDL.Nat64, IDL.Nat64) ), + 'ect_neuron_count' : IDL.Nat64, 'total_supply_icp' : IDL.Nat64, 'neurons_with_less_than_6_months_dissolve_delay_count' : IDL.Nat64, 'dissolved_neurons_count' : IDL.Nat64, 'community_fund_total_maturity_e8s_equivalent' : IDL.Nat64, + 'total_staked_e8s_seed' : IDL.Nat64, + 'total_staked_maturity_e8s_equivalent_ect' : IDL.Nat64, 'total_staked_e8s' : IDL.Nat64, 'not_dissolving_neurons_count' : IDL.Nat64, 'total_locked_e8s' : IDL.Nat64, 'neurons_fund_total_active_neurons' : IDL.Nat64, 'total_staked_maturity_e8s_equivalent' : IDL.Nat64, + 'not_dissolving_neurons_e8s_buckets_ect' : IDL.Vec( + IDL.Tuple(IDL.Nat64, IDL.Float64) + ), + 'total_staked_e8s_ect' : IDL.Nat64, 'not_dissolving_neurons_staked_maturity_e8s_equivalent_sum' : IDL.Nat64, 'dissolved_neurons_e8s' : IDL.Nat64, + 'dissolving_neurons_e8s_buckets_seed' : IDL.Vec( + IDL.Tuple(IDL.Nat64, IDL.Float64) + ), 'neurons_with_less_than_6_months_dissolve_delay_e8s' : IDL.Nat64, 'not_dissolving_neurons_staked_maturity_e8s_equivalent_buckets' : IDL.Vec( IDL.Tuple(IDL.Nat64, IDL.Float64) @@ -1107,12 +1180,20 @@ export const init = ({ IDL }) => { 'dissolving_neurons_count_buckets' : IDL.Vec( IDL.Tuple(IDL.Nat64, IDL.Nat64) ), + 'dissolving_neurons_e8s_buckets_ect' : IDL.Vec( + IDL.Tuple(IDL.Nat64, IDL.Float64) + ), 'dissolving_neurons_count' : IDL.Nat64, 'dissolving_neurons_e8s_buckets' : IDL.Vec( IDL.Tuple(IDL.Nat64, IDL.Float64) ), + 'total_staked_maturity_e8s_equivalent_seed' : IDL.Nat64, 'community_fund_total_staked_e8s' : IDL.Nat64, + 'not_dissolving_neurons_e8s_buckets_seed' : IDL.Vec( + IDL.Tuple(IDL.Nat64, IDL.Float64) + ), 'timestamp_seconds' : IDL.Nat64, + 'seed_neuron_count' : IDL.Nat64, }); const RewardEvent = IDL.Record({ 'rounds_since_last_distribution' : IDL.Opt(IDL.Nat64), @@ -1132,6 +1213,10 @@ export const init = ({ IDL }) => { 'transfer_timestamp' : IDL.Nat64, 'block_height' : IDL.Nat64, }); + const Followers = IDL.Record({ 'followers' : IDL.Vec(NeuronId) }); + const FollowersMap = IDL.Record({ + 'followers_map' : IDL.Vec(IDL.Tuple(IDL.Nat64, Followers)), + }); const Progress = IDL.Variant({ 'LastNeuronId' : NeuronId }); const Migration = IDL.Record({ 'status' : IDL.Opt(IDL.Int32), @@ -1185,6 +1270,7 @@ export const init = ({ IDL }) => { 'ideal_matched_participation_function' : IDL.Opt( IdealMatchedParticipationFunction ), + 'allocated_neurons_fund_participation_icp_e8s' : IDL.Opt(IDL.Nat64), }); const NeuronsFundData = IDL.Record({ 'final_neurons_fund_participation' : IDL.Opt(NeuronsFundParticipation), @@ -1277,6 +1363,7 @@ export const init = ({ IDL }) => { 'controller' : IDL.Opt(IDL.Principal), 'recent_ballots' : IDL.Vec(BallotInfo), 'kyc_verified' : IDL.Bool, + 'neuron_type' : IDL.Opt(IDL.Int32), 'not_for_profit' : IDL.Bool, 'maturity_e8s_equivalent' : IDL.Nat64, 'cached_neuron_stake_e8s' : IDL.Nat64, @@ -1296,6 +1383,7 @@ export const init = ({ IDL }) => { const Governance = IDL.Record({ 'default_followees' : IDL.Vec(IDL.Tuple(IDL.Int32, Followees)), 'making_sns_proposal' : IDL.Opt(MakingSnsProposal), + 'seed_accounts' : IDL.Opt(SeedAccounts), 'most_recent_monthly_node_provider_rewards' : IDL.Opt( MostRecentMonthlyNodeProviderRewards ), @@ -1312,6 +1400,7 @@ export const init = ({ IDL }) => { 'latest_reward_event' : IDL.Opt(RewardEvent), 'to_claim_transfers' : IDL.Vec(NeuronStakeTransfer), 'short_voting_period_seconds' : IDL.Nat64, + 'topic_followee_index' : IDL.Vec(IDL.Tuple(IDL.Int32, FollowersMap)), 'migrations' : IDL.Opt(Migrations), 'proposals' : IDL.Vec(IDL.Tuple(IDL.Nat64, ProposalData)), 'in_flight_commands' : IDL.Vec(IDL.Tuple(IDL.Nat64, NeuronInFlightCommand)), diff --git a/packages/nns/src/canisters/governance/response.converters.ts b/packages/nns/src/canisters/governance/response.converters.ts index a1bc6cc7..c93875b2 100644 --- a/packages/nns/src/canisters/governance/response.converters.ts +++ b/packages/nns/src/canisters/governance/response.converters.ts @@ -62,7 +62,7 @@ import type { Tokens as RawTokens, VotingRewardParameters as RawVotingRewardParameters, } from "../../../candid/governance"; -import { NeuronState } from "../../enums/governance.enums"; +import { NeuronState, type NeuronType } from "../../enums/governance.enums"; import { UnsupportedValueError } from "../../errors/governance.errors"; import type { AccountIdentifier as AccountIdentifierString, @@ -125,6 +125,7 @@ export const toNeuronInfo = ({ neuronId: neuronId, dissolveDelaySeconds: neuronInfo.dissolve_delay_seconds, recentBallots: neuronInfo.recent_ballots.map(toBallotInfo), + neuronType: fromNullable(neuronInfo.neuron_type) as NeuronType | undefined, createdTimestampSeconds: neuronInfo.created_timestamp_seconds, state: neuronInfo.state, joinedCommunityFundTimestampSeconds: neuronInfo @@ -153,6 +154,7 @@ const toNeuron = ({ ? neuron.controller[0].toString() : undefined, recentBallots: neuron.recent_ballots.map(toBallotInfo), + neuronType: fromNullable(neuron.neuron_type) as NeuronType | undefined, kycVerified: neuron.kyc_verified, notForProfit: neuron.not_for_profit, cachedNeuronStake: neuron.cached_neuron_stake_e8s, @@ -194,6 +196,7 @@ export const toRawNeuron = (neuron: Neuron): RawNeuron => ({ : [], })), kyc_verified: neuron.kycVerified, + neuron_type: toNullable(neuron.neuronType), not_for_profit: neuron.notForProfit, cached_neuron_stake_e8s: neuron.cachedNeuronStake, created_timestamp_seconds: neuron.createdTimestampSeconds, @@ -965,6 +968,8 @@ const convertPbNeuronToFullNeuron = ({ stakedMaturityE8sEquivalent: undefined, controller, recentBallots: pbNeuronInfo.getRecentBallotsList().map(convertPbBallot), + // TODO: add to protobuf when needed + neuronType: undefined, kycVerified: pbNeuron.getKycVerified(), notForProfit: pbNeuron.getNotForProfit(), cachedNeuronStake: BigInt(pbNeuron.getCachedNeuronStakeE8s()), @@ -1015,6 +1020,10 @@ export const convertPbNeuronToNeuronInfo = neuronId: BigInt(pbNeuronMapEntry.getKey()), dissolveDelaySeconds: BigInt(pbNeuronInfo.getDissolveDelaySeconds()), recentBallots: pbNeuronInfo.getRecentBallotsList().map(convertPbBallot), + + // TODO: add to protobuf when needed + neuronType: undefined, + createdTimestampSeconds: BigInt( pbNeuronInfo.getCreatedTimestampSeconds(), ), diff --git a/packages/nns/src/enums/governance.enums.ts b/packages/nns/src/enums/governance.enums.ts index ee1e48a6..15fe295f 100644 --- a/packages/nns/src/enums/governance.enums.ts +++ b/packages/nns/src/enums/governance.enums.ts @@ -125,3 +125,16 @@ export enum NnsFunction { UpdateElectedHostosVersions = 40, UpdateNodesHostosVersion = 41, } + +// Reference: https://github.com/dfinity/ic/blob/f4b2e28525ae9b030bd9edfc982e796417db2b80/rs/nns/governance/src/gen/ic_nns_governance.pb.v1.rs#L3286-L3287 +export enum NeuronType { + // Placeholder value due to the proto3 requirement for a zero default. + // This is an invalid type; neurons should not be assigned this value. + Unspecified = 0, + // Represents neurons initially created for Seed accounts in the + // Genesis Token Canister, or those descended from such neurons. + Seed = 1, + // Represents neurons initially created for Early Contributor Token (ECT) + // accounts in the Genesis Token Canister, or those descended from such neurons. + Ect = 2, +} diff --git a/packages/nns/src/mocks/governance.mock.ts b/packages/nns/src/mocks/governance.mock.ts index 67e5d079..672686de 100644 --- a/packages/nns/src/mocks/governance.mock.ts +++ b/packages/nns/src/mocks/governance.mock.ts @@ -10,6 +10,7 @@ export const mockNeuronId = BigInt(14567); export const mockNeuronInfo: NeuronInfo = { dissolve_delay_seconds: one, recent_ballots: [], + neuron_type: [], created_timestamp_seconds: one, state: 2, stake_e8s: one, @@ -24,6 +25,7 @@ export const mockNeuron: Neuron = { staked_maturity_e8s_equivalent: [one], controller: [Principal.fromHex("1f")], recent_ballots: [], + neuron_type: [], kyc_verified: false, not_for_profit: false, maturity_e8s_equivalent: one, diff --git a/packages/nns/src/types/governance_converters.ts b/packages/nns/src/types/governance_converters.ts index 05756604..4cd3a7c0 100644 --- a/packages/nns/src/types/governance_converters.ts +++ b/packages/nns/src/types/governance_converters.ts @@ -2,6 +2,7 @@ import type { DerEncodedPublicKey } from "@dfinity/agent"; import type { Principal } from "@dfinity/principal"; import type { NeuronState, + NeuronType, ProposalRewardStatus, ProposalStatus, Topic, @@ -258,6 +259,7 @@ export interface NetworkEconomics { } export interface Neuron { id: Option; + neuronType: Option; stakedMaturityE8sEquivalent: Option; controller: Option; recentBallots: Array; @@ -283,6 +285,7 @@ export interface NeuronInfo { neuronId: NeuronId; dissolveDelaySeconds: bigint; recentBallots: Array; + neuronType: Option; createdTimestampSeconds: bigint; state: NeuronState; joinedCommunityFundTimestampSeconds: Option;