@dfinity/nns 10.3.0 → 10.3.1-next-2025-10-15

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 c211885f7c (2025-10-09) '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 {
@@ -448,6 +451,10 @@ type KnownNeuronData = record {
448
451
  name : text;
449
452
  description : opt text;
450
453
  links : opt vec text;
454
+ // The first `opt` makes it so that the field can be renamed/deprecated in the future, and
455
+ // the second `opt` makes it so that an older client not recognizing a new variant can still
456
+ // get the rest of the `vec`.
457
+ committed_topics : opt vec opt TopicToFollow;
451
458
  };
452
459
 
453
460
  type LedgerParameters = record {
@@ -461,11 +468,20 @@ type ListKnownNeuronsResponse = record {
461
468
  known_neurons : vec KnownNeuron;
462
469
  };
463
470
 
471
+ // Parameters of the list_neurons method.
464
472
  type ListNeurons = record {
465
- include_public_neurons_in_full_neurons : opt bool;
473
+ // These fields select neurons to be in the result set.
466
474
  neuron_ids : vec nat64;
467
- include_empty_neurons_readable_by_caller : opt bool;
468
475
  include_neurons_readable_by_caller : bool;
476
+
477
+ // Only has an effect when include_neurons_readable_by_caller.
478
+ include_empty_neurons_readable_by_caller : opt bool;
479
+
480
+ // When a public neuron is a member of the result set, include it in the
481
+ // full_neurons field (of ListNeuronsResponse). This does not affect which
482
+ // neurons are part of the result set.
483
+ include_public_neurons_in_full_neurons : opt bool;
484
+
469
485
  page_number: opt nat64;
470
486
  page_size: opt nat64;
471
487
  neuron_subaccounts: opt vec NeuronSubaccount;
@@ -475,9 +491,19 @@ type NeuronSubaccount = record {
475
491
  subaccount : blob;
476
492
  };
477
493
 
494
+ // Output of the list_neurons method.
478
495
  type ListNeuronsResponse = record {
496
+ // Per the NeuronInfo type, this is a redacted view of the neurons in the
497
+ // result set consisting of information that require no special privileges to
498
+ // view.
479
499
  neuron_infos : vec record { nat64; NeuronInfo };
500
+
501
+ // If the caller has the necessary special privileges (or the neuron is
502
+ // public, and the request sets include_public_neurons_in_full_neurons to
503
+ // true), then all the information about the neurons in the result set is made
504
+ // available here.
480
505
  full_neurons : vec Neuron;
506
+
481
507
  total_pages_available: opt nat64;
482
508
  };
483
509
 
@@ -519,12 +545,15 @@ type MakeProposalResponse = record {
519
545
  proposal_id : opt ProposalId;
520
546
  };
521
547
 
548
+ // Not to be confused with ManageNeuronRequest. (Yes, this is very structurally
549
+ // similar to that, but not actually exactly equivalent.)
522
550
  type ManageNeuron = record {
523
551
  id : opt NeuronId;
524
552
  command : opt Command;
525
553
  neuron_id_or_subaccount : opt NeuronIdOrSubaccount;
526
554
  };
527
555
 
556
+ // KEEP THIS IN SYNC WITH COMMAND!
528
557
  type ManageNeuronCommandRequest = variant {
529
558
  Spawn : Spawn;
530
559
  Split : Split;
@@ -541,15 +570,26 @@ type ManageNeuronCommandRequest = variant {
541
570
  RefreshVotingPower : RefreshVotingPower;
542
571
  DisburseMaturity : DisburseMaturity;
543
572
  SetFollowing : SetFollowing;
573
+
574
+ // KEEP THIS IN SYNC WITH COMMAND!
544
575
  };
545
576
 
577
+ // Parameters of the manage_neuron method.
546
578
  type ManageNeuronRequest = record {
547
- id : opt NeuronId;
548
- command : opt ManageNeuronCommandRequest;
579
+ // Which neuron to operate on.
549
580
  neuron_id_or_subaccount : opt NeuronIdOrSubaccount;
581
+
582
+ // What operation to perform on the neuron.
583
+ command : opt ManageNeuronCommandRequest;
584
+
585
+ // Deprecated. Use neuron_id_or_subaccount instead.
586
+ id : opt NeuronId;
550
587
  };
551
588
 
589
+ // Output of the manage_neuron method.
552
590
  type ManageNeuronResponse = record {
591
+ // Corresponds to the command field in ManageNeuronRequest, which determines
592
+ // what operation was performed.
553
593
  command : opt Command_1;
554
594
  };
555
595
 
@@ -573,7 +613,6 @@ type MergeResponse = record {
573
613
  source_neuron_info : opt NeuronInfo;
574
614
  };
575
615
 
576
-
577
616
  type MonthlyNodeProviderRewards = record {
578
617
  minimum_xdr_permyriad_per_icp : opt nat64;
579
618
  registry_version : opt nat64;
@@ -624,6 +663,7 @@ type VotingPowerEconomics = record {
624
663
  //
625
664
  // Initially, set to 1/12 years.
626
665
  clear_following_after_seconds : opt nat64;
666
+
627
667
  // The minimum dissolve delay a neuron must have in order to be eligible to vote.
628
668
  //
629
669
  // Neurons with a dissolve delay lower than this threshold will not have
@@ -658,8 +698,66 @@ type Neuron = record {
658
698
  known_neuron_data : opt KnownNeuronData;
659
699
  spawn_at_timestamp_seconds : opt nat64;
660
700
  voting_power_refreshed_timestamp_seconds : opt nat64;
701
+
702
+ // The amount of "sway" this neuron has when voting on proposals.
703
+ //
704
+ // When a proposal is created, each eligible neuron gets a "blank" ballot. The
705
+ // amount of voting power in that ballot is set to the neuron's deciding
706
+ // voting power at the time of proposal creation. There are two ways that a
707
+ // proposal can become decided:
708
+ //
709
+ // 1. Early: Either more than half of the total voting power in the ballots
710
+ // votes in favor (then the proposal is approved), or at least half of the
711
+ // votal voting power in the ballots votes against (then, the proposal is
712
+ // rejected).
713
+ //
714
+ // 2. The proposal's voting deadline is reached. At that point, if there is
715
+ // more voting power in favor than against, and at least 3% of the total
716
+ // voting power voted in favor, then the proposal is approved. Otherwise, it
717
+ // is rejected.
718
+ //
719
+ // If a neuron regularly refreshes its voting power, this has the same value
720
+ // as potential_voting_power. Actions that cause a refresh are as follows:
721
+ //
722
+ // 1. voting directly (not via following)
723
+ // 2. set following
724
+ // 3. refresh voting power
725
+ //
726
+ // (All of these actions are performed via the manage_neuron method.)
727
+ //
728
+ // However, if a neuron has not refreshed in a "long" time, this will be less
729
+ // than potential voting power. See VotingPowerEconomics. As a further result
730
+ // of less deciding voting power, not only does it have less influence on the
731
+ // outcome of proposals, the neuron receives less voting rewards (when it
732
+ // votes indirectly via following).
733
+ //
734
+ // For details, see https://dashboard.internetcomputer.org/proposal/132411.
735
+ //
736
+ // Per NNS policy, this is opt. Nevertheless, it will never be null.
661
737
  deciding_voting_power : opt nat64;
738
+
739
+ // The amount of "sway" this neuron can have if it refreshes its voting power
740
+ // frequently enough.
741
+ //
742
+ // Unlike deciding_voting_power, this does NOT take refreshing into account.
743
+ // Rather, this only takes three factors into account:
744
+ //
745
+ // 1. (Net) staked amount - This is the "base" of a neuron's voting power.
746
+ // This primarily consists of the neuron's ICP balance.
747
+ //
748
+ // 2. Age - Neurons with more age have more voting power (all else being
749
+ // equal).
750
+ //
751
+ // 3. Dissolve delay - Neurons with longer dissolve delay have more voting
752
+ // power (all else being equal). Neurons with a dissolve delay of less
753
+ // than six months are not eligible to vote. Therefore, such neurons
754
+ // are considered to have 0 voting power.
755
+ //
756
+ // Per NNS policy, this is opt. Nevertheless, it will never be null.
662
757
  potential_voting_power : opt nat64;
758
+
759
+ // The maturity disbursements in progress, i.e. the disbursements that are initiated but not
760
+ // finalized. The finalization happens 7 days after the disbursement is initiated.
663
761
  maturity_disbursements_in_progress : opt vec MaturityDisbursement;
664
762
  };
665
763
 
@@ -699,20 +797,56 @@ type NeuronInFlightCommand = record {
699
797
  timestamp : nat64;
700
798
  };
701
799
 
800
+ type GetNeuronIndexRequest = record {
801
+ exclusive_start_neuron_id: opt NeuronId;
802
+ page_size: opt nat32;
803
+ };
804
+
805
+ type NeuronIndexData = record {
806
+ neurons: vec NeuronInfo;
807
+ };
808
+
809
+ type GetNeuronIndexResult = variant {
810
+ Ok : NeuronIndexData;
811
+ Err : GovernanceError;
812
+ };
813
+
814
+ // A limit view of Neuron that allows some aspects of all neurons to be read by
815
+ // anyone (i.e. without having to be the neuron's controller nor one of its
816
+ // hotkeys).
817
+ //
818
+ // As such, the meaning of each field in this type is generally the same as the
819
+ // one of the same (or at least similar) name in Neuron.
702
820
  type NeuronInfo = record {
703
821
  dissolve_delay_seconds : nat64;
704
822
  recent_ballots : vec BallotInfo;
705
823
  neuron_type : opt int32;
706
824
  created_timestamp_seconds : nat64;
707
825
  state : int32;
826
+
827
+ // The amount of ICP (and staked maturity) locked in this neuron.
828
+ //
829
+ // This is the foundation of the neuron's voting power.
830
+ //
831
+ // cached_neuron_stake_e8s - neuron_fees_e8s + staked_maturity_e8s_equivalent
708
832
  stake_e8s : nat64;
833
+
709
834
  joined_community_fund_timestamp_seconds : opt nat64;
710
835
  retrieved_at_timestamp_seconds : nat64;
711
836
  visibility : opt int32;
712
837
  known_neuron_data : opt KnownNeuronData;
713
838
  age_seconds : nat64;
714
- voting_power_refreshed_timestamp_seconds : opt nat64;
839
+
840
+ // Deprecated. Use either deciding_voting_power or potential_voting_power
841
+ // instead. Has the same value as deciding_voting_power.
842
+ //
843
+ // Previously, if a neuron had < 6 months dissolve delay (making it ineligible
844
+ // to vote), this would not get set to 0 (zero). That was pretty confusing.
845
+ // Now that this is set to deciding_voting_power, this actually does get
846
+ // zeroed out.
715
847
  voting_power : nat64;
848
+
849
+ voting_power_refreshed_timestamp_seconds : opt nat64;
716
850
  deciding_voting_power : opt nat64;
717
851
  potential_voting_power : opt nat64;
718
852
  };
@@ -1219,6 +1353,31 @@ type MaturityDisbursement = record {
1219
1353
  account_identifier_to_disburse_to : opt AccountIdentifier;
1220
1354
  };
1221
1355
 
1356
+ // A topic that can be followed. It is almost the same as the topic on the
1357
+ // proposal, except that the `CatchAll` is a special value and following on this
1358
+ // `topic` will let the neuron follow the votes on all topics except for
1359
+ // Governance and SnsAndCommunityFund.
1360
+ type TopicToFollow = variant {
1361
+ CatchAll;
1362
+ NeuronManagement;
1363
+ ExchangeRate;
1364
+ NetworkEconomics;
1365
+ Governance;
1366
+ NodeAdmin;
1367
+ ParticipantManagement;
1368
+ SubnetManagement;
1369
+ Kyc;
1370
+ NodeProviderRewards;
1371
+ IcOsVersionDeployment;
1372
+ IcOsVersionElection;
1373
+ SnsAndCommunityFund;
1374
+ ApiBoundaryNodeManagement;
1375
+ SubnetRental;
1376
+ ApplicationCanisterManagement;
1377
+ ProtocolCanisterManagement;
1378
+ ServiceNervousSystemManagement;
1379
+ };
1380
+
1222
1381
  service : (Governance) -> {
1223
1382
  claim_gtc_neurons : (principal, vec NeuronId) -> (Result);
1224
1383
  claim_or_refresh_neuron_from_account : (ClaimOrRefreshNeuronFromAccount) -> (
@@ -1237,6 +1396,7 @@ service : (Governance) -> {
1237
1396
  ) query;
1238
1397
  get_network_economics_parameters : () -> (NetworkEconomics) query;
1239
1398
  get_neuron_ids : () -> (vec nat64) query;
1399
+ get_neuron_index: (GetNeuronIndexRequest) -> (GetNeuronIndexResult) query;
1240
1400
  get_neuron_info : (nat64) -> (Result_5) query;
1241
1401
  get_neuron_info_by_id_or_subaccount : (NeuronIdOrSubaccount) -> (
1242
1402
  Result_5,
@@ -1264,6 +1424,8 @@ service : (Governance) -> {
1264
1424
  ) -> (SettleNeuronsFundParticipationResponse);
1265
1425
  simulate_manage_neuron : (ManageNeuronRequest) -> (ManageNeuronResponse);
1266
1426
  transfer_gtc_neuron : (NeuronId, NeuronId) -> (Result);
1267
- update_neuron : (Neuron) -> (opt GovernanceError);
1268
1427
  update_node_provider : (UpdateNodeProvider) -> (Result);
1428
+
1429
+ // The following are methods for feature = "test"
1430
+ update_neuron : (Neuron) -> (opt GovernanceError);
1269
1431
  }
@@ -262,8 +262,29 @@ export const idlFactory = ({ IDL }) => {
262
262
  'total' : IDL.Nat64,
263
263
  'timestamp_seconds' : IDL.Nat64,
264
264
  });
265
+ const TopicToFollow = IDL.Variant({
266
+ 'Kyc' : IDL.Null,
267
+ 'ServiceNervousSystemManagement' : IDL.Null,
268
+ 'ApiBoundaryNodeManagement' : IDL.Null,
269
+ 'ApplicationCanisterManagement' : IDL.Null,
270
+ 'SubnetRental' : IDL.Null,
271
+ 'NeuronManagement' : IDL.Null,
272
+ 'NodeProviderRewards' : IDL.Null,
273
+ 'SubnetManagement' : IDL.Null,
274
+ 'ExchangeRate' : IDL.Null,
275
+ 'CatchAll' : IDL.Null,
276
+ 'NodeAdmin' : IDL.Null,
277
+ 'IcOsVersionElection' : IDL.Null,
278
+ 'ProtocolCanisterManagement' : IDL.Null,
279
+ 'NetworkEconomics' : IDL.Null,
280
+ 'IcOsVersionDeployment' : IDL.Null,
281
+ 'ParticipantManagement' : IDL.Null,
282
+ 'Governance' : IDL.Null,
283
+ 'SnsAndCommunityFund' : IDL.Null,
284
+ });
265
285
  const KnownNeuronData = IDL.Record({
266
286
  'name' : IDL.Text,
287
+ 'committed_topics' : IDL.Opt(IDL.Vec(IDL.Opt(TopicToFollow))),
267
288
  'description' : IDL.Opt(IDL.Text),
268
289
  'links' : IDL.Opt(IDL.Vec(IDL.Text)),
269
290
  });
@@ -706,6 +727,10 @@ export const idlFactory = ({ IDL }) => {
706
727
  'Ok' : MonthlyNodeProviderRewards,
707
728
  'Err' : GovernanceError,
708
729
  });
730
+ const GetNeuronIndexRequest = IDL.Record({
731
+ 'page_size' : IDL.Opt(IDL.Nat32),
732
+ 'exclusive_start_neuron_id' : IDL.Opt(NeuronId),
733
+ });
709
734
  const NeuronInfo = IDL.Record({
710
735
  'dissolve_delay_seconds' : IDL.Nat64,
711
736
  'recent_ballots' : IDL.Vec(BallotInfo),
@@ -723,6 +748,11 @@ export const idlFactory = ({ IDL }) => {
723
748
  'voting_power' : IDL.Nat64,
724
749
  'age_seconds' : IDL.Nat64,
725
750
  });
751
+ const NeuronIndexData = IDL.Record({ 'neurons' : IDL.Vec(NeuronInfo) });
752
+ const GetNeuronIndexResult = IDL.Variant({
753
+ 'Ok' : NeuronIndexData,
754
+ 'Err' : GovernanceError,
755
+ });
726
756
  const Result_5 = IDL.Variant({ 'Ok' : NeuronInfo, 'Err' : GovernanceError });
727
757
  const GetNeuronsFundAuditInfoRequest = IDL.Record({
728
758
  'nns_proposal_id' : IDL.Opt(ProposalId),
@@ -982,6 +1012,11 @@ export const idlFactory = ({ IDL }) => {
982
1012
  ['query'],
983
1013
  ),
984
1014
  'get_neuron_ids' : IDL.Func([], [IDL.Vec(IDL.Nat64)], ['query']),
1015
+ 'get_neuron_index' : IDL.Func(
1016
+ [GetNeuronIndexRequest],
1017
+ [GetNeuronIndexResult],
1018
+ ['query'],
1019
+ ),
985
1020
  'get_neuron_info' : IDL.Func([IDL.Nat64], [Result_5], ['query']),
986
1021
  'get_neuron_info_by_id_or_subaccount' : IDL.Func(
987
1022
  [NeuronIdOrSubaccount],
@@ -1309,8 +1344,29 @@ export const init = ({ IDL }) => {
1309
1344
  'total' : IDL.Nat64,
1310
1345
  'timestamp_seconds' : IDL.Nat64,
1311
1346
  });
1347
+ const TopicToFollow = IDL.Variant({
1348
+ 'Kyc' : IDL.Null,
1349
+ 'ServiceNervousSystemManagement' : IDL.Null,
1350
+ 'ApiBoundaryNodeManagement' : IDL.Null,
1351
+ 'ApplicationCanisterManagement' : IDL.Null,
1352
+ 'SubnetRental' : IDL.Null,
1353
+ 'NeuronManagement' : IDL.Null,
1354
+ 'NodeProviderRewards' : IDL.Null,
1355
+ 'SubnetManagement' : IDL.Null,
1356
+ 'ExchangeRate' : IDL.Null,
1357
+ 'CatchAll' : IDL.Null,
1358
+ 'NodeAdmin' : IDL.Null,
1359
+ 'IcOsVersionElection' : IDL.Null,
1360
+ 'ProtocolCanisterManagement' : IDL.Null,
1361
+ 'NetworkEconomics' : IDL.Null,
1362
+ 'IcOsVersionDeployment' : IDL.Null,
1363
+ 'ParticipantManagement' : IDL.Null,
1364
+ 'Governance' : IDL.Null,
1365
+ 'SnsAndCommunityFund' : IDL.Null,
1366
+ });
1312
1367
  const KnownNeuronData = IDL.Record({
1313
1368
  'name' : IDL.Text,
1369
+ 'committed_topics' : IDL.Opt(IDL.Vec(IDL.Opt(TopicToFollow))),
1314
1370
  'description' : IDL.Opt(IDL.Text),
1315
1371
  'links' : IDL.Opt(IDL.Vec(IDL.Text)),
1316
1372
  });
@@ -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 c211885f7c (2025-10-09) 'rs/nns/sns-wasm/canister/sns-wasm.did' by import-candid
2
2
 
3
3
  type AddWasmRequest = record {
4
4
  hash : blob;