@dfinity/sns 6.0.1-next-2025-12-08.1 → 6.0.1-next-2025-12-10

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.
Files changed (52) hide show
  1. package/dist/index.d.ts +54 -19
  2. package/dist/index.js +1 -6
  3. package/dist/index.js.map +4 -4
  4. package/dist/index.mjs +1 -6
  5. package/dist/index.mjs.map +4 -4
  6. package/package.json +3 -8
  7. package/dist/candid/sns_governance.certified.idl.d.ts +0 -2
  8. package/dist/candid/sns_governance.certified.idl.js +0 -1432
  9. package/dist/candid/sns_governance.d.ts +0 -933
  10. package/dist/candid/sns_governance.did +0 -1069
  11. package/dist/candid/sns_governance.idl.d.ts +0 -2
  12. package/dist/candid/sns_governance.idl.js +0 -1440
  13. package/dist/candid/sns_governance_test.certified.idl.d.ts +0 -2
  14. package/dist/candid/sns_governance_test.certified.idl.js +0 -1460
  15. package/dist/candid/sns_governance_test.d.ts +0 -962
  16. package/dist/candid/sns_governance_test.did +0 -1094
  17. package/dist/candid/sns_governance_test.idl.d.ts +0 -2
  18. package/dist/candid/sns_governance_test.idl.js +0 -1468
  19. package/dist/candid/sns_root.certified.idl.d.ts +0 -2
  20. package/dist/candid/sns_root.certified.idl.js +0 -266
  21. package/dist/candid/sns_root.d.ts +0 -225
  22. package/dist/candid/sns_root.did +0 -245
  23. package/dist/candid/sns_root.idl.d.ts +0 -2
  24. package/dist/candid/sns_root.idl.js +0 -266
  25. package/dist/candid/sns_swap.certified.idl.d.ts +0 -2
  26. package/dist/candid/sns_swap.certified.idl.js +0 -499
  27. package/dist/candid/sns_swap.d.ts +0 -438
  28. package/dist/candid/sns_swap.did +0 -505
  29. package/dist/candid/sns_swap.idl.d.ts +0 -2
  30. package/dist/candid/sns_swap.idl.js +0 -507
  31. package/dist/constants/governance.constants.d.ts +0 -8
  32. package/dist/converters/governance.converters.d.ts +0 -22
  33. package/dist/converters/swap.converters.d.ts +0 -3
  34. package/dist/enums/governance.enums.d.ts +0 -35
  35. package/dist/enums/swap.enums.d.ts +0 -22
  36. package/dist/errors/common.errors.d.ts +0 -4
  37. package/dist/errors/governance.errors.d.ts +0 -2
  38. package/dist/errors/swap.errors.d.ts +0 -16
  39. package/dist/governance.canister.d.ts +0 -138
  40. package/dist/governance_test.canister.d.ts +0 -16
  41. package/dist/root.canister.d.ts +0 -19
  42. package/dist/sns.d.ts +0 -21
  43. package/dist/sns.wrapper.d.ts +0 -160
  44. package/dist/swap.canister.d.ts +0 -47
  45. package/dist/types/actions.d.ts +0 -191
  46. package/dist/types/canister.options.d.ts +0 -5
  47. package/dist/types/common.d.ts +0 -2
  48. package/dist/types/governance.params.d.ts +0 -151
  49. package/dist/types/governance_test.params.d.ts +0 -7
  50. package/dist/types/swap.params.d.ts +0 -8
  51. package/dist/utils/error.utils.d.ts +0 -12
  52. package/dist/utils/governance.utils.d.ts +0 -14
