@dfinity/nns 8.0.1 → 8.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- // Generated from IC repo commit 5d20289 (2024-11-21 tags: release-2024-11-21_03-11-24.04-base-kernel) 'rs/nns/governance/canister/governance.did' by import-candid
1
+ // Generated from IC repo commit 0f35ac817b (2024-12-06) 'rs/nns/governance/canister/governance.did' by import-candid
2
2
  type AccountIdentifier = record {
3
3
  hash : blob;
4
4
  };
@@ -108,6 +108,24 @@ type ClaimOrRefreshResponse = record {
108
108
  refreshed_neuron_id : opt NeuronId;
109
109
  };
110
110
 
111
+ // This is one way for a neuron to make sure that its deciding_voting_power is
112
+ // not less than its potential_voting_power. See the description of those fields
113
+ // in Neuron.
114
+ type RefreshVotingPower = record {
115
+ // Intentionally left blank.
116
+ };
117
+
118
+ type RefreshVotingPowerResponse = record {
119
+ // Intentionally left blank.
120
+ //
121
+ // We could add information such as the value in the neuron's
122
+ // voting_power_refreshed_timestamp_second's field, but let's keep things
123
+ // minimal until we discover there is a "real need". YAGNI.
124
+ };
125
+
126
+ // KEEP THIS IN SYNC WITH ManageNeuronCommandRequest!
127
+ //
128
+ // Deprecated. Use ManageNeuronCommandRequest instead. It is equivalent.
111
129
  type Command = variant {
112
130
  Spawn : Spawn;
113
131
  Split : Split;
@@ -121,6 +139,9 @@ type Command = variant {
121
139
  StakeMaturity : StakeMaturity;
122
140
  MergeMaturity : MergeMaturity;
123
141
  Disburse : Disburse;
142
+ RefreshVotingPower : RefreshVotingPower;
143
+
144
+ // KEEP THIS IN SYNC WITH ManageNeuronCommandRequest!
124
145
  };
125
146
 
126
147
  type Command_1 = variant {
@@ -137,6 +158,7 @@ type Command_1 = variant {
137
158
  StakeMaturity : StakeMaturityResponse;
138
159
  MergeMaturity : MergeMaturityResponse;
139
160
  Disburse : DisburseResponse;
161
+ RefreshVotingPower : RefreshVotingPowerResponse;
140
162
  };
141
163
 
142
164
  type Command_2 = variant {
@@ -473,6 +495,11 @@ type ManageNeuron = record {
473
495
  neuron_id_or_subaccount : opt NeuronIdOrSubaccount;
474
496
  };
475
497
 
498
+ // KEEP THIS IN SYNC WITH COMMAND!
499
+ //
500
+ // Command is deprecated, but people need time to migrate to this. Therefore, we
501
+ // have not deleted Command yet. In the meantime, ManageNeuronCommandRequest
502
+ // must be kept in sync with Command.
476
503
  type ManageNeuronCommandRequest = variant {
477
504
  Spawn : Spawn;
478
505
  Split : Split;
@@ -486,6 +513,9 @@ type ManageNeuronCommandRequest = variant {
486
513
  StakeMaturity : StakeMaturity;
487
514
  MergeMaturity : MergeMaturity;
488
515
  Disburse : Disburse;
516
+ RefreshVotingPower : RefreshVotingPower;
517
+
518
+ // KEEP THIS IN SYNC WITH COMMAND!
489
519
  };
490
520
 
491
521
  type ManageNeuronRequest = record {
@@ -553,6 +583,32 @@ type NetworkEconomics = record {
553
583
  minimum_icp_xdr_rate : nat64;
554
584
  maximum_node_provider_rewards_e8s : nat64;
555
585
  neurons_fund_economics : opt NeuronsFundEconomics;
586
+
587
+ // Parameters that affect the voting power of neurons.
588
+ voting_power_economics : opt VotingPowerEconomics;
589
+ };
590
+
591
+ // Parameters that affect the voting power of neurons.
592
+ type VotingPowerEconomics = record {
593
+ // If a neuron has not "refreshed" its voting power after this amount of time,
594
+ // its deciding voting power starts decreasing linearly. See also
595
+ // clear_following_after_seconds.
596
+ //
597
+ // For explanation of what "refresh" means in this context, see
598
+ // https://dashboard.internetcomputer.org/proposal/132411
599
+ //
600
+ // Initially, set to 0.5 years. (The nominal length of a year is 365.25 days).
601
+ start_reducing_voting_power_after_seconds : opt nat64;
602
+
603
+ // After a neuron has experienced voting power reduction for this amount of
604
+ // time, a couple of things happen:
605
+ //
606
+ // 1. Deciding voting power reaches 0.
607
+ //
608
+ // 2. Its following on topics other than NeuronManagement are cleared.
609
+ //
610
+ // Initially, set to 1/12 years.
611
+ clear_following_after_seconds : opt nat64;
556
612
  };
557
613
 
558
614
  type Neuron = record {
@@ -579,6 +635,63 @@ type Neuron = record {
579
635
  known_neuron_data : opt KnownNeuronData;
580
636
  spawn_at_timestamp_seconds : opt nat64;
581
637
  voting_power_refreshed_timestamp_seconds : opt nat64;
638
+
639
+ // The amount of "sway" this neuron has when voting on proposals.
640
+ //
641
+ // When a proposal is created, each eligible neuron gets a "blank" ballot. The
642
+ // amount of voting power in that ballot is set to the neuron's deciding
643
+ // voting power at the time of proposal creation. There are two ways that a
644
+ // proposal can become decided:
645
+ //
646
+ // 1. Early: Either more than half of the total voting power in the ballots
647
+ // votes in favor (then the proposal is approved), or at least half of the
648
+ // votal voting power in the ballots votes against (then, the proposal is
649
+ // rejected).
650
+ //
651
+ // 2. The proposal's voting deadline is reached. At that point, if there is
652
+ // more voting power in favor than against, and at least 3% of the total
653
+ // voting power voted in favor, then the proposal is approved. Otherwise, it
654
+ // is rejected.
655
+ //
656
+ // If a neuron regularly refreshes its voting power, this has the same value
657
+ // as potential_voting_power. Actions that cause a refresh are as follows:
658
+ //
659
+ // 1. voting directly (not via following)
660
+ // 2. set following
661
+ // 3. refresh voting power
662
+ //
663
+ // (All of these actions are performed via the manage_neuron method.)
664
+ //
665
+ // However, if a neuron has not refreshed in a "long" time, this will be less
666
+ // than potential voting power. See VotingPowerEconomics. As a further result
667
+ // of less deciding voting power, not only does it have less influence on the
668
+ // outcome of proposals, the neuron receives less voting rewards (when it
669
+ // votes indirectly via following).
670
+ //
671
+ // For details, see https://dashboard.internetcomputer.org/proposal/132411.
672
+ //
673
+ // Per NNS policy, this is opt. Nevertheless, it will never be null.
674
+ deciding_voting_power : opt nat64;
675
+
676
+ // The amount of "sway" this neuron can have if it refreshes its voting power
677
+ // frequently enough.
678
+ //
679
+ // Unlike deciding_voting_power, this does NOT take refreshing into account.
680
+ // Rather, this only takes three factors into account:
681
+ //
682
+ // 1. (Net) staked amount - This is the "base" of a neuron's voting power.
683
+ // This primarily consists of the neuron's ICP balance.
684
+ //
685
+ // 2. Age - Neurons with more age have more voting power (all else being
686
+ // equal).
687
+ //
688
+ // 3. Dissolve delay - Neurons with longer dissolve delay have more voting
689
+ // power (all else being equal). Neurons with a dissolve delay of less
690
+ // than six months are not eligible to vote. Therefore, such neurons
691
+ // are considered to have 0 voting power.
692
+ //
693
+ // Per NNS policy, this is opt. Nevertheless, it will never be null.
694
+ potential_voting_power : opt nat64;
582
695
  };
583
696
 
584
697
  type NeuronBasketConstructionParameters = record {
@@ -617,6 +730,7 @@ type NeuronInFlightCommand = record {
617
730
  timestamp : nat64;
618
731
  };
619
732
 
733
+ // In general, this is a subset of Neuron.
620
734
  type NeuronInfo = record {
621
735
  dissolve_delay_seconds : nat64;
622
736
  recent_ballots : vec BallotInfo;
@@ -628,9 +742,19 @@ type NeuronInfo = record {
628
742
  retrieved_at_timestamp_seconds : nat64;
629
743
  visibility : opt int32;
630
744
  known_neuron_data : opt KnownNeuronData;
631
- voting_power : nat64;
632
745
  age_seconds : nat64;
746
+
747
+ // Deprecated. Use either deciding_voting_power or potential_voting_power
748
+ // instead. Has the same value as deciding_voting_power.
749
+ //
750
+ // Previously, if a neuron had < 6 months dissolve delay (making it ineligible
751
+ // to vote), this would not get set to 0 (zero). That was pretty confusing.
752
+ // Now that this is set to deciding_voting_power, this actually does get
753
+ // zeroed out.
754
+ voting_power : nat64;
633
755
  voting_power_refreshed_timestamp_seconds : opt nat64;
756
+ deciding_voting_power : opt nat64;
757
+ potential_voting_power : opt nat64;
634
758
  };
635
759
 
636
760
  type NeuronStakeTransfer = record {
@@ -22,6 +22,7 @@ export const idlFactory = ({ IDL }) => {
22
22
  'topic' : IDL.Int32,
23
23
  'followees' : IDL.Vec(NeuronId),
24
24
  });
25
+ const RefreshVotingPower = IDL.Record({});
25
26
  const ClaimOrRefreshNeuronFromAccount = IDL.Record({
26
27
  'controller' : IDL.Opt(IDL.Principal),
27
28
  'memo' : IDL.Nat64,
@@ -86,6 +87,7 @@ export const idlFactory = ({ IDL }) => {
86
87
  'Spawn' : Spawn,
87
88
  'Split' : Split,
88
89
  'Follow' : Follow,
90
+ 'RefreshVotingPower' : RefreshVotingPower,
89
91
  'ClaimOrRefresh' : ClaimOrRefresh,
90
92
  'Configure' : Configure,
91
93
  'RegisterVote' : RegisterVote,
@@ -274,6 +276,10 @@ export const idlFactory = ({ IDL }) => {
274
276
  'use_registry_derived_rewards' : IDL.Opt(IDL.Bool),
275
277
  'rewards' : IDL.Vec(RewardNodeProvider),
276
278
  });
279
+ const VotingPowerEconomics = IDL.Record({
280
+ 'start_reducing_voting_power_after_seconds' : IDL.Opt(IDL.Nat64),
281
+ 'clear_following_after_seconds' : IDL.Opt(IDL.Nat64),
282
+ });
277
283
  const Decimal = IDL.Record({ 'human_readable' : IDL.Opt(IDL.Text) });
278
284
  const NeuronsFundMatchedFundingCurveCoefficients = IDL.Record({
279
285
  'contribution_threshold_xdr' : IDL.Opt(Decimal),
@@ -290,6 +296,7 @@ export const idlFactory = ({ IDL }) => {
290
296
  });
291
297
  const NetworkEconomics = IDL.Record({
292
298
  'neuron_minimum_stake_e8s' : IDL.Nat64,
299
+ 'voting_power_economics' : IDL.Opt(VotingPowerEconomics),
293
300
  'max_proposals_to_keep_per_topic' : IDL.Nat32,
294
301
  'neuron_management_fee_per_proposal_e8s' : IDL.Nat64,
295
302
  'reject_cost_e8s' : IDL.Nat64,
@@ -602,9 +609,11 @@ export const idlFactory = ({ IDL }) => {
602
609
  'recent_ballots' : IDL.Vec(BallotInfo),
603
610
  'voting_power_refreshed_timestamp_seconds' : IDL.Opt(IDL.Nat64),
604
611
  'kyc_verified' : IDL.Bool,
612
+ 'potential_voting_power' : IDL.Opt(IDL.Nat64),
605
613
  'neuron_type' : IDL.Opt(IDL.Int32),
606
614
  'not_for_profit' : IDL.Bool,
607
615
  'maturity_e8s_equivalent' : IDL.Nat64,
616
+ 'deciding_voting_power' : IDL.Opt(IDL.Nat64),
608
617
  'cached_neuron_stake_e8s' : IDL.Nat64,
609
618
  'created_timestamp_seconds' : IDL.Nat64,
610
619
  'auto_stake_maturity' : IDL.Opt(IDL.Bool),
@@ -669,7 +678,9 @@ export const idlFactory = ({ IDL }) => {
669
678
  'dissolve_delay_seconds' : IDL.Nat64,
670
679
  'recent_ballots' : IDL.Vec(BallotInfo),
671
680
  'voting_power_refreshed_timestamp_seconds' : IDL.Opt(IDL.Nat64),
681
+ 'potential_voting_power' : IDL.Opt(IDL.Nat64),
672
682
  'neuron_type' : IDL.Opt(IDL.Int32),
683
+ 'deciding_voting_power' : IDL.Opt(IDL.Nat64),
673
684
  'created_timestamp_seconds' : IDL.Nat64,
674
685
  'state' : IDL.Int32,
675
686
  'stake_e8s' : IDL.Nat64,
@@ -790,6 +801,7 @@ export const idlFactory = ({ IDL }) => {
790
801
  'Spawn' : Spawn,
791
802
  'Split' : Split,
792
803
  'Follow' : Follow,
804
+ 'RefreshVotingPower' : RefreshVotingPower,
793
805
  'ClaimOrRefresh' : ClaimOrRefresh,
794
806
  'Configure' : Configure,
795
807
  'RegisterVote' : RegisterVote,
@@ -808,6 +820,7 @@ export const idlFactory = ({ IDL }) => {
808
820
  })
809
821
  );
810
822
  const SpawnResponse = IDL.Record({ 'created_neuron_id' : IDL.Opt(NeuronId) });
823
+ const RefreshVotingPowerResponse = IDL.Record({});
811
824
  const ClaimOrRefreshResponse = IDL.Record({
812
825
  'refreshed_neuron_id' : IDL.Opt(NeuronId),
813
826
  });
@@ -835,6 +848,7 @@ export const idlFactory = ({ IDL }) => {
835
848
  'Spawn' : SpawnResponse,
836
849
  'Split' : SpawnResponse,
837
850
  'Follow' : IDL.Record({}),
851
+ 'RefreshVotingPower' : RefreshVotingPowerResponse,
838
852
  'ClaimOrRefresh' : ClaimOrRefreshResponse,
839
853
  'Configure' : IDL.Record({}),
840
854
  'RegisterVote' : IDL.Record({}),
@@ -1007,6 +1021,7 @@ export const init = ({ IDL }) => {
1007
1021
  'topic' : IDL.Int32,
1008
1022
  'followees' : IDL.Vec(NeuronId),
1009
1023
  });
1024
+ const RefreshVotingPower = IDL.Record({});
1010
1025
  const ClaimOrRefreshNeuronFromAccount = IDL.Record({
1011
1026
  'controller' : IDL.Opt(IDL.Principal),
1012
1027
  'memo' : IDL.Nat64,
@@ -1071,6 +1086,7 @@ export const init = ({ IDL }) => {
1071
1086
  'Spawn' : Spawn,
1072
1087
  'Split' : Split,
1073
1088
  'Follow' : Follow,
1089
+ 'RefreshVotingPower' : RefreshVotingPower,
1074
1090
  'ClaimOrRefresh' : ClaimOrRefresh,
1075
1091
  'Configure' : Configure,
1076
1092
  'RegisterVote' : RegisterVote,
@@ -1259,6 +1275,10 @@ export const init = ({ IDL }) => {
1259
1275
  'use_registry_derived_rewards' : IDL.Opt(IDL.Bool),
1260
1276
  'rewards' : IDL.Vec(RewardNodeProvider),
1261
1277
  });
1278
+ const VotingPowerEconomics = IDL.Record({
1279
+ 'start_reducing_voting_power_after_seconds' : IDL.Opt(IDL.Nat64),
1280
+ 'clear_following_after_seconds' : IDL.Opt(IDL.Nat64),
1281
+ });
1262
1282
  const Decimal = IDL.Record({ 'human_readable' : IDL.Opt(IDL.Text) });
1263
1283
  const NeuronsFundMatchedFundingCurveCoefficients = IDL.Record({
1264
1284
  'contribution_threshold_xdr' : IDL.Opt(Decimal),
@@ -1275,6 +1295,7 @@ export const init = ({ IDL }) => {
1275
1295
  });
1276
1296
  const NetworkEconomics = IDL.Record({
1277
1297
  'neuron_minimum_stake_e8s' : IDL.Nat64,
1298
+ 'voting_power_economics' : IDL.Opt(VotingPowerEconomics),
1278
1299
  'max_proposals_to_keep_per_topic' : IDL.Nat32,
1279
1300
  'neuron_management_fee_per_proposal_e8s' : IDL.Nat64,
1280
1301
  'reject_cost_e8s' : IDL.Nat64,
@@ -1587,9 +1608,11 @@ export const init = ({ IDL }) => {
1587
1608
  'recent_ballots' : IDL.Vec(BallotInfo),
1588
1609
  'voting_power_refreshed_timestamp_seconds' : IDL.Opt(IDL.Nat64),
1589
1610
  'kyc_verified' : IDL.Bool,
1611
+ 'potential_voting_power' : IDL.Opt(IDL.Nat64),
1590
1612
  'neuron_type' : IDL.Opt(IDL.Int32),
1591
1613
  'not_for_profit' : IDL.Bool,
1592
1614
  'maturity_e8s_equivalent' : IDL.Nat64,
1615
+ 'deciding_voting_power' : IDL.Opt(IDL.Nat64),
1593
1616
  'cached_neuron_stake_e8s' : IDL.Nat64,
1594
1617
  'created_timestamp_seconds' : IDL.Nat64,
1595
1618
  'auto_stake_maturity' : IDL.Opt(IDL.Bool),
@@ -22,6 +22,7 @@ export const idlFactory = ({ IDL }) => {
22
22
  'topic' : IDL.Int32,
23
23
  'followees' : IDL.Vec(NeuronId),
24
24
  });
25
+ const RefreshVotingPower = IDL.Record({});
25
26
  const ClaimOrRefreshNeuronFromAccount = IDL.Record({
26
27
  'controller' : IDL.Opt(IDL.Principal),
27
28
  'memo' : IDL.Nat64,
@@ -86,6 +87,7 @@ export const idlFactory = ({ IDL }) => {
86
87
  'Spawn' : Spawn,
87
88
  'Split' : Split,
88
89
  'Follow' : Follow,
90
+ 'RefreshVotingPower' : RefreshVotingPower,
89
91
  'ClaimOrRefresh' : ClaimOrRefresh,
90
92
  'Configure' : Configure,
91
93
  'RegisterVote' : RegisterVote,
@@ -274,6 +276,10 @@ export const idlFactory = ({ IDL }) => {
274
276
  'use_registry_derived_rewards' : IDL.Opt(IDL.Bool),
275
277
  'rewards' : IDL.Vec(RewardNodeProvider),
276
278
  });
279
+ const VotingPowerEconomics = IDL.Record({
280
+ 'start_reducing_voting_power_after_seconds' : IDL.Opt(IDL.Nat64),
281
+ 'clear_following_after_seconds' : IDL.Opt(IDL.Nat64),
282
+ });
277
283
  const Decimal = IDL.Record({ 'human_readable' : IDL.Opt(IDL.Text) });
278
284
  const NeuronsFundMatchedFundingCurveCoefficients = IDL.Record({
279
285
  'contribution_threshold_xdr' : IDL.Opt(Decimal),
@@ -290,6 +296,7 @@ export const idlFactory = ({ IDL }) => {
290
296
  });
291
297
  const NetworkEconomics = IDL.Record({
292
298
  'neuron_minimum_stake_e8s' : IDL.Nat64,
299
+ 'voting_power_economics' : IDL.Opt(VotingPowerEconomics),
293
300
  'max_proposals_to_keep_per_topic' : IDL.Nat32,
294
301
  'neuron_management_fee_per_proposal_e8s' : IDL.Nat64,
295
302
  'reject_cost_e8s' : IDL.Nat64,
@@ -602,9 +609,11 @@ export const idlFactory = ({ IDL }) => {
602
609
  'recent_ballots' : IDL.Vec(BallotInfo),
603
610
  'voting_power_refreshed_timestamp_seconds' : IDL.Opt(IDL.Nat64),
604
611
  'kyc_verified' : IDL.Bool,
612
+ 'potential_voting_power' : IDL.Opt(IDL.Nat64),
605
613
  'neuron_type' : IDL.Opt(IDL.Int32),
606
614
  'not_for_profit' : IDL.Bool,
607
615
  'maturity_e8s_equivalent' : IDL.Nat64,
616
+ 'deciding_voting_power' : IDL.Opt(IDL.Nat64),
608
617
  'cached_neuron_stake_e8s' : IDL.Nat64,
609
618
  'created_timestamp_seconds' : IDL.Nat64,
610
619
  'auto_stake_maturity' : IDL.Opt(IDL.Bool),
@@ -669,7 +678,9 @@ export const idlFactory = ({ IDL }) => {
669
678
  'dissolve_delay_seconds' : IDL.Nat64,
670
679
  'recent_ballots' : IDL.Vec(BallotInfo),
671
680
  'voting_power_refreshed_timestamp_seconds' : IDL.Opt(IDL.Nat64),
681
+ 'potential_voting_power' : IDL.Opt(IDL.Nat64),
672
682
  'neuron_type' : IDL.Opt(IDL.Int32),
683
+ 'deciding_voting_power' : IDL.Opt(IDL.Nat64),
673
684
  'created_timestamp_seconds' : IDL.Nat64,
674
685
  'state' : IDL.Int32,
675
686
  'stake_e8s' : IDL.Nat64,
@@ -790,6 +801,7 @@ export const idlFactory = ({ IDL }) => {
790
801
  'Spawn' : Spawn,
791
802
  'Split' : Split,
792
803
  'Follow' : Follow,
804
+ 'RefreshVotingPower' : RefreshVotingPower,
793
805
  'ClaimOrRefresh' : ClaimOrRefresh,
794
806
  'Configure' : Configure,
795
807
  'RegisterVote' : RegisterVote,
@@ -808,6 +820,7 @@ export const idlFactory = ({ IDL }) => {
808
820
  })
809
821
  );
810
822
  const SpawnResponse = IDL.Record({ 'created_neuron_id' : IDL.Opt(NeuronId) });
823
+ const RefreshVotingPowerResponse = IDL.Record({});
811
824
  const ClaimOrRefreshResponse = IDL.Record({
812
825
  'refreshed_neuron_id' : IDL.Opt(NeuronId),
813
826
  });
@@ -835,6 +848,7 @@ export const idlFactory = ({ IDL }) => {
835
848
  'Spawn' : SpawnResponse,
836
849
  'Split' : SpawnResponse,
837
850
  'Follow' : IDL.Record({}),
851
+ 'RefreshVotingPower' : RefreshVotingPowerResponse,
838
852
  'ClaimOrRefresh' : ClaimOrRefreshResponse,
839
853
  'Configure' : IDL.Record({}),
840
854
  'RegisterVote' : IDL.Record({}),
@@ -992,6 +1006,7 @@ export const init = ({ IDL }) => {
992
1006
  'topic' : IDL.Int32,
993
1007
  'followees' : IDL.Vec(NeuronId),
994
1008
  });
1009
+ const RefreshVotingPower = IDL.Record({});
995
1010
  const ClaimOrRefreshNeuronFromAccount = IDL.Record({
996
1011
  'controller' : IDL.Opt(IDL.Principal),
997
1012
  'memo' : IDL.Nat64,
@@ -1056,6 +1071,7 @@ export const init = ({ IDL }) => {
1056
1071
  'Spawn' : Spawn,
1057
1072
  'Split' : Split,
1058
1073
  'Follow' : Follow,
1074
+ 'RefreshVotingPower' : RefreshVotingPower,
1059
1075
  'ClaimOrRefresh' : ClaimOrRefresh,
1060
1076
  'Configure' : Configure,
1061
1077
  'RegisterVote' : RegisterVote,
@@ -1244,6 +1260,10 @@ export const init = ({ IDL }) => {
1244
1260
  'use_registry_derived_rewards' : IDL.Opt(IDL.Bool),
1245
1261
  'rewards' : IDL.Vec(RewardNodeProvider),
1246
1262
  });
1263
+ const VotingPowerEconomics = IDL.Record({
1264
+ 'start_reducing_voting_power_after_seconds' : IDL.Opt(IDL.Nat64),
1265
+ 'clear_following_after_seconds' : IDL.Opt(IDL.Nat64),
1266
+ });
1247
1267
  const Decimal = IDL.Record({ 'human_readable' : IDL.Opt(IDL.Text) });
1248
1268
  const NeuronsFundMatchedFundingCurveCoefficients = IDL.Record({
1249
1269
  'contribution_threshold_xdr' : IDL.Opt(Decimal),
@@ -1260,6 +1280,7 @@ export const init = ({ IDL }) => {
1260
1280
  });
1261
1281
  const NetworkEconomics = IDL.Record({
1262
1282
  'neuron_minimum_stake_e8s' : IDL.Nat64,
1283
+ 'voting_power_economics' : IDL.Opt(VotingPowerEconomics),
1263
1284
  'max_proposals_to_keep_per_topic' : IDL.Nat32,
1264
1285
  'neuron_management_fee_per_proposal_e8s' : IDL.Nat64,
1265
1286
  'reject_cost_e8s' : IDL.Nat64,
@@ -1572,9 +1593,11 @@ export const init = ({ IDL }) => {
1572
1593
  'recent_ballots' : IDL.Vec(BallotInfo),
1573
1594
  'voting_power_refreshed_timestamp_seconds' : IDL.Opt(IDL.Nat64),
1574
1595
  'kyc_verified' : IDL.Bool,
1596
+ 'potential_voting_power' : IDL.Opt(IDL.Nat64),
1575
1597
  'neuron_type' : IDL.Opt(IDL.Int32),
1576
1598
  'not_for_profit' : IDL.Bool,
1577
1599
  'maturity_e8s_equivalent' : IDL.Nat64,
1600
+ 'deciding_voting_power' : IDL.Opt(IDL.Nat64),
1578
1601
  'cached_neuron_stake_e8s' : IDL.Nat64,
1579
1602
  'created_timestamp_seconds' : IDL.Nat64,
1580
1603
  'auto_stake_maturity' : IDL.Opt(IDL.Bool),
@@ -91,6 +91,7 @@ export type Command =
91
91
  | { Spawn: Spawn }
92
92
  | { Split: Split }
93
93
  | { Follow: Follow }
94
+ | { RefreshVotingPower: RefreshVotingPower }
94
95
  | { ClaimOrRefresh: ClaimOrRefresh }
95
96
  | { Configure: Configure }
96
97
  | { RegisterVote: RegisterVote }
@@ -105,6 +106,7 @@ export type Command_1 =
105
106
  | { Spawn: SpawnResponse }
106
107
  | { Split: SpawnResponse }
107
108
  | { Follow: {} }
109
+ | { RefreshVotingPower: RefreshVotingPowerResponse }
108
110
  | { ClaimOrRefresh: ClaimOrRefreshResponse }
109
111
  | { Configure: {} }
110
112
  | { RegisterVote: {} }
@@ -401,6 +403,7 @@ export type ManageNeuronCommandRequest =
401
403
  | { Spawn: Spawn }
402
404
  | { Split: Split }
403
405
  | { Follow: Follow }
406
+ | { RefreshVotingPower: RefreshVotingPower }
404
407
  | { ClaimOrRefresh: ClaimOrRefresh }
405
408
  | { Configure: Configure }
406
409
  | { RegisterVote: RegisterVote }
@@ -457,6 +460,7 @@ export interface Motion {
457
460
  }
458
461
  export interface NetworkEconomics {
459
462
  neuron_minimum_stake_e8s: bigint;
463
+ voting_power_economics: [] | [VotingPowerEconomics];
460
464
  max_proposals_to_keep_per_topic: number;
461
465
  neuron_management_fee_per_proposal_e8s: bigint;
462
466
  reject_cost_e8s: bigint;
@@ -473,9 +477,11 @@ export interface Neuron {
473
477
  recent_ballots: Array<BallotInfo>;
474
478
  voting_power_refreshed_timestamp_seconds: [] | [bigint];
475
479
  kyc_verified: boolean;
480
+ potential_voting_power: [] | [bigint];
476
481
  neuron_type: [] | [number];
477
482
  not_for_profit: boolean;
478
483
  maturity_e8s_equivalent: bigint;
484
+ deciding_voting_power: [] | [bigint];
479
485
  cached_neuron_stake_e8s: bigint;
480
486
  created_timestamp_seconds: bigint;
481
487
  auto_stake_maturity: [] | [boolean];
@@ -520,7 +526,9 @@ export interface NeuronInfo {
520
526
  dissolve_delay_seconds: bigint;
521
527
  recent_ballots: Array<BallotInfo>;
522
528
  voting_power_refreshed_timestamp_seconds: [] | [bigint];
529
+ potential_voting_power: [] | [bigint];
523
530
  neuron_type: [] | [number];
531
+ deciding_voting_power: [] | [bigint];
524
532
  created_timestamp_seconds: bigint;
525
533
  state: number;
526
534
  stake_e8s: bigint;
@@ -716,6 +724,8 @@ export interface ProposalInfo {
716
724
  proposer: [] | [NeuronId];
717
725
  executed_timestamp_seconds: bigint;
718
726
  }
727
+ export type RefreshVotingPower = {};
728
+ export type RefreshVotingPowerResponse = {};
719
729
  export interface RegisterVote {
720
730
  vote: number;
721
731
  proposal: [] | [ProposalId];
@@ -881,6 +891,10 @@ export interface UpdateCanisterSettings {
881
891
  export interface UpdateNodeProvider {
882
892
  reward_account: [] | [AccountIdentifier];
883
893
  }
894
+ export interface VotingPowerEconomics {
895
+ start_reducing_voting_power_after_seconds: [] | [bigint];
896
+ clear_following_after_seconds: [] | [bigint];
897
+ }
884
898
  export interface VotingRewardParameters {
885
899
  reward_rate_transition_duration: [] | [Duration];
886
900
  initial_reward_rate: [] | [Percentage];
@@ -1,4 +1,4 @@
1
- // Generated from IC repo commit 5d20289 (2024-11-21 tags: release-2024-11-21_03-11-24.04-base-kernel) 'rs/nns/governance/canister/governance_test.did' by import-candid
1
+ // Generated from IC repo commit 0f35ac817b (2024-12-06) 'rs/nns/governance/canister/governance_test.did' by import-candid
2
2
  type AccountIdentifier = record {
3
3
  hash : blob;
4
4
  };
@@ -108,6 +108,21 @@ type ClaimOrRefreshResponse = record {
108
108
  refreshed_neuron_id : opt NeuronId;
109
109
  };
110
110
 
111
+ // This is one way for a neuron to make sure that its deciding_voting_power is
112
+ // not less than its potential_voting_power. See the description of those fields
113
+ // in Neuron.
114
+ type RefreshVotingPower = record {
115
+ // Intentionally left blank.
116
+ };
117
+
118
+ type RefreshVotingPowerResponse = record {
119
+ // Intentionally left blank.
120
+ //
121
+ // We could add information such as the value in the neuron's
122
+ // voting_power_refreshed_timestamp_second's field, but let's keep things
123
+ // minimal until we discover there is a "real need". YAGNI.
124
+ };
125
+
111
126
  type Command = variant {
112
127
  Spawn : Spawn;
113
128
  Split : Split;
@@ -121,6 +136,7 @@ type Command = variant {
121
136
  StakeMaturity : StakeMaturity;
122
137
  MergeMaturity : MergeMaturity;
123
138
  Disburse : Disburse;
139
+ RefreshVotingPower : RefreshVotingPower;
124
140
  };
125
141
 
126
142
  type Command_1 = variant {
@@ -137,6 +153,7 @@ type Command_1 = variant {
137
153
  StakeMaturity : StakeMaturityResponse;
138
154
  MergeMaturity : MergeMaturityResponse;
139
155
  Disburse : DisburseResponse;
156
+ RefreshVotingPower : RefreshVotingPowerResponse;
140
157
  };
141
158
 
142
159
  type Command_2 = variant {
@@ -488,6 +505,7 @@ type ManageNeuronCommandRequest = variant {
488
505
  StakeMaturity : StakeMaturity;
489
506
  MergeMaturity : MergeMaturity;
490
507
  Disburse : Disburse;
508
+ RefreshVotingPower : RefreshVotingPower;
491
509
  };
492
510
 
493
511
  type ManageNeuronRequest = record {
@@ -555,6 +573,32 @@ type NetworkEconomics = record {
555
573
  minimum_icp_xdr_rate : nat64;
556
574
  maximum_node_provider_rewards_e8s : nat64;
557
575
  neurons_fund_economics : opt NeuronsFundEconomics;
576
+
577
+ // Parameters that affect the voting power of neurons.
578
+ voting_power_economics : opt VotingPowerEconomics;
579
+ };
580
+
581
+ // Parameters that affect the voting power of neurons.
582
+ type VotingPowerEconomics = record {
583
+ // If a neuron has not "refreshed" its voting power after this amount of time,
584
+ // its deciding voting power starts decreasing linearly. See also
585
+ // clear_following_after_seconds.
586
+ //
587
+ // For explanation of what "refresh" means in this context, see
588
+ // https://dashboard.internetcomputer.org/proposal/132411
589
+ //
590
+ // Initially, set to 0.5 years. (The nominal length of a year is 365.25 days).
591
+ start_reducing_voting_power_after_seconds : opt nat64;
592
+
593
+ // After a neuron has experienced voting power reduction for this amount of
594
+ // time, a couple of things happen:
595
+ //
596
+ // 1. Deciding voting power reaches 0.
597
+ //
598
+ // 2. Its following on topics other than NeuronManagement are cleared.
599
+ //
600
+ // Initially, set to 1/12 years.
601
+ clear_following_after_seconds : opt nat64;
558
602
  };
559
603
 
560
604
  type Neuron = record {
@@ -581,6 +625,8 @@ type Neuron = record {
581
625
  known_neuron_data : opt KnownNeuronData;
582
626
  spawn_at_timestamp_seconds : opt nat64;
583
627
  voting_power_refreshed_timestamp_seconds : opt nat64;
628
+ deciding_voting_power : opt nat64;
629
+ potential_voting_power : opt nat64;
584
630
  };
585
631
 
586
632
  type NeuronBasketConstructionParameters = record {
@@ -630,9 +676,11 @@ type NeuronInfo = record {
630
676
  retrieved_at_timestamp_seconds : nat64;
631
677
  visibility : opt int32;
632
678
  known_neuron_data : opt KnownNeuronData;
633
- voting_power : nat64;
634
679
  age_seconds : nat64;
635
680
  voting_power_refreshed_timestamp_seconds : opt nat64;
681
+ voting_power : nat64;
682
+ deciding_voting_power : opt nat64;
683
+ potential_voting_power : opt nat64;
636
684
  };
637
685
 
638
686
  type NeuronStakeTransfer = record {