-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgovernance.did
More file actions
1267 lines (1090 loc) · 34.8 KB
/
governance.did
File metadata and controls
1267 lines (1090 loc) · 34.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
type AccountIdentifier = record {
hash : blob;
};
type Action = variant {
RegisterKnownNeuron : KnownNeuron;
ManageNeuron : ManageNeuron;
UpdateCanisterSettings : UpdateCanisterSettings;
InstallCode : InstallCode;
StopOrStartCanister : StopOrStartCanister;
CreateServiceNervousSystem : CreateServiceNervousSystem;
ExecuteNnsFunction : ExecuteNnsFunction;
RewardNodeProvider : RewardNodeProvider;
OpenSnsTokenSwap : OpenSnsTokenSwap;
SetSnsTokenSwapOpenTimeWindow : SetSnsTokenSwapOpenTimeWindow;
SetDefaultFollowees : SetDefaultFollowees;
RewardNodeProviders : RewardNodeProviders;
ManageNetworkEconomics : NetworkEconomics;
ApproveGenesisKyc : Principals;
AddOrRemoveNodeProvider : AddOrRemoveNodeProvider;
Motion : Motion;
};
type AddHotKey = record {
new_hot_key : opt principal;
};
type AddOrRemoveNodeProvider = record {
change : opt Change;
};
type Amount = record {
e8s : nat64;
};
type ApproveGenesisKyc = record {
principals : vec principal;
};
type Ballot = record {
vote : int32;
voting_power : nat64;
};
type BallotInfo = record {
vote : int32;
proposal_id : opt ProposalId;
};
type By = variant {
NeuronIdOrSubaccount : record {};
MemoAndController : ClaimOrRefreshNeuronFromAccount;
Memo : nat64;
};
type Canister = record {
id : opt principal;
};
type CanisterSettings = record {
freezing_threshold : opt nat64;
controllers : opt Controllers;
log_visibility : opt int32;
wasm_memory_limit : opt nat64;
memory_allocation : opt nat64;
compute_allocation : opt nat64;
wasm_memory_threshold : opt nat64;
};
type CanisterStatusResultV2 = record {
status : opt int32;
freezing_threshold : opt nat64;
controllers : vec principal;
memory_size : opt nat64;
cycles : opt nat64;
idle_cycles_burned_per_day : opt nat64;
module_hash : blob;
};
type CanisterSummary = record {
status : opt CanisterStatusResultV2;
canister_id : opt principal;
};
type Change = variant {
ToRemove : NodeProvider;
ToAdd : NodeProvider;
};
type ChangeAutoStakeMaturity = record {
requested_setting_for_auto_stake_maturity : bool;
};
type ClaimOrRefresh = record {
by : opt By;
};
type ClaimOrRefreshNeuronFromAccount = record {
controller : opt principal;
memo : nat64;
};
type ClaimOrRefreshNeuronFromAccountResponse = record {
result : opt Result_1;
};
type ClaimOrRefreshResponse = record {
refreshed_neuron_id : opt NeuronId;
};
// This is one way for a neuron to make sure that its deciding_voting_power is
// not less than its potential_voting_power. See the description of those fields
// in Neuron.
type RefreshVotingPower = record {
// Intentionally left blank.
};
type RefreshVotingPowerResponse = record {
// Intentionally left blank.
//
// We could add information such as the value in the neuron's
// voting_power_refreshed_timestamp_second's field, but let's keep things
// minimal until we discover there is a "real need". YAGNI.
};
// KEEP THIS IN SYNC WITH ManageNeuronCommandRequest!
type Command = variant {
Spawn : Spawn;
Split : Split;
Follow : Follow;
ClaimOrRefresh : ClaimOrRefresh;
Configure : Configure;
RegisterVote : RegisterVote;
Merge : Merge;
DisburseToNeuron : DisburseToNeuron;
MakeProposal : Proposal;
StakeMaturity : StakeMaturity;
MergeMaturity : MergeMaturity;
Disburse : Disburse;
RefreshVotingPower : RefreshVotingPower;
// KEEP THIS IN SYNC WITH ManageNeuronCommandRequest!
};
type Command_1 = variant {
Error : GovernanceError;
Spawn : SpawnResponse;
Split : SpawnResponse;
Follow : record {};
ClaimOrRefresh : ClaimOrRefreshResponse;
Configure : record {};
RegisterVote : record {};
Merge : MergeResponse;
DisburseToNeuron : SpawnResponse;
MakeProposal : MakeProposalResponse;
StakeMaturity : StakeMaturityResponse;
MergeMaturity : MergeMaturityResponse;
Disburse : DisburseResponse;
RefreshVotingPower : RefreshVotingPowerResponse;
};
type Command_2 = variant {
Spawn : NeuronId;
Split : Split;
Configure : Configure;
Merge : Merge;
DisburseToNeuron : DisburseToNeuron;
SyncCommand : record {};
ClaimOrRefreshNeuron : ClaimOrRefresh;
MergeMaturity : MergeMaturity;
Disburse : Disburse;
};
type Committed = record {
total_direct_contribution_icp_e8s : opt nat64;
total_neurons_fund_contribution_icp_e8s : opt nat64;
sns_governance_canister_id : opt principal;
};
type Committed_1 = record {
total_direct_participation_icp_e8s : opt nat64;
total_neurons_fund_participation_icp_e8s : opt nat64;
sns_governance_canister_id : opt principal;
};
type Configure = record {
operation : opt Operation;
};
type Controllers = record {
controllers : vec principal;
};
type Countries = record {
iso_codes : vec text;
};
type CreateServiceNervousSystem = record {
url : opt text;
governance_parameters : opt GovernanceParameters;
fallback_controller_principal_ids : vec principal;
logo : opt Image;
name : opt text;
ledger_parameters : opt LedgerParameters;
description : opt text;
dapp_canisters : vec Canister;
swap_parameters : opt SwapParameters;
initial_token_distribution : opt InitialTokenDistribution;
};
type DateRangeFilter = record {
start_timestamp_seconds : opt nat64;
end_timestamp_seconds : opt nat64;
};
type Decimal = record {
human_readable : opt text;
};
type DerivedProposalInformation = record {
swap_background_information : opt SwapBackgroundInformation;
};
type DeveloperDistribution = record {
developer_neurons : vec NeuronDistribution;
};
type Disburse = record {
to_account : opt AccountIdentifier;
amount : opt Amount;
};
type DisburseResponse = record {
transfer_block_height : nat64;
};
type DisburseToNeuron = record {
dissolve_delay_seconds : nat64;
kyc_verified : bool;
amount_e8s : nat64;
new_controller : opt principal;
nonce : nat64;
};
type DissolveState = variant {
DissolveDelaySeconds : nat64;
WhenDissolvedTimestampSeconds : nat64;
};
type Duration = record {
seconds : opt nat64;
};
type ExecuteNnsFunction = record {
nns_function : int32;
payload : blob;
};
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 ProposalId;
};
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;
most_recent_monthly_node_provider_rewards : opt MonthlyNodeProviderRewards;
maturity_modulation_last_updated_at_timestamp_seconds : opt nat64;
wait_for_quiet_threshold_seconds : nat64;
metrics : opt GovernanceCachedMetrics;
neuron_management_voting_period_seconds : opt nat64;
node_providers : vec NodeProvider;
cached_daily_maturity_modulation_basis_points : opt int32;
economics : opt NetworkEconomics;
restore_aging_summary : opt RestoreAgingSummary;
spawning_neurons : opt bool;
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 };
xdr_conversion_rate : opt XdrConversionRate;
in_flight_commands : vec record { nat64; NeuronInFlightCommand };
neurons : vec record { nat64; Neuron };
genesis_timestamp_seconds : nat64;
};
type GovernanceCachedMetrics = record {
total_maturity_e8s_equivalent : nat64;
not_dissolving_neurons_e8s_buckets : vec record { nat64; float64 };
dissolving_neurons_staked_maturity_e8s_equivalent_sum : nat64;
garbage_collectable_neurons_count : nat64;
dissolving_neurons_staked_maturity_e8s_equivalent_buckets : vec record {
nat64;
float64;
};
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_voting_power_non_self_authenticating_controller : opt 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;
total_staked_e8s_non_self_authenticating_controller : opt 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;
non_self_authenticating_controller_neuron_subset_metrics : opt NeuronSubsetMetrics;
public_neuron_subset_metrics : opt NeuronSubsetMetrics;
declining_voting_power_neuron_subset_metrics : opt NeuronSubsetMetrics;
fully_lost_voting_power_neuron_subset_metrics : opt NeuronSubsetMetrics;
};
type GovernanceError = record {
error_message : text;
error_type : int32;
};
type GovernanceParameters = record {
neuron_maximum_dissolve_delay_bonus : opt Percentage;
neuron_maximum_age_for_age_bonus : opt Duration;
neuron_maximum_dissolve_delay : opt Duration;
neuron_minimum_dissolve_delay_to_vote : opt Duration;
neuron_maximum_age_bonus : opt Percentage;
neuron_minimum_stake : opt Tokens;
proposal_wait_for_quiet_deadline_increase : opt Duration;
proposal_initial_voting_period : opt Duration;
proposal_rejection_fee : opt Tokens;
voting_reward_parameters : opt VotingRewardParameters;
};
type IdealMatchedParticipationFunction = record {
serialized_representation : opt text;
};
type Image = record {
base64_encoding : opt text;
};
type IncreaseDissolveDelay = record {
additional_dissolve_delay_seconds : nat32;
};
type InitialTokenDistribution = record {
treasury_distribution : opt SwapDistribution;
developer_distribution : opt DeveloperDistribution;
swap_distribution : opt SwapDistribution;
};
type InstallCode = record {
skip_stopping_before_installing : opt bool;
wasm_module_hash : opt blob;
canister_id : opt principal;
arg_hash : opt blob;
install_mode : opt int32;
};
type InstallCodeRequest = record {
arg : opt blob;
wasm_module : opt blob;
skip_stopping_before_installing : opt bool;
canister_id : opt principal;
install_mode : opt int32;
};
type KnownNeuron = record {
id : opt NeuronId;
known_neuron_data : opt KnownNeuronData;
};
type KnownNeuronData = record {
name : text;
description : opt text;
};
type LedgerParameters = record {
transaction_fee : opt Tokens;
token_symbol : opt text;
token_logo : opt Image;
token_name : opt text;
};
type ListKnownNeuronsResponse = record {
known_neurons : vec KnownNeuron;
};
type ListNeurons = record {
include_public_neurons_in_full_neurons : opt bool;
neuron_ids : vec nat64;
include_empty_neurons_readable_by_caller : opt bool;
include_neurons_readable_by_caller : bool;
};
type ListNeuronsResponse = record {
neuron_infos : vec record { nat64; NeuronInfo };
full_neurons : vec Neuron;
};
type ListNodeProviderRewardsRequest = record {
date_filter : opt DateRangeFilter;
};
type ListNodeProviderRewardsResponse = record {
rewards : vec MonthlyNodeProviderRewards;
};
type ListNodeProvidersResponse = record {
node_providers : vec NodeProvider;
};
type ListProposalInfo = record {
include_reward_status : vec int32;
omit_large_fields : opt bool;
before_proposal : opt ProposalId;
limit : nat32;
exclude_topic : vec int32;
include_all_manage_neuron_proposals : opt bool;
include_status : vec int32;
};
type ListProposalInfoResponse = record {
proposal_info : vec ProposalInfo;
};
type MakeProposalRequest = record {
url : text;
title : opt text;
action : opt ProposalActionRequest;
summary : text;
};
type MakeProposalResponse = record {
message : opt text;
proposal_id : opt ProposalId;
};
type MakingSnsProposal = record {
proposal : opt Proposal;
caller : opt principal;
proposer_id : opt NeuronId;
};
type ManageNeuron = record {
id : opt NeuronId;
command : opt Command;
neuron_id_or_subaccount : opt NeuronIdOrSubaccount;
};
// KEEP THIS IN SYNC WITH COMMAND!
type ManageNeuronCommandRequest = variant {
Spawn : Spawn;
Split : Split;
Follow : Follow;
ClaimOrRefresh : ClaimOrRefresh;
Configure : Configure;
RegisterVote : RegisterVote;
Merge : Merge;
DisburseToNeuron : DisburseToNeuron;
MakeProposal : MakeProposalRequest;
StakeMaturity : StakeMaturity;
MergeMaturity : MergeMaturity;
Disburse : Disburse;
RefreshVotingPower : RefreshVotingPower;
// KEEP THIS IN SYNC WITH COMMAND!
};
type ManageNeuronRequest = record {
id : opt NeuronId;
command : opt ManageNeuronCommandRequest;
neuron_id_or_subaccount : opt NeuronIdOrSubaccount;
};
type ManageNeuronResponse = record {
command : opt Command_1;
};
type Merge = record {
source_neuron_id : opt NeuronId;
};
type MergeMaturity = record {
percentage_to_merge : nat32;
};
type MergeMaturityResponse = record {
merged_maturity_e8s : nat64;
new_stake_e8s : nat64;
};
type MergeResponse = record {
target_neuron : opt Neuron;
source_neuron : opt Neuron;
target_neuron_info : opt NeuronInfo;
source_neuron_info : opt NeuronInfo;
};
type Migration = record {
status : opt int32;
failure_reason : opt text;
progress : opt Progress;
};
type Migrations = record {
neuron_indexes_migration : opt Migration;
copy_inactive_neurons_to_stable_memory_migration : opt Migration;
};
type MonthlyNodeProviderRewards = record {
minimum_xdr_permyriad_per_icp : opt nat64;
registry_version : opt nat64;
node_providers : vec NodeProvider;
timestamp : nat64;
rewards : vec RewardNodeProvider;
xdr_conversion_rate : opt XdrConversionRate;
maximum_node_provider_rewards_e8s : opt nat64;
};
type Motion = record {
motion_text : text;
};
type NetworkEconomics = record {
neuron_minimum_stake_e8s : nat64;
max_proposals_to_keep_per_topic : nat32;
neuron_management_fee_per_proposal_e8s : nat64;
reject_cost_e8s : nat64;
transaction_fee_e8s : nat64;
neuron_spawn_dissolve_delay_seconds : nat64;
minimum_icp_xdr_rate : nat64;
maximum_node_provider_rewards_e8s : nat64;
neurons_fund_economics : opt NeuronsFundEconomics;
// Parameters that affect the voting power of neurons.
voting_power_economics : opt VotingPowerEconomics;
};
// Parameters that affect the voting power of neurons.
type VotingPowerEconomics = record {
// If a neuron has not "refreshed" its voting power after this amount of time,
// its deciding voting power starts decreasing linearly. See also
// clear_following_after_seconds.
//
// For explanation of what "refresh" means in this context, see
// https://dashboard.internetcomputer.org/proposal/132411
//
// Initially, set to 0.5 years. (The nominal length of a year is 365.25 days).
start_reducing_voting_power_after_seconds : opt nat64;
// After a neuron has experienced voting power reduction for this amount of
// time, a couple of things happen:
//
// 1. Deciding voting power reaches 0.
//
// 2. Its following on topics other than NeuronManagement are cleared.
//
// Initially, set to 1/12 years.
clear_following_after_seconds : opt nat64;
};
type Neuron = record {
id : opt NeuronId;
staked_maturity_e8s_equivalent : opt nat64;
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;
created_timestamp_seconds : nat64;
auto_stake_maturity : opt bool;
aging_since_timestamp_seconds : nat64;
hot_keys : vec principal;
account : blob;
joined_community_fund_timestamp_seconds : opt nat64;
dissolve_state : opt DissolveState;
followees : vec record { int32; Followees };
neuron_fees_e8s : nat64;
visibility : opt int32;
transfer : opt NeuronStakeTransfer;
known_neuron_data : opt KnownNeuronData;
spawn_at_timestamp_seconds : opt nat64;
voting_power_refreshed_timestamp_seconds : opt nat64;
// The amount of "sway" this neuron has when voting on proposals.
//
// When a proposal is created, each eligible neuron gets a "blank" ballot. The
// amount of voting power in that ballot is set to the neuron's deciding
// voting power at the time of proposal creation. There are two ways that a
// proposal can become decided:
//
// 1. Early: Either more than half of the total voting power in the ballots
// votes in favor (then the proposal is approved), or at least half of the
// votal voting power in the ballots votes against (then, the proposal is
// rejected).
//
// 2. The proposal's voting deadline is reached. At that point, if there is
// more voting power in favor than against, and at least 3% of the total
// voting power voted in favor, then the proposal is approved. Otherwise, it
// is rejected.
//
// If a neuron regularly refreshes its voting power, this has the same value
// as potential_voting_power. Actions that cause a refresh are as follows:
//
// 1. voting directly (not via following)
// 2. set following
// 3. refresh voting power
//
// (All of these actions are performed via the manage_neuron method.)
//
// However, if a neuron has not refreshed in a "long" time, this will be less
// than potential voting power. See VotingPowerEconomics. As a further result
// of less deciding voting power, not only does it have less influence on the
// outcome of proposals, the neuron receives less voting rewards (when it
// votes indirectly via following).
//
// For details, see https://dashboard.internetcomputer.org/proposal/132411.
//
// Per NNS policy, this is opt. Nevertheless, it will never be null.
deciding_voting_power : opt nat64;
// The amount of "sway" this neuron can have if it refreshes its voting power
// frequently enough.
//
// Unlike deciding_voting_power, this does NOT take refreshing into account.
// Rather, this only takes three factors into account:
//
// 1. (Net) staked amount - This is the "base" of a neuron's voting power.
// This primarily consists of the neuron's ICP balance.
//
// 2. Age - Neurons with more age have more voting power (all else being
// equal).
//
// 3. Dissolve delay - Neurons with longer dissolve delay have more voting
// power (all else being equal). Neurons with a dissolve delay of less
// than six months are not eligible to vote. Therefore, such neurons
// are considered to have 0 voting power.
//
// Per NNS policy, this is opt. Nevertheless, it will never be null.
potential_voting_power : opt nat64;
};
type NeuronBasketConstructionParameters = record {
dissolve_delay_interval : opt Duration;
count : opt nat64;
};
type NeuronBasketConstructionParameters_1 = record {
dissolve_delay_interval_seconds : nat64;
count : nat64;
};
type NeuronDistribution = record {
controller : opt principal;
dissolve_delay : opt Duration;
memo : opt nat64;
vesting_period : opt Duration;
stake : opt Tokens;
};
type NeuronId = record {
id : nat64;
};
type ProposalId = record {
id : nat64;
};
type NeuronIdOrSubaccount = variant {
Subaccount : blob;
NeuronId : NeuronId;
};
type NeuronInFlightCommand = record {
command : opt Command_2;
timestamp : nat64;
};
// In general, this is a subset of Neuron.
type NeuronInfo = record {
dissolve_delay_seconds : nat64;
recent_ballots : vec BallotInfo;
neuron_type : opt int32;
created_timestamp_seconds : nat64;
state : int32;
stake_e8s : nat64;
joined_community_fund_timestamp_seconds : opt nat64;
retrieved_at_timestamp_seconds : nat64;
visibility : opt int32;
known_neuron_data : opt KnownNeuronData;
age_seconds : nat64;
// Deprecated. Use either deciding_voting_power or potential_voting_power
// instead. Has the same value as deciding_voting_power.
//
// Previously, if a neuron had < 6 months dissolve delay (making it ineligible
// to vote), this would not get set to 0 (zero). That was pretty confusing.
// Now that this is set to deciding_voting_power, this actually does get
// zeroed out.
voting_power : nat64;
voting_power_refreshed_timestamp_seconds : opt nat64;
deciding_voting_power : opt nat64;
potential_voting_power : opt nat64;
};
type NeuronStakeTransfer = record {
to_subaccount : blob;
neuron_stake_e8s : nat64;
from : opt principal;
memo : nat64;
from_subaccount : blob;
transfer_timestamp : nat64;
block_height : nat64;
};
type NeuronSubsetMetrics = record {
count : opt nat64;
total_staked_e8s : opt nat64;
total_maturity_e8s_equivalent : opt nat64;
total_staked_maturity_e8s_equivalent : opt nat64;
total_voting_power : opt nat64;
total_deciding_voting_power : opt nat64;
total_potential_voting_power : opt nat64;
count_buckets : vec record { nat64; nat64 };
staked_e8s_buckets : vec record { nat64; nat64 };
maturity_e8s_equivalent_buckets : vec record { nat64; nat64 };
staked_maturity_e8s_equivalent_buckets : vec record { nat64; nat64 };
voting_power_buckets : vec record { nat64; nat64 };
deciding_voting_power_buckets : vec record { nat64; nat64 };
potential_voting_power_buckets : vec record { nat64; 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;
neurons_fund_refunds : opt NeuronsFundSnapshot;
};
type NeuronsFundEconomics = record {
maximum_icp_xdr_rate : opt Percentage;
neurons_fund_matched_funding_curve_coefficients : opt NeuronsFundMatchedFundingCurveCoefficients;
max_theoretical_neurons_fund_participation_amount_xdr : opt Decimal;
minimum_icp_xdr_rate : opt Percentage;
};
type NeuronsFundMatchedFundingCurveCoefficients = record {
contribution_threshold_xdr : opt Decimal;
one_third_participation_milestone_xdr : opt Decimal;
full_participation_milestone_xdr : opt Decimal;
};
type NeuronsFundNeuron = record {
controller : opt principal;
hotkeys : opt Principals;
is_capped : opt bool;
nns_neuron_id : opt nat64;
amount_icp_e8s : opt nat64;
};
type NeuronsFundNeuronPortion = record {
controller : opt principal;
hotkeys : vec principal;
is_capped : opt bool;
maturity_equivalent_icp_e8s : opt nat64;
nns_neuron_id : opt NeuronId;
amount_icp_e8s : opt nat64;
};
type NeuronsFundParticipation = record {
total_maturity_equivalent_icp_e8s : opt nat64;
intended_neurons_fund_participation_icp_e8s : opt nat64;
direct_participation_icp_e8s : opt nat64;
swap_participation_limits : opt SwapParticipationLimits;
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;
};
type NodeProvider = record {
id : opt principal;
reward_account : opt AccountIdentifier;
};
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;
params : opt Params;
};
type Operation = variant {
RemoveHotKey : RemoveHotKey;
AddHotKey : AddHotKey;
ChangeAutoStakeMaturity : ChangeAutoStakeMaturity;
StopDissolving : record {};
StartDissolving : record {};
IncreaseDissolveDelay : IncreaseDissolveDelay;
SetVisibility : SetVisibility;
JoinCommunityFund : record {};
LeaveCommunityFund : record {};
SetDissolveTimestamp : SetDissolveTimestamp;
};
type Params = record {
min_participant_icp_e8s : nat64;
neuron_basket_construction_parameters : opt NeuronBasketConstructionParameters_1;
max_icp_e8s : nat64;
swap_due_timestamp_seconds : nat64;
min_participants : nat32;
sns_token_e8s : nat64;
sale_delay_seconds : opt nat64;
max_participant_icp_e8s : nat64;
min_direct_participation_icp_e8s : opt nat64;
min_icp_e8s : nat64;
max_direct_participation_icp_e8s : opt nat64;
};
type Percentage = record {
basis_points : opt nat64;
};
type Principals = record {
principals : vec principal;
};
type Progress = variant {
LastNeuronId : NeuronId;
};
type Proposal = record {
url : text;
title : opt text;
action : opt Action;
summary : text;
};
type ProposalActionRequest = variant {
RegisterKnownNeuron : KnownNeuron;
ManageNeuron : ManageNeuronRequest;
UpdateCanisterSettings : UpdateCanisterSettings;
InstallCode : InstallCodeRequest;
StopOrStartCanister : StopOrStartCanister;
CreateServiceNervousSystem : CreateServiceNervousSystem;
ExecuteNnsFunction : ExecuteNnsFunction;
RewardNodeProvider : RewardNodeProvider;
RewardNodeProviders : RewardNodeProviders;
ManageNetworkEconomics : NetworkEconomics;
ApproveGenesisKyc : Principals;
AddOrRemoveNodeProvider : AddOrRemoveNodeProvider;
Motion : Motion;
};
type ProposalData = record {
id : opt ProposalId;
failure_reason : opt GovernanceError;
ballots : vec record { nat64; Ballot };
proposal_timestamp_seconds : nat64;
reward_event_round : nat64;
failed_timestamp_seconds : nat64;
neurons_fund_data : opt NeuronsFundData;
reject_cost_e8s : nat64;
derived_proposal_information : opt DerivedProposalInformation;
latest_tally : opt Tally;
sns_token_swap_lifecycle : opt int32;
decided_timestamp_seconds : nat64;
proposal : opt Proposal;
proposer : opt NeuronId;
wait_for_quiet_state : opt WaitForQuietState;
executed_timestamp_seconds : nat64;
original_total_community_fund_maturity_e8s_equivalent : opt nat64;
total_potential_voting_power : opt nat64;
};
type ProposalInfo = record {
id : opt ProposalId;
status : int32;
topic : int32;
failure_reason : opt GovernanceError;
ballots : vec record { nat64; Ballot };
proposal_timestamp_seconds : nat64;
reward_event_round : nat64;
deadline_timestamp_seconds : opt nat64;
failed_timestamp_seconds : nat64;
reject_cost_e8s : nat64;
derived_proposal_information : opt DerivedProposalInformation;
latest_tally : opt Tally;
reward_status : int32;
decided_timestamp_seconds : nat64;
proposal : opt Proposal;
proposer : opt NeuronId;
executed_timestamp_seconds : nat64;
total_potential_voting_power : opt nat64;
};
type RegisterVote = record {
vote : int32;
proposal : opt ProposalId;
};
type RemoveHotKey = record {
hot_key_to_remove : opt principal;
};
type RestoreAgingNeuronGroup = record {
count : opt nat64;
previous_total_stake_e8s : opt nat64;
current_total_stake_e8s : opt nat64;
group_type : int32;
};
type RestoreAgingSummary = record {
groups : vec RestoreAgingNeuronGroup;
timestamp_seconds : opt nat64;
};
type Result = variant {
Ok;
Err : GovernanceError;
};
type Result_1 = variant {
Error : GovernanceError;
NeuronId : NeuronId;
};
type Result_10 = variant {