@dfinity/nns-proto 0.0.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.
@@ -0,0 +1,292 @@
1
+ syntax = "proto3";
2
+
3
+ package ic_nns_governance.pb.v1;
4
+
5
+ import "base_types.proto";
6
+ import "ledger.proto";
7
+
8
+ // All operations that modify the state of an existing neuron are
9
+ // represented by instances of `ManageNeuron`.
10
+ //
11
+ // All commands are available to the `controller` of the neuron. In
12
+ // addition, commands related to voting, i.g., [manage_neuron::Follow]
13
+ // and [manage_neuron::RegisterVote], are also available to the
14
+ // registered hot keys of the neuron.
15
+ message ManageNeuron {
16
+ option (ic_base_types.pb.v1.tui_signed_message) = true;
17
+
18
+ // This is the legacy way to specify neuron IDs that is now discouraged.
19
+ ic_base_types.pb.v1.NeuronId id = 1 [(ic_base_types.pb.v1.tui_signed_display_q2_2021) = true];
20
+
21
+ // The ID of the neuron to manage. This can either be a subaccount or a neuron ID.
22
+ oneof neuron_id_or_subaccount {
23
+ bytes subaccount = 11 [(ic_base_types.pb.v1.tui_signed_display_q2_2021) = true];
24
+ ic_base_types.pb.v1.NeuronId neuron_id = 12 [(ic_base_types.pb.v1.tui_signed_display_q2_2021) = true];
25
+ }
26
+
27
+ message IncreaseDissolveDelay {
28
+ uint32 additional_dissolve_delay_seconds = 1 [(ic_base_types.pb.v1.tui_signed_display_q2_2021) = true];
29
+ }
30
+
31
+ message StartDissolving {}
32
+ message StopDissolving {}
33
+
34
+ message AddHotKey {
35
+ ic_base_types.pb.v1.PrincipalId new_hot_key = 1 [(ic_base_types.pb.v1.tui_signed_display_q2_2021) = true];
36
+ }
37
+
38
+ message RemoveHotKey {
39
+ ic_base_types.pb.v1.PrincipalId hot_key_to_remove = 1 [(ic_base_types.pb.v1.tui_signed_display_q2_2021) = true];
40
+ }
41
+
42
+ // Commands that only configure a given neuron, but do not interact
43
+ // with the outside world. They all require the caller to be the
44
+ // controller of the neuron.
45
+ message Configure {
46
+ oneof operation {
47
+ IncreaseDissolveDelay increase_dissolve_delay = 1;
48
+ StartDissolving start_dissolving = 2;
49
+ StopDissolving stop_dissolving = 3;
50
+ AddHotKey add_hot_key = 4;
51
+ RemoveHotKey remove_hot_key = 5;
52
+ JoinCommunityFund join_community_fund = 7;
53
+ }
54
+ }
55
+
56
+ message Spawn {
57
+ ic_base_types.pb.v1.PrincipalId new_controller = 1 [(ic_base_types.pb.v1.tui_signed_display_q2_2021) = true];
58
+ optional uint64 nonce = 2;
59
+ optional uint32 percentage_to_spawn = 3;
60
+ }
61
+
62
+ message Disburse {
63
+ option (ic_base_types.pb.v1.tui_signed_message) = true;
64
+ message Amount {
65
+ option (ic_base_types.pb.v1.tui_signed_message) = true;
66
+ uint64 e8s = 1 [(ic_base_types.pb.v1.tui_signed_display_q2_2021) = true, jstype = JS_STRING];
67
+ }
68
+ Amount amount = 1 [(ic_base_types.pb.v1.tui_signed_display_q2_2021) = true];
69
+ ic_ledger.pb.v1.AccountIdentifier to_account = 2 [(ic_base_types.pb.v1.tui_signed_display_q2_2021) = true];
70
+ }
71
+
72
+ message Follow {
73
+ Topic topic = 1;
74
+ repeated ic_base_types.pb.v1.NeuronId followees = 2;
75
+ }
76
+
77
+ message RegisterVote {
78
+ ic_base_types.pb.v1.ProposalId proposal = 1;
79
+ Vote vote = 2;
80
+ }
81
+
82
+ // Merge another neuron into this neuron.
83
+ message Merge {
84
+ // The neuron to merge stake and maturity from.
85
+ ic_base_types.pb.v1.NeuronId source_neuron_id = 1;
86
+ }
87
+
88
+ message MergeMaturity {
89
+ uint32 percentage_to_merge = 1;
90
+ }
91
+
92
+ message JoinCommunityFund {}
93
+
94
+ oneof command {
95
+ Configure configure = 2;
96
+ Disburse disburse = 3;
97
+ Spawn spawn = 4;
98
+ Follow follow = 5;
99
+ RegisterVote register_vote = 7;
100
+ MergeMaturity merge_maturity = 13;
101
+ Merge merge = 14;
102
+ }
103
+ }
104
+
105
+
106
+ // The response of the ManageNeuron command
107
+ //
108
+ // There is a dedicated response type for each `ManageNeuron.command` field
109
+ message ManageNeuronResponse {
110
+ message ConfigureResponse {}
111
+
112
+ message DisburseResponse {
113
+ uint64 transfer_block_height = 1 [jstype = JS_STRING];
114
+ }
115
+
116
+ message SpawnResponse {
117
+ ic_base_types.pb.v1.NeuronId created_neuron_id = 1;
118
+ }
119
+
120
+ message MergeMaturityResponse {
121
+ uint64 merged_maturity_e8s = 1 [jstype = JS_STRING];
122
+ uint64 new_stake_e8s = 2 [jstype = JS_STRING];
123
+ }
124
+
125
+ message FollowResponse {}
126
+
127
+ message RegisterVoteResponse {}
128
+
129
+ message MergeResponse {}
130
+
131
+ oneof command {
132
+ GovernanceError error = 1;
133
+ ConfigureResponse configure = 2;
134
+ DisburseResponse disburse = 3;
135
+ SpawnResponse spawn = 4;
136
+ FollowResponse follow = 5;
137
+ RegisterVoteResponse register_vote = 7;
138
+ MergeMaturityResponse merge_maturity = 11;
139
+ MergeResponse merge = 12;
140
+ }
141
+ }
142
+
143
+ message GovernanceError {
144
+ enum ErrorType {
145
+ ERROR_TYPE_UNSPECIFIED = 0;
146
+ // The operation was successfully completed.
147
+ ERROR_TYPE_OK = 1;
148
+ // This operation is not available, e.g., not implemented.
149
+ ERROR_TYPE_UNAVAILABLE = 2;
150
+ // The caller is not authorized to perform this operation.
151
+ ERROR_TYPE_NOT_AUTHORIZED = 3;
152
+ // Some entity required for the operation (for example, a neuron) was not found.
153
+ ERROR_TYPE_NOT_FOUND = 4;
154
+ // The command was missing or invalid. This is a permanent error.
155
+ ERROR_TYPE_INVALID_COMMAND = 5;
156
+ // The neuron is dissolving or dissolved and the operation requires it to
157
+ // be not dissolving (that is, having a non-zero dissolve delay that is
158
+ // accumulating age).
159
+ ERROR_TYPE_REQUIRES_NOT_DISSOLVING = 6;
160
+ // The neuron is not dissolving or dissolved and the operation requires
161
+ // it to be dissolving (that is, having a non-zero dissolve delay with
162
+ // zero age that is not accumulating).
163
+ ERROR_TYPE_REQUIRES_DISSOLVING = 7;
164
+ // The neuron is not dissolving and not dissolved and the operation
165
+ // requires it to be dissolved (that is, having a dissolve delay of zero
166
+ // and an age of zero).
167
+ ERROR_TYPE_REQUIRES_DISSOLVED = 8;
168
+ // When adding or removing a hot key: the key to add was already
169
+ // present or the key to remove was not present or the key to add
170
+ // was invalid or adding another hot key would bring the total
171
+ // number of the maximum number of allowed hot keys per neuron.
172
+ ERROR_TYPE_HOT_KEY = 9;
173
+ // Some canister side resource is exhausted, so this operation cannot be
174
+ // performed.
175
+ ERROR_TYPE_RESOURCE_EXHAUSTED = 10;
176
+ // Some precondition for executing this method was not met (e.g. the
177
+ // neuron's desolve time is too short). There could be a change in the
178
+ // state of the system such that the operation becomes allowed (e.g. the
179
+ // owner of the neuron increases its desolve delay).
180
+ ERROR_TYPE_PRECONDITION_FAILED = 11;
181
+ // Executing this method failed for some reason external to the
182
+ // governance canister.
183
+ ERROR_TYPE_EXTERNAL = 12;
184
+ // A neuron has an ongoing ledger update and thus can't be
185
+ // changed.
186
+ ERROR_TYPE_LEDGER_UPDATE_ONGOING = 13;
187
+ // There wasn't enough funds to perform the operation.
188
+ ERROR_TYPE_INSUFFICIENT_FUNDS = 14;
189
+ // The principal provided was invalid.
190
+ ERROR_TYPE_INVALID_PRINCIPAL = 15;
191
+ // The proposal is defective in some way (e.g. title is too long). If the
192
+ // same proposal is submitted again without modification, it will be
193
+ // rejected regardless of changes in the system's state (e.g. increasing
194
+ // the neuron's desolve delay will not make the proposal acceptable).
195
+ ERROR_TYPE_INVALID_PROPOSAL = 16;
196
+ // The neuron attempted to join the community fund while already
197
+ // a member.
198
+ ERROR_TYPE_ALREADY_JOINED_COMMUNITY_FUND = 17;
199
+ }
200
+
201
+ ErrorType error_type = 1;
202
+ string error_message = 2;
203
+ }
204
+
205
+ message ListNeurons {
206
+ option (ic_base_types.pb.v1.tui_signed_message) = true;
207
+ repeated fixed64 neuron_ids = 1 [(ic_base_types.pb.v1.tui_signed_display_q2_2021) = true, jstype = JS_STRING];
208
+ bool include_neurons_readable_by_caller = 2 [(ic_base_types.pb.v1.tui_signed_display_q2_2021) = true];
209
+ }
210
+
211
+ message ListNeuronsResponse {
212
+ message NeuronMapEntry {
213
+ fixed64 key = 1 [jstype = JS_STRING];
214
+ NeuronInfo value = 2;
215
+ }
216
+
217
+ // Was originally `map<fixed64, NeuronInfo> neuron_infos = 1`
218
+ // It had to be modified to this form to annotate the key with js_type.
219
+ repeated NeuronMapEntry neuron_ids = 1;
220
+ repeated Neuron full_neurons = 2;
221
+ }
222
+
223
+ message BallotInfo {
224
+ ic_base_types.pb.v1.ProposalId proposal_id = 1;
225
+ Vote vote = 2;
226
+ }
227
+
228
+ message NeuronInfo {
229
+ uint64 retrieved_at_timestamp_seconds = 1 [jstype = JS_STRING];;
230
+ uint64 age_seconds = 3 [jstype = JS_STRING];
231
+ uint64 dissolve_delay_seconds = 4 [jstype = JS_STRING];
232
+ repeated BallotInfo recent_ballots = 5;
233
+ uint64 voting_power = 6 [jstype = JS_STRING];
234
+ uint64 created_timestamp_seconds = 7 [jstype = JS_STRING];
235
+ }
236
+
237
+ message Neuron {
238
+ ic_base_types.pb.v1.NeuronId id = 1;
239
+ bytes account = 2;
240
+ ic_base_types.pb.v1.PrincipalId controller = 3;
241
+ repeated ic_base_types.pb.v1.PrincipalId hot_keys = 4;
242
+ uint64 cached_neuron_stake_e8s = 5 [jstype = JS_STRING];
243
+ uint64 neuron_fees_e8s = 6 [jstype = JS_STRING];
244
+ uint64 created_timestamp_seconds = 7 [jstype = JS_STRING];
245
+ uint64 aging_since_timestamp_seconds = 8 [jstype = JS_STRING];
246
+ optional uint64 spawn_at_timestamp_seconds = 19 [jstype = JS_STRING];
247
+ oneof dissolve_state {
248
+ uint64 when_dissolved_timestamp_seconds = 9 [jstype = JS_STRING];
249
+ uint64 dissolve_delay_seconds = 10 [jstype = JS_STRING];
250
+ }
251
+ message Followees { repeated ic_base_types.pb.v1.NeuronId followees = 1; }
252
+ map<int32, Followees> followees = 11;
253
+ repeated BallotInfo recent_ballots = 12;
254
+ bool kyc_verified = 13;
255
+ NeuronStakeTransfer transfer = 14;
256
+ uint64 maturity_e8s_equivalent = 15 [jstype = JS_STRING];
257
+ bool not_for_profit = 16;
258
+ }
259
+
260
+ enum Vote {
261
+ VOTE_UNSPECIFIED = 0;
262
+ VOTE_YES = 1;
263
+ VOTE_NO = 2;
264
+ }
265
+
266
+ message NeuronStakeTransfer {
267
+ uint64 transfer_timestamp = 1 [jstype = JS_STRING];
268
+ ic_base_types.pb.v1.PrincipalId from = 2;
269
+ bytes from_subaccount = 3;
270
+ bytes to_subaccount = 4;
271
+ uint64 neuron_stake_e8s = 5 [jstype = JS_STRING];
272
+ uint64 block_height = 6 [jstype = JS_STRING];
273
+ uint64 memo = 7 [jstype = JS_STRING];
274
+ }
275
+
276
+ enum Topic {
277
+ TOPIC_UNSPECIFIED = 0;
278
+ TOPIC_NEURON_MANAGEMENT = 1;
279
+ TOPIC_EXCHANGE_RATE = 2;
280
+ TOPIC_NETWORK_ECONOMICS = 3;
281
+ TOPIC_GOVERNANCE = 4;
282
+ TOPIC_NODE_ADMIN = 5;
283
+ TOPIC_PARTICIPANT_MANAGEMENT = 6;
284
+ TOPIC_SUBNET_MANAGEMENT = 7;
285
+ TOPIC_NETWORK_CANISTER_MANAGEMENT = 8;
286
+ TOPIC_KYC = 9;
287
+ TOPIC_NODE_PROVIDER_REWARDS = 10;
288
+ TOPIC_SNS_DECENTRALIZATION_SALE = 11;
289
+ TOPIC_SUBNET_REPLICA_VERSION_MANAGEMENT = 12;
290
+ TOPIC_REPLICA_VERSION_MANAGEMENT = 13;
291
+ TOPIC_SNS_AND_COMMUNITY_FUND = 14;
292
+ }