@dfinity/nns 10.2.0 → 10.3.1

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 ff761f3619 (2025-10-03) 'rs/nns/governance/canister/governance_test.did' by import-candid
1
+ // Generated from IC repo commit 285897d (2025-10-08 tags: release-2025-10-09_03-15-base) 'packages/nns/candid/governance_test.did.tmp' by import-candid
2
2
 
3
3
  type AccountIdentifier = record {
4
4
  hash : blob;
@@ -154,6 +154,7 @@ type FolloweesForTopic = record {
154
154
  type SetFollowingResponse = record {
155
155
  };
156
156
 
157
+ // KEEP THIS IN SYNC WITH ManageNeuronCommandRequest!
157
158
  type Command = variant {
158
159
  Spawn : Spawn;
159
160
  Split : Split;
@@ -170,6 +171,8 @@ type Command = variant {
170
171
  RefreshVotingPower : RefreshVotingPower;
171
172
  DisburseMaturity : DisburseMaturity;
172
173
  SetFollowing : SetFollowing;
174
+
175
+ // KEEP THIS IN SYNC WITH ManageNeuronCommandRequest!
173
176
  };
174
177
 
175
178
  type Command_1 = variant {
@@ -461,11 +464,20 @@ type ListKnownNeuronsResponse = record {
461
464
  known_neurons : vec KnownNeuron;
462
465
  };
463
466
 
467
+ // Parameters of the list_neurons method.
464
468
  type ListNeurons = record {
465
- include_public_neurons_in_full_neurons : opt bool;
469
+ // These fields select neurons to be in the result set.
466
470
  neuron_ids : vec nat64;
467
- include_empty_neurons_readable_by_caller : opt bool;
468
471
  include_neurons_readable_by_caller : bool;
472
+
473
+ // Only has an effect when include_neurons_readable_by_caller.
474
+ include_empty_neurons_readable_by_caller : opt bool;
475
+
476
+ // When a public neuron is a member of the result set, include it in the
477
+ // full_neurons field (of ListNeuronsResponse). This does not affect which
478
+ // neurons are part of the result set.
479
+ include_public_neurons_in_full_neurons : opt bool;
480
+
469
481
  page_number: opt nat64;
470
482
  page_size: opt nat64;
471
483
  neuron_subaccounts: opt vec NeuronSubaccount;
@@ -475,9 +487,19 @@ type NeuronSubaccount = record {
475
487
  subaccount : blob;
476
488
  };
477
489
 
490
+ // Output of the list_neurons method.
478
491
  type ListNeuronsResponse = record {
492
+ // Per the NeuronInfo type, this is a redacted view of the neurons in the
493
+ // result set consisting of information that require no special privileges to
494
+ // view.
479
495
  neuron_infos : vec record { nat64; NeuronInfo };
496
+
497
+ // If the caller has the necessary special privileges (or the neuron is
498
+ // public, and the request sets include_public_neurons_in_full_neurons to
499
+ // true), then all the information about the neurons in the result set is made
500
+ // available here.
480
501
  full_neurons : vec Neuron;
502
+
481
503
  total_pages_available: opt nat64;
482
504
  };
483
505
 
@@ -519,12 +541,15 @@ type MakeProposalResponse = record {
519
541
  proposal_id : opt ProposalId;
520
542
  };
521
543
 
544
+ // Not to be confused with ManageNeuronRequest. (Yes, this is very structurally
545
+ // similar to that, but not actually exactly equivalent.)
522
546
  type ManageNeuron = record {
523
547
  id : opt NeuronId;
524
548
  command : opt Command;
525
549
  neuron_id_or_subaccount : opt NeuronIdOrSubaccount;
526
550
  };
527
551
 
552
+ // KEEP THIS IN SYNC WITH COMMAND!
528
553
  type ManageNeuronCommandRequest = variant {
529
554
  Spawn : Spawn;
530
555
  Split : Split;
@@ -541,15 +566,26 @@ type ManageNeuronCommandRequest = variant {
541
566
  RefreshVotingPower : RefreshVotingPower;
542
567
  DisburseMaturity : DisburseMaturity;
543
568
  SetFollowing : SetFollowing;
569
+
570
+ // KEEP THIS IN SYNC WITH COMMAND!
544
571
  };
545
572
 
573
+ // Parameters of the manage_neuron method.
546
574
  type ManageNeuronRequest = record {
547
- id : opt NeuronId;
548
- command : opt ManageNeuronCommandRequest;
575
+ // Which neuron to operate on.
549
576
  neuron_id_or_subaccount : opt NeuronIdOrSubaccount;
577
+
578
+ // What operation to perform on the neuron.
579
+ command : opt ManageNeuronCommandRequest;
580
+
581
+ // Deprecated. Use neuron_id_or_subaccount instead.
582
+ id : opt NeuronId;
550
583
  };
551
584
 
585
+ // Output of the manage_neuron method.
552
586
  type ManageNeuronResponse = record {
587
+ // Corresponds to the command field in ManageNeuronRequest, which determines
588
+ // what operation was performed.
553
589
  command : opt Command_1;
554
590
  };
555
591
 
@@ -573,7 +609,6 @@ type MergeResponse = record {
573
609
  source_neuron_info : opt NeuronInfo;
574
610
  };
575
611
 
576
-
577
612
  type MonthlyNodeProviderRewards = record {
578
613
  minimum_xdr_permyriad_per_icp : opt nat64;
579
614
  registry_version : opt nat64;
@@ -624,6 +659,7 @@ type VotingPowerEconomics = record {
624
659
  //
625
660
  // Initially, set to 1/12 years.
626
661
  clear_following_after_seconds : opt nat64;
662
+
627
663
  // The minimum dissolve delay a neuron must have in order to be eligible to vote.
628
664
  //
629
665
  // Neurons with a dissolve delay lower than this threshold will not have
@@ -658,8 +694,66 @@ type Neuron = record {
658
694
  known_neuron_data : opt KnownNeuronData;
659
695
  spawn_at_timestamp_seconds : opt nat64;
660
696
  voting_power_refreshed_timestamp_seconds : opt nat64;
697
+
698
+ // The amount of "sway" this neuron has when voting on proposals.
699
+ //
700
+ // When a proposal is created, each eligible neuron gets a "blank" ballot. The
701
+ // amount of voting power in that ballot is set to the neuron's deciding
702
+ // voting power at the time of proposal creation. There are two ways that a
703
+ // proposal can become decided:
704
+ //
705
+ // 1. Early: Either more than half of the total voting power in the ballots
706
+ // votes in favor (then the proposal is approved), or at least half of the
707
+ // votal voting power in the ballots votes against (then, the proposal is
708
+ // rejected).
709
+ //
710
+ // 2. The proposal's voting deadline is reached. At that point, if there is
711
+ // more voting power in favor than against, and at least 3% of the total
712
+ // voting power voted in favor, then the proposal is approved. Otherwise, it
713
+ // is rejected.
714
+ //
715
+ // If a neuron regularly refreshes its voting power, this has the same value
716
+ // as potential_voting_power. Actions that cause a refresh are as follows:
717
+ //
718
+ // 1. voting directly (not via following)
719
+ // 2. set following
720
+ // 3. refresh voting power
721
+ //
722
+ // (All of these actions are performed via the manage_neuron method.)
723
+ //
724
+ // However, if a neuron has not refreshed in a "long" time, this will be less
725
+ // than potential voting power. See VotingPowerEconomics. As a further result
726
+ // of less deciding voting power, not only does it have less influence on the
727
+ // outcome of proposals, the neuron receives less voting rewards (when it
728
+ // votes indirectly via following).
729
+ //
730
+ // For details, see https://dashboard.internetcomputer.org/proposal/132411.
731
+ //
732
+ // Per NNS policy, this is opt. Nevertheless, it will never be null.
661
733
  deciding_voting_power : opt nat64;
734
+
735
+ // The amount of "sway" this neuron can have if it refreshes its voting power
736
+ // frequently enough.
737
+ //
738
+ // Unlike deciding_voting_power, this does NOT take refreshing into account.
739
+ // Rather, this only takes three factors into account:
740
+ //
741
+ // 1. (Net) staked amount - This is the "base" of a neuron's voting power.
742
+ // This primarily consists of the neuron's ICP balance.
743
+ //
744
+ // 2. Age - Neurons with more age have more voting power (all else being
745
+ // equal).
746
+ //
747
+ // 3. Dissolve delay - Neurons with longer dissolve delay have more voting
748
+ // power (all else being equal). Neurons with a dissolve delay of less
749
+ // than six months are not eligible to vote. Therefore, such neurons
750
+ // are considered to have 0 voting power.
751
+ //
752
+ // Per NNS policy, this is opt. Nevertheless, it will never be null.
662
753
  potential_voting_power : opt nat64;
754
+
755
+ // The maturity disbursements in progress, i.e. the disbursements that are initiated but not
756
+ // finalized. The finalization happens 7 days after the disbursement is initiated.
663
757
  maturity_disbursements_in_progress : opt vec MaturityDisbursement;
664
758
  };
665
759
 
@@ -699,20 +793,42 @@ type NeuronInFlightCommand = record {
699
793
  timestamp : nat64;
700
794
  };
701
795
 
796
+ // A limit view of Neuron that allows some aspects of all neurons to be read by
797
+ // anyone (i.e. without having to be the neuron's controller nor one of its
798
+ // hotkeys).
799
+ //
800
+ // As such, the meaning of each field in this type is generally the same as the
801
+ // one of the same (or at least similar) name in Neuron.
702
802
  type NeuronInfo = record {
703
803
  dissolve_delay_seconds : nat64;
704
804
  recent_ballots : vec BallotInfo;
705
805
  neuron_type : opt int32;
706
806
  created_timestamp_seconds : nat64;
707
807
  state : int32;
808
+
809
+ // The amount of ICP (and staked maturity) locked in this neuron.
810
+ //
811
+ // This is the foundation of the neuron's voting power.
812
+ //
813
+ // cached_neuron_stake_e8s - neuron_fees_e8s + staked_maturity_e8s_equivalent
708
814
  stake_e8s : nat64;
815
+
709
816
  joined_community_fund_timestamp_seconds : opt nat64;
710
817
  retrieved_at_timestamp_seconds : nat64;
711
818
  visibility : opt int32;
712
819
  known_neuron_data : opt KnownNeuronData;
713
820
  age_seconds : nat64;
714
- voting_power_refreshed_timestamp_seconds : opt nat64;
821
+
822
+ // Deprecated. Use either deciding_voting_power or potential_voting_power
823
+ // instead. Has the same value as deciding_voting_power.
824
+ //
825
+ // Previously, if a neuron had < 6 months dissolve delay (making it ineligible
826
+ // to vote), this would not get set to 0 (zero). That was pretty confusing.
827
+ // Now that this is set to deciding_voting_power, this actually does get
828
+ // zeroed out.
715
829
  voting_power : nat64;
830
+
831
+ voting_power_refreshed_timestamp_seconds : opt nat64;
716
832
  deciding_voting_power : opt nat64;
717
833
  potential_voting_power : opt nat64;
718
834
  };
@@ -1264,6 +1380,8 @@ service : (Governance) -> {
1264
1380
  ) -> (SettleNeuronsFundParticipationResponse);
1265
1381
  simulate_manage_neuron : (ManageNeuronRequest) -> (ManageNeuronResponse);
1266
1382
  transfer_gtc_neuron : (NeuronId, NeuronId) -> (Result);
1267
- update_neuron : (Neuron) -> (opt GovernanceError);
1268
1383
  update_node_provider : (UpdateNodeProvider) -> (Result);
1384
+
1385
+ // The following are methods for feature = "test"
1386
+ update_neuron : (Neuron) -> (opt GovernanceError);
1269
1387
  }
@@ -1,4 +1,4 @@
1
- // Generated from IC repo commit ff761f3619 (2025-10-03) 'rs/nns/sns-wasm/canister/sns-wasm.did' by import-candid
1
+ // Generated from IC repo commit 285897d (2025-10-08 tags: release-2025-10-09_03-15-base) 'rs/nns/sns-wasm/canister/sns-wasm.did' by import-candid
2
2
 
3
3
  type AddWasmRequest = record {
4
4
  hash : blob;