@@ -1,507 +0,0 @@
1
- /* eslint-disable */
2
-
3
- // @ts-nocheck
4
-
5
- // This file was automatically generated by @icp-sdk/bindgen@0.2.0.
6
- // You should NOT make any changes in this file as it will be overwritten.
7
- // Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
8
-
9
- export const idlFactory = ({ IDL }) => {
10
- const NeuronBasketConstructionParameters = IDL.Record({
11
- dissolve_delay_interval_seconds: IDL.Nat64,
12
- count: IDL.Nat64,
13
- });
14
- const LinearScalingCoefficient = IDL.Record({
15
- slope_numerator: IDL.Opt(IDL.Nat64),
16
- intercept_icp_e8s: IDL.Opt(IDL.Nat64),
17
- from_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),
18
- slope_denominator: IDL.Opt(IDL.Nat64),
19
- to_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),
20
- });
21
- const IdealMatchedParticipationFunction = IDL.Record({
22
- serialized_representation: IDL.Opt(IDL.Text),
23
- });
24
- const NeuronsFundParticipationConstraints = IDL.Record({
25
- coefficient_intervals: IDL.Vec(LinearScalingCoefficient),
26
- max_neurons_fund_participation_icp_e8s: IDL.Opt(IDL.Nat64),
27
- min_direct_participation_threshold_icp_e8s: IDL.Opt(IDL.Nat64),
28
- ideal_matched_participation_function: IDL.Opt(
29
- IdealMatchedParticipationFunction,
30
- ),
31
- });
32
- const Countries = IDL.Record({ iso_codes: IDL.Vec(IDL.Text) });
33
- const Init = IDL.Record({
34
- nns_proposal_id: IDL.Opt(IDL.Nat64),
35
- sns_root_canister_id: IDL.Text,
36
- neurons_fund_participation: IDL.Opt(IDL.Bool),
37
- min_participant_icp_e8s: IDL.Opt(IDL.Nat64),
38
- neuron_basket_construction_parameters: IDL.Opt(
39
- NeuronBasketConstructionParameters,
40
- ),
41
- fallback_controller_principal_ids: IDL.Vec(IDL.Text),
42
- max_icp_e8s: IDL.Opt(IDL.Nat64),
43
- neuron_minimum_stake_e8s: IDL.Opt(IDL.Nat64),
44
- confirmation_text: IDL.Opt(IDL.Text),
45
- swap_start_timestamp_seconds: IDL.Opt(IDL.Nat64),
46
- swap_due_timestamp_seconds: IDL.Opt(IDL.Nat64),
47
- min_participants: IDL.Opt(IDL.Nat32),
48
- sns_token_e8s: IDL.Opt(IDL.Nat64),
49
- nns_governance_canister_id: IDL.Text,
50
- transaction_fee_e8s: IDL.Opt(IDL.Nat64),
51
- icp_ledger_canister_id: IDL.Text,
52
- sns_ledger_canister_id: IDL.Text,
53
- neurons_fund_participation_constraints: IDL.Opt(
54
- NeuronsFundParticipationConstraints,
55
- ),
56
- should_auto_finalize: IDL.Opt(IDL.Bool),
57
- max_participant_icp_e8s: IDL.Opt(IDL.Nat64),
58
- sns_governance_canister_id: IDL.Text,
59
- min_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),
60
- restricted_countries: IDL.Opt(Countries),
61
- min_icp_e8s: IDL.Opt(IDL.Nat64),
62
- max_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),
63
- });
64
- const ErrorRefundIcpRequest = IDL.Record({
65
- source_principal_id: IDL.Opt(IDL.Principal),
66
- });
67
- const Ok = IDL.Record({ block_height: IDL.Opt(IDL.Nat64) });
68
- const Err = IDL.Record({
69
- description: IDL.Opt(IDL.Text),
70
- error_type: IDL.Opt(IDL.Int32),
71
- });
72
- const Result = IDL.Variant({ Ok: Ok, Err: Err });
73
- const ErrorRefundIcpResponse = IDL.Record({ result: IDL.Opt(Result) });
74
- const CanisterCallError = IDL.Record({
75
- code: IDL.Opt(IDL.Int32),
76
- description: IDL.Text,
77
- });
78
- const FailedUpdate = IDL.Record({
79
- err: IDL.Opt(CanisterCallError),
80
- dapp_canister_id: IDL.Opt(IDL.Principal),
81
- });
82
- const SetDappControllersResponse = IDL.Record({
83
- failed_updates: IDL.Vec(FailedUpdate),
84
- });
85
- const Possibility = IDL.Variant({
86
- Ok: SetDappControllersResponse,
87
- Err: CanisterCallError,
88
- });
89
- const SetDappControllersCallResult = IDL.Record({
90
- possibility: IDL.Opt(Possibility),
91
- });
92
- const SweepResult = IDL.Record({
93
- failure: IDL.Nat32,
94
- skipped: IDL.Nat32,
95
- invalid: IDL.Nat32,
96
- success: IDL.Nat32,
97
- global_failures: IDL.Nat32,
98
- });
99
- const GovernanceError = IDL.Record({
100
- error_message: IDL.Text,
101
- error_type: IDL.Int32,
102
- });
103
- const Response = IDL.Record({
104
- governance_error: IDL.Opt(GovernanceError),
105
- });
106
- const Possibility_1 = IDL.Variant({
107
- Ok: Response,
108
- Err: CanisterCallError,
109
- });
110
- const SettleCommunityFundParticipationResult = IDL.Record({
111
- possibility: IDL.Opt(Possibility_1),
112
- });
113
- const Ok_1 = IDL.Record({
114
- neurons_fund_participation_icp_e8s: IDL.Opt(IDL.Nat64),
115
- neurons_fund_neurons_count: IDL.Opt(IDL.Nat64),
116
- });
117
- const Error = IDL.Record({ message: IDL.Opt(IDL.Text) });
118
- const Possibility_2 = IDL.Variant({ Ok: Ok_1, Err: Error });
119
- const SettleNeuronsFundParticipationResult = IDL.Record({
120
- possibility: IDL.Opt(Possibility_2),
121
- });
122
- const Possibility_3 = IDL.Variant({
123
- Ok: IDL.Record({}),
124
- Err: CanisterCallError,
125
- });
126
- const SetModeCallResult = IDL.Record({
127
- possibility: IDL.Opt(Possibility_3),
128
- });
129
- const FinalizeSwapResponse = IDL.Record({
130
- set_dapp_controllers_call_result: IDL.Opt(SetDappControllersCallResult),
131
- create_sns_neuron_recipes_result: IDL.Opt(SweepResult),
132
- settle_community_fund_participation_result: IDL.Opt(
133
- SettleCommunityFundParticipationResult,
134
- ),
135
- error_message: IDL.Opt(IDL.Text),
136
- settle_neurons_fund_participation_result: IDL.Opt(
137
- SettleNeuronsFundParticipationResult,
138
- ),
139
- set_mode_call_result: IDL.Opt(SetModeCallResult),
140
- sweep_icp_result: IDL.Opt(SweepResult),
141
- claim_neuron_result: IDL.Opt(SweepResult),
142
- sweep_sns_result: IDL.Opt(SweepResult),
143
- });
144
- const GetAutoFinalizationStatusResponse = IDL.Record({
145
- auto_finalize_swap_response: IDL.Opt(FinalizeSwapResponse),
146
- has_auto_finalize_been_attempted: IDL.Opt(IDL.Bool),
147
- is_auto_finalize_enabled: IDL.Opt(IDL.Bool),
148
- });
149
- const GetBuyerStateRequest = IDL.Record({
150
- principal_id: IDL.Opt(IDL.Principal),
151
- });
152
- const TransferableAmount = IDL.Record({
153
- transfer_fee_paid_e8s: IDL.Opt(IDL.Nat64),
154
- transfer_start_timestamp_seconds: IDL.Nat64,
155
- amount_e8s: IDL.Nat64,
156
- amount_transferred_e8s: IDL.Opt(IDL.Nat64),
157
- transfer_success_timestamp_seconds: IDL.Nat64,
158
- });
159
- const BuyerState = IDL.Record({
160
- icp: IDL.Opt(TransferableAmount),
161
- has_created_neuron_recipes: IDL.Opt(IDL.Bool),
162
- });
163
- const GetBuyerStateResponse = IDL.Record({
164
- buyer_state: IDL.Opt(BuyerState),
165
- });
166
- const GetBuyersTotalResponse = IDL.Record({ buyers_total: IDL.Nat64 });
167
- const MemoryMetrics = IDL.Record({
168
- wasm_binary_size: IDL.Opt(IDL.Nat),
169
- wasm_chunk_store_size: IDL.Opt(IDL.Nat),
170
- canister_history_size: IDL.Opt(IDL.Nat),
171
- stable_memory_size: IDL.Opt(IDL.Nat),
172
- snapshots_size: IDL.Opt(IDL.Nat),
173
- wasm_memory_size: IDL.Opt(IDL.Nat),
174
- global_memory_size: IDL.Opt(IDL.Nat),
175
- custom_sections_size: IDL.Opt(IDL.Nat),
176
- });
177
- const CanisterStatusType = IDL.Variant({
178
- stopped: IDL.Null,
179
- stopping: IDL.Null,
180
- running: IDL.Null,
181
- });
182
- const DefiniteCanisterSettingsArgs = IDL.Record({
183
- freezing_threshold: IDL.Nat,
184
- wasm_memory_threshold: IDL.Opt(IDL.Nat),
185
- controllers: IDL.Vec(IDL.Principal),
186
- wasm_memory_limit: IDL.Opt(IDL.Nat),
187
- memory_allocation: IDL.Nat,
188
- compute_allocation: IDL.Nat,
189
- });
190
- const QueryStats = IDL.Record({
191
- response_payload_bytes_total: IDL.Opt(IDL.Nat),
192
- num_instructions_total: IDL.Opt(IDL.Nat),
193
- num_calls_total: IDL.Opt(IDL.Nat),
194
- request_payload_bytes_total: IDL.Opt(IDL.Nat),
195
- });
196
- const CanisterStatusResultV2 = IDL.Record({
197
- memory_metrics: IDL.Opt(MemoryMetrics),
198
- status: CanisterStatusType,
199
- memory_size: IDL.Nat,
200
- cycles: IDL.Nat,
201
- settings: DefiniteCanisterSettingsArgs,
202
- query_stats: IDL.Opt(QueryStats),
203
- idle_cycles_burned_per_day: IDL.Nat,
204
- module_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),
205
- });
206
- const GetDerivedStateResponse = IDL.Record({
207
- sns_tokens_per_icp: IDL.Opt(IDL.Float64),
208
- buyer_total_icp_e8s: IDL.Opt(IDL.Nat64),
209
- cf_participant_count: IDL.Opt(IDL.Nat64),
210
- neurons_fund_participation_icp_e8s: IDL.Opt(IDL.Nat64),
211
- direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),
212
- direct_participant_count: IDL.Opt(IDL.Nat64),
213
- cf_neuron_count: IDL.Opt(IDL.Nat64),
214
- });
215
- const GetInitResponse = IDL.Record({ init: IDL.Opt(Init) });
216
- const GetLifecycleResponse = IDL.Record({
217
- decentralization_sale_open_timestamp_seconds: IDL.Opt(IDL.Nat64),
218
- lifecycle: IDL.Opt(IDL.Int32),
219
- decentralization_swap_termination_timestamp_seconds: IDL.Opt(IDL.Nat64),
220
- });
221
- const Icrc1Account = IDL.Record({
222
- owner: IDL.Opt(IDL.Principal),
223
- subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)),
224
- });
225
- const Ticket = IDL.Record({
226
- creation_time: IDL.Nat64,
227
- ticket_id: IDL.Nat64,
228
- account: IDL.Opt(Icrc1Account),
229
- amount_icp_e8s: IDL.Nat64,
230
- });
231
- const Ok_2 = IDL.Record({ ticket: IDL.Opt(Ticket) });
232
- const Err_1 = IDL.Record({ error_type: IDL.Opt(IDL.Int32) });
233
- const Result_1 = IDL.Variant({ Ok: Ok_2, Err: Err_1 });
234
- const GetOpenTicketResponse = IDL.Record({ result: IDL.Opt(Result_1) });
235
- const Params = IDL.Record({
236
- min_participant_icp_e8s: IDL.Nat64,
237
- neuron_basket_construction_parameters: IDL.Opt(
238
- NeuronBasketConstructionParameters,
239
- ),
240
- max_icp_e8s: IDL.Nat64,
241
- swap_due_timestamp_seconds: IDL.Nat64,
242
- min_participants: IDL.Nat32,
243
- sns_token_e8s: IDL.Nat64,
244
- sale_delay_seconds: IDL.Opt(IDL.Nat64),
245
- max_participant_icp_e8s: IDL.Nat64,
246
- min_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),
247
- min_icp_e8s: IDL.Nat64,
248
- max_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),
249
- });
250
- const GetSaleParametersResponse = IDL.Record({ params: IDL.Opt(Params) });
251
- const NeuronId = IDL.Record({ id: IDL.Vec(IDL.Nat8) });
252
- const NeuronAttributes = IDL.Record({
253
- dissolve_delay_seconds: IDL.Nat64,
254
- memo: IDL.Nat64,
255
- followees: IDL.Vec(NeuronId),
256
- });
257
- const Principals = IDL.Record({ principals: IDL.Vec(IDL.Principal) });
258
- const CfInvestment = IDL.Record({
259
- controller: IDL.Opt(IDL.Principal),
260
- hotkey_principal: IDL.Text,
261
- hotkeys: IDL.Opt(Principals),
262
- nns_neuron_id: IDL.Nat64,
263
- });
264
- const DirectInvestment = IDL.Record({ buyer_principal: IDL.Text });
265
- const Investor = IDL.Variant({
266
- CommunityFund: CfInvestment,
267
- Direct: DirectInvestment,
268
- });
269
- const SnsNeuronRecipe = IDL.Record({
270
- sns: IDL.Opt(TransferableAmount),
271
- claimed_status: IDL.Opt(IDL.Int32),
272
- neuron_attributes: IDL.Opt(NeuronAttributes),
273
- investor: IDL.Opt(Investor),
274
- });
275
- const Timers = IDL.Record({
276
- last_spawned_timestamp_seconds: IDL.Opt(IDL.Nat64),
277
- last_reset_timestamp_seconds: IDL.Opt(IDL.Nat64),
278
- requires_periodic_tasks: IDL.Opt(IDL.Bool),
279
- });
280
- const CfNeuron = IDL.Record({
281
- has_created_neuron_recipes: IDL.Opt(IDL.Bool),
282
- hotkeys: IDL.Opt(Principals),
283
- nns_neuron_id: IDL.Nat64,
284
- amount_icp_e8s: IDL.Nat64,
285
- });
286
- const CfParticipant = IDL.Record({
287
- controller: IDL.Opt(IDL.Principal),
288
- hotkey_principal: IDL.Text,
289
- cf_neurons: IDL.Vec(CfNeuron),
290
- });
291
- const Swap = IDL.Record({
292
- auto_finalize_swap_response: IDL.Opt(FinalizeSwapResponse),
293
- neuron_recipes: IDL.Vec(SnsNeuronRecipe),
294
- next_ticket_id: IDL.Opt(IDL.Nat64),
295
- decentralization_sale_open_timestamp_seconds: IDL.Opt(IDL.Nat64),
296
- finalize_swap_in_progress: IDL.Opt(IDL.Bool),
297
- timers: IDL.Opt(Timers),
298
- cf_participants: IDL.Vec(CfParticipant),
299
- init: IDL.Opt(Init),
300
- already_tried_to_auto_finalize: IDL.Opt(IDL.Bool),
301
- neurons_fund_participation_icp_e8s: IDL.Opt(IDL.Nat64),
302
- purge_old_tickets_last_completion_timestamp_nanoseconds: IDL.Opt(IDL.Nat64),
303
- direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),
304
- lifecycle: IDL.Int32,
305
- purge_old_tickets_next_principal: IDL.Opt(IDL.Vec(IDL.Nat8)),
306
- decentralization_swap_termination_timestamp_seconds: IDL.Opt(IDL.Nat64),
307
- buyers: IDL.Vec(IDL.Tuple(IDL.Text, BuyerState)),
308
- params: IDL.Opt(Params),
309
- open_sns_token_swap_proposal_id: IDL.Opt(IDL.Nat64),
310
- });
311
- const DerivedState = IDL.Record({
312
- sns_tokens_per_icp: IDL.Float32,
313
- buyer_total_icp_e8s: IDL.Nat64,
314
- cf_participant_count: IDL.Opt(IDL.Nat64),
315
- neurons_fund_participation_icp_e8s: IDL.Opt(IDL.Nat64),
316
- direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),
317
- direct_participant_count: IDL.Opt(IDL.Nat64),
318
- cf_neuron_count: IDL.Opt(IDL.Nat64),
319
- });
320
- const GetStateResponse = IDL.Record({
321
- swap: IDL.Opt(Swap),
322
- derived: IDL.Opt(DerivedState),
323
- });
324
- const GetTimersResponse = IDL.Record({ timers: IDL.Opt(Timers) });
325
- const ListCommunityFundParticipantsRequest = IDL.Record({
326
- offset: IDL.Opt(IDL.Nat64),
327
- limit: IDL.Opt(IDL.Nat32),
328
- });
329
- const ListCommunityFundParticipantsResponse = IDL.Record({
330
- cf_participants: IDL.Vec(CfParticipant),
331
- });
332
- const ListDirectParticipantsRequest = IDL.Record({
333
- offset: IDL.Opt(IDL.Nat32),
334
- limit: IDL.Opt(IDL.Nat32),
335
- });
336
- const Participant = IDL.Record({
337
- participation: IDL.Opt(BuyerState),
338
- participant_id: IDL.Opt(IDL.Principal),
339
- });
340
- const ListDirectParticipantsResponse = IDL.Record({
341
- participants: IDL.Vec(Participant),
342
- });
343
- const ListSnsNeuronRecipesRequest = IDL.Record({
344
- offset: IDL.Opt(IDL.Nat64),
345
- limit: IDL.Opt(IDL.Nat32),
346
- });
347
- const ListSnsNeuronRecipesResponse = IDL.Record({
348
- sns_neuron_recipes: IDL.Vec(SnsNeuronRecipe),
349
- });
350
- const NewSaleTicketRequest = IDL.Record({
351
- subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)),
352
- amount_icp_e8s: IDL.Nat64,
353
- });
354
- const InvalidUserAmount = IDL.Record({
355
- min_amount_icp_e8s_included: IDL.Nat64,
356
- max_amount_icp_e8s_included: IDL.Nat64,
357
- });
358
- const Err_2 = IDL.Record({
359
- invalid_user_amount: IDL.Opt(InvalidUserAmount),
360
- existing_ticket: IDL.Opt(Ticket),
361
- error_type: IDL.Int32,
362
- });
363
- const Result_2 = IDL.Variant({ Ok: Ok_2, Err: Err_2 });
364
- const NewSaleTicketResponse = IDL.Record({ result: IDL.Opt(Result_2) });
365
- const RefreshBuyerTokensRequest = IDL.Record({
366
- confirmation_text: IDL.Opt(IDL.Text),
367
- buyer: IDL.Text,
368
- });
369
- const RefreshBuyerTokensResponse = IDL.Record({
370
- icp_accepted_participation_e8s: IDL.Nat64,
371
- icp_ledger_account_balance_e8s: IDL.Nat64,
372
- });
373
-
374
- return IDL.Service({
375
- error_refund_icp: IDL.Func(
376
- [ErrorRefundIcpRequest],
377
- [ErrorRefundIcpResponse],
378
- [],
379
- ),
380
- finalize_swap: IDL.Func([IDL.Record({})], [FinalizeSwapResponse], []),
381
- get_auto_finalization_status: IDL.Func(
382
- [IDL.Record({})],
383
- [GetAutoFinalizationStatusResponse],
384
- ["query"],
385
- ),
386
- get_buyer_state: IDL.Func(
387
- [GetBuyerStateRequest],
388
- [GetBuyerStateResponse],
389
- ["query"],
390
- ),
391
- get_buyers_total: IDL.Func([IDL.Record({})], [GetBuyersTotalResponse], []),
392
- get_canister_status: IDL.Func(
393
- [IDL.Record({})],
394
- [CanisterStatusResultV2],
395
- [],
396
- ),
397
- get_derived_state: IDL.Func(
398
- [IDL.Record({})],
399
- [GetDerivedStateResponse],
400
- ["query"],
401
- ),
402
- get_init: IDL.Func([IDL.Record({})], [GetInitResponse], ["query"]),
403
- get_lifecycle: IDL.Func(
404
- [IDL.Record({})],
405
- [GetLifecycleResponse],
406
- ["query"],
407
- ),
408
- get_open_ticket: IDL.Func(
409
- [IDL.Record({})],
410
- [GetOpenTicketResponse],
411
- ["query"],
412
- ),
413
- get_sale_parameters: IDL.Func(
414
- [IDL.Record({})],
415
- [GetSaleParametersResponse],
416
- ["query"],
417
- ),
418
- get_state: IDL.Func([IDL.Record({})], [GetStateResponse], ["query"]),
419
- get_timers: IDL.Func([IDL.Record({})], [GetTimersResponse], ["query"]),
420
- list_community_fund_participants: IDL.Func(
421
- [ListCommunityFundParticipantsRequest],
422
- [ListCommunityFundParticipantsResponse],
423
- ["query"],
424
- ),
425
- list_direct_participants: IDL.Func(
426
- [ListDirectParticipantsRequest],
427
- [ListDirectParticipantsResponse],
428
- ["query"],
429
- ),
430
- list_sns_neuron_recipes: IDL.Func(
431
- [ListSnsNeuronRecipesRequest],
432
- [ListSnsNeuronRecipesResponse],
433
- ["query"],
434
- ),
435
- new_sale_ticket: IDL.Func(
436
- [NewSaleTicketRequest],
437
- [NewSaleTicketResponse],
438
- [],
439
- ),
440
- notify_payment_failure: IDL.Func([IDL.Record({})], [Ok_2], []),
441
- refresh_buyer_tokens: IDL.Func(
442
- [RefreshBuyerTokensRequest],
443
- [RefreshBuyerTokensResponse],
444
- [],
445
- ),
446
- reset_timers: IDL.Func([IDL.Record({})], [IDL.Record({})], []),
447
- });
448
- };
449
-
450
- export const init = ({ IDL }) => {
451
- const NeuronBasketConstructionParameters = IDL.Record({
452
- dissolve_delay_interval_seconds: IDL.Nat64,
453
- count: IDL.Nat64,
454
- });
455
- const LinearScalingCoefficient = IDL.Record({
456
- slope_numerator: IDL.Opt(IDL.Nat64),
457
- intercept_icp_e8s: IDL.Opt(IDL.Nat64),
458
- from_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),
459
- slope_denominator: IDL.Opt(IDL.Nat64),
460
- to_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),
461
- });
462
- const IdealMatchedParticipationFunction = IDL.Record({
463
- serialized_representation: IDL.Opt(IDL.Text),
464
- });
465
- const NeuronsFundParticipationConstraints = IDL.Record({
466
- coefficient_intervals: IDL.Vec(LinearScalingCoefficient),
467
- max_neurons_fund_participation_icp_e8s: IDL.Opt(IDL.Nat64),
468
- min_direct_participation_threshold_icp_e8s: IDL.Opt(IDL.Nat64),
469
- ideal_matched_participation_function: IDL.Opt(
470
- IdealMatchedParticipationFunction,
471
- ),
472
- });
473
- const Countries = IDL.Record({ iso_codes: IDL.Vec(IDL.Text) });
474
- const Init = IDL.Record({
475
- nns_proposal_id: IDL.Opt(IDL.Nat64),
476
- sns_root_canister_id: IDL.Text,
477
- neurons_fund_participation: IDL.Opt(IDL.Bool),
478
- min_participant_icp_e8s: IDL.Opt(IDL.Nat64),
479
- neuron_basket_construction_parameters: IDL.Opt(
480
- NeuronBasketConstructionParameters,
481
- ),
482
- fallback_controller_principal_ids: IDL.Vec(IDL.Text),
483
- max_icp_e8s: IDL.Opt(IDL.Nat64),
484
- neuron_minimum_stake_e8s: IDL.Opt(IDL.Nat64),
485
- confirmation_text: IDL.Opt(IDL.Text),
486
- swap_start_timestamp_seconds: IDL.Opt(IDL.Nat64),
487
- swap_due_timestamp_seconds: IDL.Opt(IDL.Nat64),
488
- min_participants: IDL.Opt(IDL.Nat32),
489
- sns_token_e8s: IDL.Opt(IDL.Nat64),
490
- nns_governance_canister_id: IDL.Text,
491
- transaction_fee_e8s: IDL.Opt(IDL.Nat64),
492
- icp_ledger_canister_id: IDL.Text,
493
- sns_ledger_canister_id: IDL.Text,
494
- neurons_fund_participation_constraints: IDL.Opt(
495
- NeuronsFundParticipationConstraints,
496
- ),
497
- should_auto_finalize: IDL.Opt(IDL.Bool),
498
- max_participant_icp_e8s: IDL.Opt(IDL.Nat64),
499
- sns_governance_canister_id: IDL.Text,
500
- min_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),
501
- restricted_countries: IDL.Opt(Countries),
502
- min_icp_e8s: IDL.Opt(IDL.Nat64),
503
- max_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),
504
- });
505
-
506
- return [Init];
507
- };
@@ -1,8 +0,0 @@
1
- /**
2
- * A default length for the queried list of neurons
3
- *
4
- * Source: https://github.com/dfinity/ic/blob/master/rs/sns/governance/src/neuron.rs
5
- */
6
- export declare const MAX_LIST_NEURONS_RESULTS = 100;
7
- export declare const MAX_NEURONS_SUBACCOUNTS: number;
8
- export declare const DEFAULT_PROPOSALS_LIMIT = 10;
@@ -1,22 +0,0 @@
1
- import type { IcrcAccount } from "@dfinity/ledger-icrc";
2
- import type { Account, Action as ActionCandid, ListProposals, ManageNeuron, NeuronId } from "../candid/sns_governance";
3
- import type { Action } from "../types/actions";
4
- import type { SnsClaimOrRefreshArgs, SnsDisburseNeuronParams, SnsIncreaseDissolveDelayParams, SnsListProposalsParams, SnsNeuronAutoStakeMaturityParams, SnsNeuronDisburseMaturityParams, SnsNeuronPermissionsParams, SnsNeuronStakeMaturityParams, SnsRegisterVoteParams, SnsSetDissolveTimestampParams, SnsSetFollowingParams, SnsSetTopicFollowees, SnsSplitNeuronParams } from "../types/governance.params";
5
- export declare const toCandidAccount: ({ owner, subaccount, }: IcrcAccount) => Account;
6
- export declare const toAddPermissionsRequest: ({ neuronId, permissions, principal, }: SnsNeuronPermissionsParams) => ManageNeuron;
7
- export declare const toRemovePermissionsRequest: ({ neuronId, permissions, principal, }: SnsNeuronPermissionsParams) => ManageNeuron;
8
- export declare const toSplitNeuronRequest: ({ neuronId, memo, amount: amount_e8s, }: SnsSplitNeuronParams) => ManageNeuron;
9
- export declare const toDisburseNeuronRequest: ({ neuronId, amount, toAccount, }: SnsDisburseNeuronParams) => ManageNeuron;
10
- export declare const toStartDissolvingNeuronRequest: (neuronId: NeuronId) => ManageNeuron;
11
- export declare const toStopDissolvingNeuronRequest: (neuronId: NeuronId) => ManageNeuron;
12
- export declare const toStakeMaturityRequest: ({ neuronId, percentageToStake, }: SnsNeuronStakeMaturityParams) => ManageNeuron;
13
- export declare const toDisburseMaturityRequest: ({ neuronId, percentageToDisburse, toAccount, }: SnsNeuronDisburseMaturityParams) => ManageNeuron;
14
- export declare const toAutoStakeMaturityNeuronRequest: ({ neuronId, autoStake: requested_setting_for_auto_stake_maturity, }: SnsNeuronAutoStakeMaturityParams) => ManageNeuron;
15
- export declare const toSetDissolveTimestampRequest: ({ neuronId, dissolveTimestampSeconds, }: SnsSetDissolveTimestampParams) => ManageNeuron;
16
- export declare const toIncreaseDissolveDelayRequest: ({ neuronId, additionalDissolveDelaySeconds, }: SnsIncreaseDissolveDelayParams) => ManageNeuron;
17
- export declare const toFollowRequest: ({ neuronId, functionId, followees, }: SnsSetTopicFollowees) => ManageNeuron;
18
- export declare const toSetFollowingRequest: ({ neuronId, topicFollowing, }: SnsSetFollowingParams) => ManageNeuron;
19
- export declare const toRegisterVoteRequest: ({ neuronId, proposalId, vote, }: SnsRegisterVoteParams) => ManageNeuron;
20
- export declare const toClaimOrRefreshRequest: ({ subaccount, memo, controller, }: SnsClaimOrRefreshArgs) => ManageNeuron;
21
- export declare const toListProposalRequest: ({ excludeType, beforeProposal, includeRewardStatus, includeStatus, limit, includeTopics, }: SnsListProposalsParams) => ListProposals;
22
- export declare const fromCandidAction: (action: ActionCandid) => Action;
@@ -1,3 +0,0 @@
1
- import type { NewSaleTicketRequest } from "../candid/sns_swap";
2
- import type { NewSaleTicketParams } from "../types/swap.params";
3
- export declare const toNewSaleTicketRequest: ({ subaccount, amount_icp_e8s, }: NewSaleTicketParams) => NewSaleTicketRequest;
@@ -1,35 +0,0 @@
1
- export declare enum SnsNeuronPermissionType {
2
- NEURON_PERMISSION_TYPE_UNSPECIFIED = 0,
3
- NEURON_PERMISSION_TYPE_CONFIGURE_DISSOLVE_STATE = 1,
4
- NEURON_PERMISSION_TYPE_MANAGE_PRINCIPALS = 2,
5
- NEURON_PERMISSION_TYPE_SUBMIT_PROPOSAL = 3,
6
- NEURON_PERMISSION_TYPE_VOTE = 4,
7
- NEURON_PERMISSION_TYPE_DISBURSE = 5,
8
- NEURON_PERMISSION_TYPE_SPLIT = 6,
9
- /**
10
- * @deprecated
11
- */
12
- NEURON_PERMISSION_TYPE_MERGE_MATURITY = 7,
13
- NEURON_PERMISSION_TYPE_DISBURSE_MATURITY = 8,
14
- NEURON_PERMISSION_TYPE_STAKE_MATURITY = 9,
15
- NEURON_PERMISSION_TYPE_MANAGE_VOTING_PERMISSION = 10
16
- }
17
- export declare enum SnsProposalRewardStatus {
18
- PROPOSAL_REWARD_STATUS_UNSPECIFIED = 0,
19
- PROPOSAL_REWARD_STATUS_ACCEPT_VOTES = 1,
20
- PROPOSAL_REWARD_STATUS_READY_TO_SETTLE = 2,
21
- PROPOSAL_REWARD_STATUS_SETTLED = 3
22
- }
23
- export declare enum SnsProposalDecisionStatus {
24
- PROPOSAL_DECISION_STATUS_UNSPECIFIED = 0,
25
- PROPOSAL_DECISION_STATUS_OPEN = 1,
26
- PROPOSAL_DECISION_STATUS_REJECTED = 2,
27
- PROPOSAL_DECISION_STATUS_ADOPTED = 3,
28
- PROPOSAL_DECISION_STATUS_EXECUTED = 4,
29
- PROPOSAL_DECISION_STATUS_FAILED = 5
30
- }
31
- export declare enum SnsVote {
32
- Unspecified = 0,
33
- Yes = 1,
34
- No = 2
35
- }
@@ -1,22 +0,0 @@
1
- export declare enum SnsSwapLifecycle {
2
- Unspecified = 0,
3
- Pending = 1,
4
- Open = 2,
5
- Committed = 3,
6
- Aborted = 4,
7
- Adopted = 5
8
- }
9
- export declare enum GetOpenTicketErrorType {
10
- TYPE_UNSPECIFIED = 0,
11
- TYPE_SALE_NOT_OPEN = 1,
12
- TYPE_SALE_CLOSED = 2
13
- }
14
- export declare enum NewSaleTicketResponseErrorType {
15
- TYPE_UNSPECIFIED = 0,
16
- TYPE_SALE_NOT_OPEN = 1,
17
- TYPE_SALE_CLOSED = 2,
18
- TYPE_TICKET_EXISTS = 3,
19
- TYPE_INVALID_USER_AMOUNT = 4,
20
- TYPE_INVALID_SUBACCOUNT = 5,
21
- TYPE_INVALID_PRINCIPAL = 6
22
- }
@@ -1,4 +0,0 @@
1
- export declare class UnsupportedMethodError extends Error {
2
- readonly methodName: string;
3
- constructor(methodName: string);
4
- }
@@ -1,2 +0,0 @@
1
- export declare class SnsGovernanceError extends Error {
2
- }
@@ -1,16 +0,0 @@
1
- import type { InvalidUserAmount, Ticket } from "../candid/sns_swap";
2
- import type { GetOpenTicketErrorType, NewSaleTicketResponseErrorType } from "../enums/swap.enums";
3
- export declare class SnsSwapNewTicketError extends Error {
4
- errorType: NewSaleTicketResponseErrorType;
5
- invalidUserAmount?: InvalidUserAmount;
6
- existingTicket?: Ticket;
7
- constructor({ errorType, invalidUserAmount, existingTicket, }: {
8
- errorType: NewSaleTicketResponseErrorType;
9
- invalidUserAmount?: InvalidUserAmount;
10
- existingTicket?: Ticket;
11
- });
12
- }
13
- export declare class SnsSwapGetOpenTicketError extends Error {
14
- errorType: GetOpenTicketErrorType;
15
- constructor(errorType: GetOpenTicketErrorType);
16
- }