-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathsnsw.did
More file actions
353 lines (297 loc) · 9.01 KB
/
Copy pathsnsw.did
File metadata and controls
353 lines (297 loc) · 9.01 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
type AddWasmRequest = record {
hash : blob;
wasm : opt SnsWasm;
skip_update_latest_version : opt bool;
};
type AddWasmResponse = record {
result : opt Result;
};
type Canister = record {
id : opt principal;
};
type Countries = record {
iso_codes : vec text;
};
type DappCanisters = record {
canisters : vec Canister;
};
type DappCanistersTransferResult = record {
restored_dapp_canisters : vec Canister;
nns_controlled_dapp_canisters : vec Canister;
sns_controlled_dapp_canisters : vec Canister;
};
type DeployNewSnsRequest = record {
sns_init_payload : opt SnsInitPayload;
};
type DeployNewSnsResponse = record {
dapp_canisters_transfer_result : opt DappCanistersTransferResult;
subnet_id : opt principal;
error : opt SnsWasmError;
canisters : opt SnsCanisterIds;
};
type DeployedSns = record {
root_canister_id : opt principal;
governance_canister_id : opt principal;
index_canister_id : opt principal;
swap_canister_id : opt principal;
ledger_canister_id : opt principal;
};
type DeveloperDistribution = record {
developer_neurons : vec NeuronDistribution;
};
type FractionalDeveloperVotingPower = record {
treasury_distribution : opt TreasuryDistribution;
developer_distribution : opt DeveloperDistribution;
swap_distribution : opt SwapDistribution;
};
type GetAllowedPrincipalsResponse = record {
allowed_principals : vec principal;
};
type GetDeployedSnsByProposalIdRequest = record {
proposal_id : nat64;
};
type GetDeployedSnsByProposalIdResponse = record {
get_deployed_sns_by_proposal_id_result : opt GetDeployedSnsByProposalIdResult;
};
type GetDeployedSnsByProposalIdResult = variant {
Error : SnsWasmError;
DeployedSns : DeployedSns;
};
type GetNextSnsVersionRequest = record {
governance_canister_id : opt principal;
current_version : opt SnsVersion;
};
type GetNextSnsVersionResponse = record {
next_version : opt SnsVersion;
};
type GetProposalIdThatAddedWasmRequest = record {
hash : blob;
};
type GetProposalIdThatAddedWasmResponse = record {
proposal_id : opt nat64;
};
type GetSnsSubnetIdsResponse = record {
sns_subnet_ids : vec principal;
};
type GetWasmMetadataRequest = record {
hash : opt blob;
};
type GetWasmMetadataResponse = record {
result : opt Result_1;
};
type GetWasmRequest = record {
hash : blob;
};
type GetWasmResponse = record {
wasm : opt SnsWasm;
};
type IdealMatchedParticipationFunction = record {
serialized_representation : opt text;
};
type InitialTokenDistribution = variant {
FractionalDeveloperVotingPower : FractionalDeveloperVotingPower;
};
type InsertUpgradePathEntriesRequest = record {
upgrade_path : vec SnsUpgrade;
sns_governance_canister_id : opt principal;
};
type InsertUpgradePathEntriesResponse = record {
error : opt SnsWasmError;
};
type LinearScalingCoefficient = record {
slope_numerator : opt nat64;
intercept_icp_e8s : opt nat64;
from_direct_participation_icp_e8s : opt nat64;
slope_denominator : opt nat64;
to_direct_participation_icp_e8s : opt nat64;
};
type ListDeployedSnsesResponse = record {
instances : vec DeployedSns;
};
type ListUpgradeStep = record {
pretty_version : opt PrettySnsVersion;
version : opt SnsVersion;
};
type ListUpgradeStepsRequest = record {
limit : nat32;
starting_at : opt SnsVersion;
sns_governance_canister_id : opt principal;
};
type ListUpgradeStepsResponse = record {
steps : vec ListUpgradeStep;
};
type MetadataSection = record {
contents : opt blob;
name : opt text;
visibility : opt text;
};
type NeuronBasketConstructionParameters = record {
dissolve_delay_interval_seconds : nat64;
count : nat64;
};
type NeuronDistribution = record {
controller : opt principal;
dissolve_delay_seconds : nat64;
memo : nat64;
stake_e8s : nat64;
vesting_period_seconds : opt nat64;
};
type NeuronsFundParticipationConstraints = record {
coefficient_intervals : vec LinearScalingCoefficient;
max_neurons_fund_participation_icp_e8s : opt nat64;
min_direct_participation_threshold_icp_e8s : opt nat64;
ideal_matched_participation_function : opt IdealMatchedParticipationFunction;
};
type Ok = record {
sections : vec MetadataSection;
};
type PrettySnsVersion = record {
archive_wasm_hash : text;
root_wasm_hash : text;
swap_wasm_hash : text;
ledger_wasm_hash : text;
governance_wasm_hash : text;
index_wasm_hash : text;
};
type Result = variant {
Error : SnsWasmError;
Hash : blob;
};
type Result_1 = variant {
Ok : Ok;
Error : SnsWasmError;
};
type SnsCanisterIds = record {
root : opt principal;
swap : opt principal;
ledger : opt principal;
index : opt principal;
governance : opt principal;
};
type SnsInitPayload = record {
url : opt text;
max_dissolve_delay_seconds : opt nat64;
max_dissolve_delay_bonus_percentage : opt nat64;
nns_proposal_id : opt nat64;
neurons_fund_participation : opt bool;
min_participant_icp_e8s : opt nat64;
neuron_basket_construction_parameters : opt NeuronBasketConstructionParameters;
fallback_controller_principal_ids : vec text;
token_symbol : opt text;
final_reward_rate_basis_points : opt nat64;
max_icp_e8s : opt nat64;
neuron_minimum_stake_e8s : opt nat64;
confirmation_text : opt text;
logo : opt text;
name : opt text;
swap_start_timestamp_seconds : opt nat64;
swap_due_timestamp_seconds : opt nat64;
initial_voting_period_seconds : opt nat64;
neuron_minimum_dissolve_delay_to_vote_seconds : opt nat64;
description : opt text;
max_neuron_age_seconds_for_age_bonus : opt nat64;
min_participants : opt nat64;
initial_reward_rate_basis_points : opt nat64;
wait_for_quiet_deadline_increase_seconds : opt nat64;
transaction_fee_e8s : opt nat64;
dapp_canisters : opt DappCanisters;
neurons_fund_participation_constraints : opt NeuronsFundParticipationConstraints;
max_age_bonus_percentage : opt nat64;
initial_token_distribution : opt InitialTokenDistribution;
reward_rate_transition_duration_seconds : opt nat64;
token_logo : opt text;
token_name : opt text;
max_participant_icp_e8s : opt nat64;
min_direct_participation_icp_e8s : opt nat64;
proposal_reject_cost_e8s : opt nat64;
restricted_countries : opt Countries;
min_icp_e8s : opt nat64;
max_direct_participation_icp_e8s : opt nat64;
custom_proposal_criticality : opt CustomProposalCriticality;
};
type CustomProposalCriticality = record {
additional_critical_native_action_ids : vec nat64;
};
type SnsUpgrade = record {
next_version : opt SnsVersion;
current_version : opt SnsVersion;
};
type SnsVersion = 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 SnsWasm = record {
wasm : blob;
proposal_id : opt nat64;
canister_type : int32;
};
type SnsWasmCanisterInitPayload = record {
allowed_principals : vec principal;
access_controls_enabled : bool;
sns_subnet_ids : vec principal;
};
type SnsWasmError = record {
message : text;
};
type SwapDistribution = record {
total_e8s : nat64;
initial_swap_amount_e8s : nat64;
};
type TreasuryDistribution = record {
total_e8s : nat64;
};
type UpdateAllowedPrincipalsRequest = record {
added_principals : vec principal;
removed_principals : vec principal;
};
type UpdateAllowedPrincipalsResponse = record {
update_allowed_principals_result : opt UpdateAllowedPrincipalsResult;
};
type UpdateAllowedPrincipalsResult = variant {
Error : SnsWasmError;
AllowedPrincipals : GetAllowedPrincipalsResponse;
};
type UpdateSnsSubnetListRequest = record {
sns_subnet_ids_to_add : vec principal;
sns_subnet_ids_to_remove : vec principal;
};
type UpdateSnsSubnetListResponse = record {
error : opt SnsWasmError;
};
service : (SnsWasmCanisterInitPayload) -> {
add_wasm : (AddWasmRequest) -> (AddWasmResponse);
deploy_new_sns : (DeployNewSnsRequest) -> (DeployNewSnsResponse);
get_allowed_principals : (record {}) -> (GetAllowedPrincipalsResponse) query;
get_deployed_sns_by_proposal_id : (GetDeployedSnsByProposalIdRequest) -> (
GetDeployedSnsByProposalIdResponse,
) query;
get_latest_sns_version_pretty : (null) -> (vec record { text; text }) query;
get_next_sns_version : (GetNextSnsVersionRequest) -> (
GetNextSnsVersionResponse,
) query;
get_proposal_id_that_added_wasm : (GetProposalIdThatAddedWasmRequest) -> (
GetProposalIdThatAddedWasmResponse,
) query;
get_sns_subnet_ids : (record {}) -> (GetSnsSubnetIdsResponse) query;
get_wasm : (GetWasmRequest) -> (GetWasmResponse) query;
get_wasm_metadata : (GetWasmMetadataRequest) -> (
GetWasmMetadataResponse,
) query;
insert_upgrade_path_entries : (InsertUpgradePathEntriesRequest) -> (
InsertUpgradePathEntriesResponse,
);
list_deployed_snses : (record {}) -> (ListDeployedSnsesResponse) query;
list_upgrade_steps : (ListUpgradeStepsRequest) -> (
ListUpgradeStepsResponse,
) query;
update_allowed_principals : (UpdateAllowedPrincipalsRequest) -> (
UpdateAllowedPrincipalsResponse,
);
update_sns_subnet_list : (UpdateSnsSubnetListRequest) -> (
UpdateSnsSubnetListResponse,
);
}