/
governance.did
486 lines (486 loc) · 16.7 KB
/
governance.did
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
type Account = record { owner : opt principal; subaccount : opt Subaccount };
type Action = variant {
ManageNervousSystemParameters : NervousSystemParameters;
AddGenericNervousSystemFunction : NervousSystemFunction;
ManageDappCanisterSettings : ManageDappCanisterSettings;
RemoveGenericNervousSystemFunction : nat64;
UpgradeSnsToNextVersion : record {};
RegisterDappCanisters : RegisterDappCanisters;
TransferSnsTreasuryFunds : TransferSnsTreasuryFunds;
UpgradeSnsControlledCanister : UpgradeSnsControlledCanister;
DeregisterDappCanisters : DeregisterDappCanisters;
MintSnsTokens : MintSnsTokens;
Unspecified : record {};
ManageSnsMetadata : ManageSnsMetadata;
ExecuteGenericNervousSystemFunction : ExecuteGenericNervousSystemFunction;
ManageLedgerParameters : ManageLedgerParameters;
Motion : Motion;
};
type ActionAuxiliary = variant {
TransferSnsTreasuryFunds : MintSnsTokensActionAuxiliary;
MintSnsTokens : MintSnsTokensActionAuxiliary;
};
type AddNeuronPermissions = record {
permissions_to_add : opt NeuronPermissionList;
principal_id : opt principal;
};
type Amount = record { e8s : nat64 };
type Ballot = record {
vote : int32;
cast_timestamp_seconds : nat64;
voting_power : nat64;
};
type By = variant {
MemoAndController : MemoAndController;
NeuronId : record {};
};
type CanisterStatusResultV2 = record {
status : CanisterStatusType;
memory_size : nat;
cycles : nat;
settings : DefiniteCanisterSettingsArgs;
idle_cycles_burned_per_day : nat;
module_hash : opt blob;
};
type CanisterStatusType = variant { stopped; stopping; running };
type ChangeAutoStakeMaturity = record {
requested_setting_for_auto_stake_maturity : bool;
};
type ClaimOrRefresh = record { by : opt By };
type ClaimOrRefreshResponse = record { refreshed_neuron_id : opt NeuronId };
type ClaimSwapNeuronsRequest = record {
neuron_parameters : vec NeuronParameters;
};
type ClaimSwapNeuronsResponse = record {
claim_swap_neurons_result : opt ClaimSwapNeuronsResult;
};
type ClaimSwapNeuronsResult = variant { Ok : ClaimedSwapNeurons; Err : int32 };
type ClaimedSwapNeurons = record { swap_neurons : vec SwapNeuron };
type Command = variant {
Split : Split;
Follow : Follow;
DisburseMaturity : DisburseMaturity;
ClaimOrRefresh : ClaimOrRefresh;
Configure : Configure;
RegisterVote : RegisterVote;
MakeProposal : Proposal;
StakeMaturity : StakeMaturity;
RemoveNeuronPermissions : RemoveNeuronPermissions;
AddNeuronPermissions : AddNeuronPermissions;
MergeMaturity : MergeMaturity;
Disburse : Disburse;
};
type Command_1 = variant {
Error : GovernanceError;
Split : SplitResponse;
Follow : record {};
DisburseMaturity : DisburseMaturityResponse;
ClaimOrRefresh : ClaimOrRefreshResponse;
Configure : record {};
RegisterVote : record {};
MakeProposal : GetProposal;
RemoveNeuronPermission : record {};
StakeMaturity : StakeMaturityResponse;
MergeMaturity : MergeMaturityResponse;
Disburse : DisburseResponse;
AddNeuronPermission : record {};
};
type Command_2 = variant {
Split : Split;
Follow : Follow;
DisburseMaturity : DisburseMaturity;
Configure : Configure;
RegisterVote : RegisterVote;
SyncCommand : record {};
MakeProposal : Proposal;
FinalizeDisburseMaturity : FinalizeDisburseMaturity;
ClaimOrRefreshNeuron : ClaimOrRefresh;
RemoveNeuronPermissions : RemoveNeuronPermissions;
AddNeuronPermissions : AddNeuronPermissions;
MergeMaturity : MergeMaturity;
Disburse : Disburse;
};
type Configure = record { operation : opt Operation };
type Decimal = record { human_readable : opt text };
type DefaultFollowees = record { followees : vec record { nat64; Followees } };
type DefiniteCanisterSettingsArgs = record {
freezing_threshold : nat;
controllers : vec principal;
memory_allocation : nat;
compute_allocation : nat;
};
type DeregisterDappCanisters = record {
canister_ids : vec principal;
new_controllers : vec principal;
};
type Disburse = record { to_account : opt Account; amount : opt Amount };
type DisburseMaturity = record {
to_account : opt Account;
percentage_to_disburse : nat32;
};
type DisburseMaturityInProgress = record {
timestamp_of_disbursement_seconds : nat64;
amount_e8s : nat64;
account_to_disburse_to : opt Account;
finalize_disbursement_timestamp_seconds : opt nat64;
};
type DisburseMaturityResponse = record {
amount_disbursed_e8s : nat64;
amount_deducted_e8s : opt nat64;
};
type DisburseResponse = record { transfer_block_height : nat64 };
type DissolveState = variant {
DissolveDelaySeconds : nat64;
WhenDissolvedTimestampSeconds : nat64;
};
type ExecuteGenericNervousSystemFunction = record {
function_id : nat64;
payload : blob;
};
type FinalizeDisburseMaturity = record {
amount_to_be_disbursed_e8s : nat64;
to_account : opt Account;
};
type Follow = record { function_id : nat64; followees : vec NeuronId };
type Followees = record { followees : vec NeuronId };
type FunctionType = variant {
NativeNervousSystemFunction : record {};
GenericNervousSystemFunction : GenericNervousSystemFunction;
};
type GenericNervousSystemFunction = record {
validator_canister_id : opt principal;
target_canister_id : opt principal;
validator_method_name : opt text;
target_method_name : opt text;
};
type GetMaturityModulationResponse = record {
maturity_modulation : opt MaturityModulation;
};
type GetMetadataResponse = record {
url : opt text;
logo : opt text;
name : opt text;
description : opt text;
};
type GetModeResponse = record { mode : opt int32 };
type GetNeuron = record { neuron_id : opt NeuronId };
type GetNeuronResponse = record { result : opt Result };
type GetProposal = record { proposal_id : opt ProposalId };
type GetProposalResponse = record { result : opt Result_1 };
type GetRunningSnsVersionResponse = record {
deployed_version : opt Version;
pending_version : opt UpgradeInProgress;
};
type GetSnsInitializationParametersResponse = record {
sns_initialization_parameters : text;
};
type Governance = record {
root_canister_id : opt principal;
id_to_nervous_system_functions : vec record { nat64; NervousSystemFunction };
metrics : opt GovernanceCachedMetrics;
maturity_modulation : opt MaturityModulation;
mode : int32;
parameters : opt NervousSystemParameters;
is_finalizing_disburse_maturity : opt bool;
deployed_version : opt Version;
sns_initialization_parameters : text;
latest_reward_event : opt RewardEvent;
pending_version : opt UpgradeInProgress;
swap_canister_id : opt principal;
ledger_canister_id : opt principal;
proposals : vec record { nat64; ProposalData };
in_flight_commands : vec record { text; NeuronInFlightCommand };
sns_metadata : opt ManageSnsMetadata;
neurons : vec record { text; Neuron };
genesis_timestamp_seconds : nat64;
};
type GovernanceCachedMetrics = record {
not_dissolving_neurons_e8s_buckets : vec record { nat64; float64 };
garbage_collectable_neurons_count : nat64;
neurons_with_invalid_stake_count : nat64;
not_dissolving_neurons_count_buckets : vec record { nat64; nat64 };
neurons_with_less_than_6_months_dissolve_delay_count : nat64;
dissolved_neurons_count : nat64;
total_staked_e8s : nat64;
total_supply_governance_tokens : nat64;
not_dissolving_neurons_count : nat64;
dissolved_neurons_e8s : nat64;
neurons_with_less_than_6_months_dissolve_delay_e8s : nat64;
dissolving_neurons_count_buckets : vec record { nat64; nat64 };
dissolving_neurons_count : nat64;
dissolving_neurons_e8s_buckets : vec record { nat64; float64 };
timestamp_seconds : nat64;
};
type GovernanceError = record { error_message : text; error_type : int32 };
type IncreaseDissolveDelay = record {
additional_dissolve_delay_seconds : nat32;
};
type ListNervousSystemFunctionsResponse = record {
reserved_ids : vec nat64;
functions : vec NervousSystemFunction;
};
type ListNeurons = record {
of_principal : opt principal;
limit : nat32;
start_page_at : opt NeuronId;
};
type ListNeuronsResponse = record { neurons : vec Neuron };
type ListProposals = record {
include_reward_status : vec int32;
before_proposal : opt ProposalId;
limit : nat32;
exclude_type : vec nat64;
include_status : vec int32;
};
type ListProposalsResponse = record {
include_ballots_by_caller : opt bool;
proposals : vec ProposalData;
};
type ManageDappCanisterSettings = record {
freezing_threshold : opt nat64;
canister_ids : vec principal;
reserved_cycles_limit : opt nat64;
log_visibility : opt int32;
wasm_memory_limit : opt nat64;
memory_allocation : opt nat64;
compute_allocation : opt nat64;
};
type ManageLedgerParameters = record {
token_symbol : opt text;
transfer_fee : opt nat64;
token_logo : opt text;
token_name : opt text;
};
type ManageNeuron = record { subaccount : blob; command : opt Command };
type ManageNeuronResponse = record { command : opt Command_1 };
type ManageSnsMetadata = record {
url : opt text;
logo : opt text;
name : opt text;
description : opt text;
};
type MaturityModulation = record {
current_basis_points : opt int32;
updated_at_timestamp_seconds : opt nat64;
};
type MemoAndController = record { controller : opt principal; memo : nat64 };
type MergeMaturity = record { percentage_to_merge : nat32 };
type MergeMaturityResponse = record {
merged_maturity_e8s : nat64;
new_stake_e8s : nat64;
};
type MintSnsTokens = record {
to_principal : opt principal;
to_subaccount : opt Subaccount;
memo : opt nat64;
amount_e8s : opt nat64;
};
type MintSnsTokensActionAuxiliary = record { valuation : opt Valuation };
type Motion = record { motion_text : text };
type NervousSystemFunction = record {
id : nat64;
name : text;
description : opt text;
function_type : opt FunctionType;
};
type NervousSystemParameters = record {
default_followees : opt DefaultFollowees;
max_dissolve_delay_seconds : opt nat64;
max_dissolve_delay_bonus_percentage : opt nat64;
max_followees_per_function : opt nat64;
neuron_claimer_permissions : opt NeuronPermissionList;
neuron_minimum_stake_e8s : opt nat64;
max_neuron_age_for_age_bonus : opt nat64;
initial_voting_period_seconds : opt nat64;
neuron_minimum_dissolve_delay_to_vote_seconds : opt nat64;
reject_cost_e8s : opt nat64;
max_proposals_to_keep_per_action : opt nat32;
wait_for_quiet_deadline_increase_seconds : opt nat64;
max_number_of_neurons : opt nat64;
transaction_fee_e8s : opt nat64;
max_number_of_proposals_with_ballots : opt nat64;
max_age_bonus_percentage : opt nat64;
neuron_grantable_permissions : opt NeuronPermissionList;
voting_rewards_parameters : opt VotingRewardsParameters;
maturity_modulation_disabled : opt bool;
max_number_of_principals_per_neuron : opt nat64;
};
type Neuron = record {
id : opt NeuronId;
staked_maturity_e8s_equivalent : opt nat64;
permissions : vec NeuronPermission;
maturity_e8s_equivalent : nat64;
cached_neuron_stake_e8s : nat64;
created_timestamp_seconds : nat64;
source_nns_neuron_id : opt nat64;
auto_stake_maturity : opt bool;
aging_since_timestamp_seconds : nat64;
dissolve_state : opt DissolveState;
voting_power_percentage_multiplier : nat64;
vesting_period_seconds : opt nat64;
disburse_maturity_in_progress : vec DisburseMaturityInProgress;
followees : vec record { nat64; Followees };
neuron_fees_e8s : nat64;
};
type NeuronId = record { id : blob };
type NeuronInFlightCommand = record {
command : opt Command_2;
timestamp : nat64;
};
type NeuronParameters = record {
controller : opt principal;
dissolve_delay_seconds : opt nat64;
source_nns_neuron_id : opt nat64;
stake_e8s : opt nat64;
followees : vec NeuronId;
hotkey : opt principal;
neuron_id : opt NeuronId;
};
type NeuronPermission = record {
"principal" : opt principal;
permission_type : vec int32;
};
type NeuronPermissionList = record { permissions : vec int32 };
type Operation = variant {
ChangeAutoStakeMaturity : ChangeAutoStakeMaturity;
StopDissolving : record {};
StartDissolving : record {};
IncreaseDissolveDelay : IncreaseDissolveDelay;
SetDissolveTimestamp : SetDissolveTimestamp;
};
type Percentage = record { basis_points : opt nat64 };
type Proposal = record {
url : text;
title : text;
action : opt Action;
summary : text;
};
type ProposalData = record {
id : opt ProposalId;
payload_text_rendering : opt text;
action : nat64;
failure_reason : opt GovernanceError;
action_auxiliary : opt ActionAuxiliary;
ballots : vec record { text; Ballot };
minimum_yes_proportion_of_total : opt Percentage;
reward_event_round : nat64;
failed_timestamp_seconds : nat64;
reward_event_end_timestamp_seconds : opt nat64;
proposal_creation_timestamp_seconds : nat64;
initial_voting_period_seconds : nat64;
reject_cost_e8s : nat64;
latest_tally : opt Tally;
wait_for_quiet_deadline_increase_seconds : nat64;
decided_timestamp_seconds : nat64;
proposal : opt Proposal;
proposer : opt NeuronId;
wait_for_quiet_state : opt WaitForQuietState;
minimum_yes_proportion_of_exercised : opt Percentage;
is_eligible_for_rewards : bool;
executed_timestamp_seconds : nat64;
};
type ProposalId = record { id : nat64 };
type RegisterDappCanisters = record { canister_ids : vec principal };
type RegisterVote = record { vote : int32; proposal : opt ProposalId };
type RemoveNeuronPermissions = record {
permissions_to_remove : opt NeuronPermissionList;
principal_id : opt principal;
};
type Result = variant { Error : GovernanceError; Neuron : Neuron };
type Result_1 = variant { Error : GovernanceError; Proposal : ProposalData };
type RewardEvent = record {
rounds_since_last_distribution : opt nat64;
actual_timestamp_seconds : nat64;
end_timestamp_seconds : opt nat64;
total_available_e8s_equivalent : opt nat64;
distributed_e8s_equivalent : nat64;
round : nat64;
settled_proposals : vec ProposalId;
};
type SetDissolveTimestamp = record { dissolve_timestamp_seconds : nat64 };
type SetMode = record { mode : int32 };
type Split = record { memo : nat64; amount_e8s : nat64 };
type SplitResponse = record { created_neuron_id : opt NeuronId };
type StakeMaturity = record { percentage_to_stake : opt nat32 };
type StakeMaturityResponse = record {
maturity_e8s : nat64;
staked_maturity_e8s : nat64;
};
type Subaccount = record { subaccount : blob };
type SwapNeuron = record { id : opt NeuronId; status : int32 };
type Tally = record {
no : nat64;
yes : nat64;
total : nat64;
timestamp_seconds : nat64;
};
type Tokens = record { e8s : opt nat64 };
type TransferSnsTreasuryFunds = record {
from_treasury : int32;
to_principal : opt principal;
to_subaccount : opt Subaccount;
memo : opt nat64;
amount_e8s : nat64;
};
type UpgradeInProgress = record {
mark_failed_at_seconds : nat64;
checking_upgrade_lock : nat64;
proposal_id : nat64;
target_version : opt Version;
};
type UpgradeSnsControlledCanister = record {
new_canister_wasm : blob;
mode : opt int32;
canister_id : opt principal;
canister_upgrade_arg : opt blob;
};
type Valuation = record {
token : opt int32;
account : opt Account;
valuation_factors : opt ValuationFactors;
timestamp_seconds : opt nat64;
};
type ValuationFactors = record {
xdrs_per_icp : opt Decimal;
icps_per_token : opt Decimal;
tokens : opt Tokens;
};
type Version = record {
archive_wasm_hash : blob;
root_wasm_hash : blob;
swap_wasm_hash : blob;
ledger_wasm_hash : blob;
governance_wasm_hash : blob;
index_wasm_hash : blob;
};
type VotingRewardsParameters = record {
final_reward_rate_basis_points : opt nat64;
initial_reward_rate_basis_points : opt nat64;
reward_rate_transition_duration_seconds : opt nat64;
round_duration_seconds : opt nat64;
};
type WaitForQuietState = record { current_deadline_timestamp_seconds : nat64 };
service : (Governance) -> {
claim_swap_neurons : (ClaimSwapNeuronsRequest) -> (ClaimSwapNeuronsResponse);
fail_stuck_upgrade_in_progress : (record {}) -> (record {});
get_build_metadata : () -> (text) query;
get_latest_reward_event : () -> (RewardEvent) query;
get_maturity_modulation : (record {}) -> (GetMaturityModulationResponse);
get_metadata : (record {}) -> (GetMetadataResponse) query;
get_mode : (record {}) -> (GetModeResponse) query;
get_nervous_system_parameters : (null) -> (NervousSystemParameters) query;
get_neuron : (GetNeuron) -> (GetNeuronResponse) query;
get_proposal : (GetProposal) -> (GetProposalResponse) query;
get_root_canister_status : (null) -> (CanisterStatusResultV2);
get_running_sns_version : (record {}) -> (GetRunningSnsVersionResponse) query;
get_sns_initialization_parameters : (record {}) -> (
GetSnsInitializationParametersResponse,
) query;
list_nervous_system_functions : () -> (
ListNervousSystemFunctionsResponse,
) query;
list_neurons : (ListNeurons) -> (ListNeuronsResponse) query;
list_proposals : (ListProposals) -> (ListProposalsResponse) query;
manage_neuron : (ManageNeuron) -> (ManageNeuronResponse);
set_mode : (SetMode) -> (record {});
}