@junobuild/functions 0.4.1 → 0.5.1-next-2025-11-29

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 (137) hide show
  1. package/canisters/_canister.d.ts +17 -0
  2. package/canisters/_constants.d.ts +3 -0
  3. package/canisters/ckbtc/index.d.ts +1 -0
  4. package/canisters/ckbtc/index.js +2 -0
  5. package/canisters/cketh/index.d.ts +1 -0
  6. package/canisters/cketh/index.js +2 -0
  7. package/canisters/cketh/index.js.map +7 -0
  8. package/canisters/cmc/cmc.canister.d.ts +28 -0
  9. package/canisters/cmc/index.d.ts +2 -0
  10. package/canisters/cmc/index.js +2 -0
  11. package/canisters/cmc/index.js.map +7 -0
  12. package/canisters/declarations/_idl.d.ts +16 -0
  13. package/canisters/declarations/_types.d.ts +16 -0
  14. package/canisters/declarations/ckbtc/bitcoin.did.d.ts +134 -0
  15. package/canisters/declarations/ckbtc/bitcoin.did.idl.d.ts +40 -0
  16. package/canisters/declarations/ckbtc/minter.did.d.ts +831 -0
  17. package/canisters/declarations/ckbtc/minter.did.idl.d.ts +61 -0
  18. package/canisters/declarations/cketh/minter.did.d.ts +893 -0
  19. package/canisters/declarations/cketh/minter.did.idl.d.ts +58 -0
  20. package/canisters/declarations/cketh/orchestrator.did.d.ts +302 -0
  21. package/canisters/declarations/cketh/orchestrator.did.idl.d.ts +34 -0
  22. package/canisters/declarations/cmc/cmc.did.d.ts +344 -0
  23. package/canisters/declarations/cmc/cmc.did.idl.d.ts +53 -0
  24. package/canisters/declarations/ic-management/ic-management.did.d.ts +583 -0
  25. package/canisters/declarations/ic-management/ic-management.did.idl.d.ts +147 -0
  26. package/canisters/declarations/index.d.ts +2 -0
  27. package/canisters/declarations/ledger-icp/index.did.d.ts +119 -0
  28. package/canisters/declarations/ledger-icp/index.did.idl.d.ts +35 -0
  29. package/canisters/declarations/ledger-icp/ledger.did.d.ts +606 -0
  30. package/canisters/declarations/ledger-icp/ledger.did.idl.d.ts +106 -0
  31. package/canisters/declarations/ledger-icrc/icrc_index-ng.did.d.ts +148 -0
  32. package/canisters/declarations/ledger-icrc/icrc_index-ng.did.idl.d.ts +44 -0
  33. package/canisters/declarations/ledger-icrc/icrc_index.did.d.ts +102 -0
  34. package/canisters/declarations/ledger-icrc/icrc_index.did.idl.d.ts +28 -0
  35. package/canisters/declarations/ledger-icrc/icrc_ledger.did.d.ts +579 -0
  36. package/canisters/declarations/ledger-icrc/icrc_ledger.did.idl.d.ts +100 -0
  37. package/canisters/declarations/ledger-icrc/icrc_nft-ledger.did.d.ts +81 -0
  38. package/canisters/declarations/ledger-icrc/icrc_nft-ledger.did.idl.d.ts +39 -0
  39. package/canisters/declarations/nns/genesis_token.did.d.ts +49 -0
  40. package/canisters/declarations/nns/genesis_token.did.idl.d.ts +24 -0
  41. package/canisters/declarations/nns/governance.did.d.ts +1254 -0
  42. package/canisters/declarations/nns/governance.did.idl.d.ts +217 -0
  43. package/canisters/declarations/nns/governance_test.did.d.ts +1258 -0
  44. package/canisters/declarations/nns/governance_test.did.idl.d.ts +218 -0
  45. package/canisters/declarations/nns/sns_wasm.did.d.ts +286 -0
  46. package/canisters/declarations/nns/sns_wasm.did.idl.d.ts +80 -0
  47. package/canisters/declarations/sns/sns_governance.did.d.ts +834 -0
  48. package/canisters/declarations/sns/sns_governance.did.idl.d.ts +189 -0
  49. package/canisters/declarations/sns/sns_governance_test.did.d.ts +861 -0
  50. package/canisters/declarations/sns/sns_governance_test.did.idl.d.ts +199 -0
  51. package/canisters/declarations/sns/sns_root.did.d.ts +204 -0
  52. package/canisters/declarations/sns/sns_root.did.idl.d.ts +53 -0
  53. package/canisters/declarations/sns/sns_swap.did.d.ts +411 -0
  54. package/canisters/declarations/sns/sns_swap.did.idl.d.ts +108 -0
  55. package/canisters/ic-management/index.d.ts +1 -0
  56. package/canisters/ic-management/index.js +2 -0
  57. package/canisters/ic-management/index.js.map +7 -0
  58. package/canisters/index.d.ts +1 -0
  59. package/canisters/index.js +2 -0
  60. package/canisters/index.js.map +7 -0
  61. package/canisters/ledger/icp/index.d.ts +2 -0
  62. package/canisters/ledger/icp/index.js +2 -0
  63. package/canisters/ledger/icp/index.js.map +7 -0
  64. package/canisters/ledger/icp/ledger.canister.d.ts +24 -0
  65. package/canisters/ledger/icrc/index.d.ts +3 -0
  66. package/canisters/ledger/icrc/index.js +2 -0
  67. package/canisters/ledger/icrc/index.js.map +7 -0
  68. package/canisters/ledger/icrc/ledger.canister.d.ts +45 -0
  69. package/canisters/ledger/icrc/schemas.d.ts +11 -0
  70. package/canisters/nns/index.d.ts +1 -0
  71. package/canisters/nns/index.js +2 -0
  72. package/canisters/nns/index.js.map +7 -0
  73. package/canisters/schemas.d.ts +11 -0
  74. package/canisters/sns/index.d.ts +1 -0
  75. package/canisters/sns/index.js +2 -0
  76. package/canisters/sns/index.js.map +7 -0
  77. package/chunk-4C666HHU.js +2 -0
  78. package/chunk-4C666HHU.js.map +7 -0
  79. package/chunk-5NZMOUKF.js +2 -0
  80. package/chunk-5NZMOUKF.js.map +7 -0
  81. package/chunk-BXZ5PSUW.js +2 -0
  82. package/chunk-BXZ5PSUW.js.map +7 -0
  83. package/chunk-EMQQE34V.js +2 -0
  84. package/chunk-EMQQE34V.js.map +7 -0
  85. package/chunk-HANEPD6T.js +2 -0
  86. package/chunk-HANEPD6T.js.map +7 -0
  87. package/chunk-TZVF5LQY.js +2 -0
  88. package/chunk-TZVF5LQY.js.map +7 -0
  89. package/ic-cdk.js +1 -1
  90. package/ic-cdk.js.map +4 -4
  91. package/index.js +1 -1
  92. package/index.js.map +1 -1
  93. package/package.json +43 -6
  94. package/sdk.js +1 -1
  95. package/sdk.js.map +1 -1
  96. package/src/canisters/declarations/ckbtc/bitcoin.did.d.ts +134 -0
  97. package/src/canisters/declarations/ckbtc/bitcoin.did.idl.js +302 -0
  98. package/src/canisters/declarations/ckbtc/minter.did.d.ts +831 -0
  99. package/src/canisters/declarations/ckbtc/minter.did.idl.js +893 -0
  100. package/src/canisters/declarations/cketh/minter.did.d.ts +893 -0
  101. package/src/canisters/declarations/cketh/minter.did.idl.js +878 -0
  102. package/src/canisters/declarations/cketh/orchestrator.did.d.ts +302 -0
  103. package/src/canisters/declarations/cketh/orchestrator.did.idl.js +343 -0
  104. package/src/canisters/declarations/cmc/cmc.did.d.ts +344 -0
  105. package/src/canisters/declarations/cmc/cmc.did.idl.js +338 -0
  106. package/src/canisters/declarations/ic-management/ic-management.did.d.ts +583 -0
  107. package/src/canisters/declarations/ic-management/ic-management.did.idl.js +1150 -0
  108. package/src/canisters/declarations/ledger-icp/index.did.d.ts +119 -0
  109. package/src/canisters/declarations/ledger-icp/index.did.idl.js +225 -0
  110. package/src/canisters/declarations/ledger-icp/ledger.did.d.ts +606 -0
  111. package/src/canisters/declarations/ledger-icp/ledger.did.idl.js +813 -0
  112. package/src/canisters/declarations/ledger-icrc/icrc_index-ng.did.d.ts +148 -0
  113. package/src/canisters/declarations/ledger-icrc/icrc_index-ng.did.idl.js +274 -0
  114. package/src/canisters/declarations/ledger-icrc/icrc_index.did.d.ts +102 -0
  115. package/src/canisters/declarations/ledger-icrc/icrc_index.did.idl.js +171 -0
  116. package/src/canisters/declarations/ledger-icrc/icrc_ledger.did.d.ts +579 -0
  117. package/src/canisters/declarations/ledger-icrc/icrc_ledger.did.idl.js +923 -0
  118. package/src/canisters/declarations/ledger-icrc/icrc_nft-ledger.did.d.ts +81 -0
  119. package/src/canisters/declarations/ledger-icrc/icrc_nft-ledger.did.idl.js +163 -0
  120. package/src/canisters/declarations/nns/genesis_token.did.d.ts +49 -0
  121. package/src/canisters/declarations/nns/genesis_token.did.idl.js +84 -0
  122. package/src/canisters/declarations/nns/governance.did.d.ts +1254 -0
  123. package/src/canisters/declarations/nns/governance.did.idl.js +2756 -0
  124. package/src/canisters/declarations/nns/governance_test.did.d.ts +1258 -0
  125. package/src/canisters/declarations/nns/governance_test.did.idl.js +2758 -0
  126. package/src/canisters/declarations/nns/sns_wasm.did.d.ts +286 -0
  127. package/src/canisters/declarations/nns/sns_wasm.did.idl.js +589 -0
  128. package/src/canisters/declarations/sns/sns_governance.did.d.ts +834 -0
  129. package/src/canisters/declarations/sns/sns_governance.did.idl.js +2235 -0
  130. package/src/canisters/declarations/sns/sns_governance_test.did.d.ts +861 -0
  131. package/src/canisters/declarations/sns/sns_governance_test.did.idl.js +2283 -0
  132. package/src/canisters/declarations/sns/sns_root.did.d.ts +204 -0
  133. package/src/canisters/declarations/sns/sns_root.did.idl.js +433 -0
  134. package/src/canisters/declarations/sns/sns_swap.did.d.ts +411 -0
  135. package/src/canisters/declarations/sns/sns_swap.did.idl.js +858 -0
  136. package/global.d.js +0 -1
  137. /package/{global.d.js.map → canisters/ckbtc/index.js.map} +0 -0
@@ -0,0 +1,858 @@
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
+ import {IDL} from '@icp-sdk/core/candid';
10
+
11
+ export const NeuronBasketConstructionParameters = IDL.Record({
12
+ dissolve_delay_interval_seconds: IDL.Nat64,
13
+ count: IDL.Nat64
14
+ });
15
+ export const LinearScalingCoefficient = IDL.Record({
16
+ slope_numerator: IDL.Opt(IDL.Nat64),
17
+ intercept_icp_e8s: IDL.Opt(IDL.Nat64),
18
+ from_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),
19
+ slope_denominator: IDL.Opt(IDL.Nat64),
20
+ to_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64)
21
+ });
22
+ export const IdealMatchedParticipationFunction = IDL.Record({
23
+ serialized_representation: IDL.Opt(IDL.Text)
24
+ });
25
+ export const NeuronsFundParticipationConstraints = IDL.Record({
26
+ coefficient_intervals: IDL.Vec(LinearScalingCoefficient),
27
+ max_neurons_fund_participation_icp_e8s: IDL.Opt(IDL.Nat64),
28
+ min_direct_participation_threshold_icp_e8s: IDL.Opt(IDL.Nat64),
29
+ ideal_matched_participation_function: IDL.Opt(IdealMatchedParticipationFunction)
30
+ });
31
+ export const Countries = IDL.Record({iso_codes: IDL.Vec(IDL.Text)});
32
+ export const Init = IDL.Record({
33
+ nns_proposal_id: IDL.Opt(IDL.Nat64),
34
+ sns_root_canister_id: IDL.Text,
35
+ neurons_fund_participation: IDL.Opt(IDL.Bool),
36
+ min_participant_icp_e8s: IDL.Opt(IDL.Nat64),
37
+ neuron_basket_construction_parameters: IDL.Opt(NeuronBasketConstructionParameters),
38
+ fallback_controller_principal_ids: IDL.Vec(IDL.Text),
39
+ max_icp_e8s: IDL.Opt(IDL.Nat64),
40
+ neuron_minimum_stake_e8s: IDL.Opt(IDL.Nat64),
41
+ confirmation_text: IDL.Opt(IDL.Text),
42
+ swap_start_timestamp_seconds: IDL.Opt(IDL.Nat64),
43
+ swap_due_timestamp_seconds: IDL.Opt(IDL.Nat64),
44
+ min_participants: IDL.Opt(IDL.Nat32),
45
+ sns_token_e8s: IDL.Opt(IDL.Nat64),
46
+ nns_governance_canister_id: IDL.Text,
47
+ transaction_fee_e8s: IDL.Opt(IDL.Nat64),
48
+ icp_ledger_canister_id: IDL.Text,
49
+ sns_ledger_canister_id: IDL.Text,
50
+ neurons_fund_participation_constraints: IDL.Opt(NeuronsFundParticipationConstraints),
51
+ should_auto_finalize: IDL.Opt(IDL.Bool),
52
+ max_participant_icp_e8s: IDL.Opt(IDL.Nat64),
53
+ sns_governance_canister_id: IDL.Text,
54
+ min_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),
55
+ restricted_countries: IDL.Opt(Countries),
56
+ min_icp_e8s: IDL.Opt(IDL.Nat64),
57
+ max_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64)
58
+ });
59
+ export const ErrorRefundIcpRequest = IDL.Record({
60
+ source_principal_id: IDL.Opt(IDL.Principal)
61
+ });
62
+ export const Ok = IDL.Record({block_height: IDL.Opt(IDL.Nat64)});
63
+ export const Err = IDL.Record({
64
+ description: IDL.Opt(IDL.Text),
65
+ error_type: IDL.Opt(IDL.Int32)
66
+ });
67
+ export const Result = IDL.Variant({Ok: Ok, Err: Err});
68
+ export const ErrorRefundIcpResponse = IDL.Record({
69
+ result: IDL.Opt(Result)
70
+ });
71
+ export const CanisterCallError = IDL.Record({
72
+ code: IDL.Opt(IDL.Int32),
73
+ description: IDL.Text
74
+ });
75
+ export const FailedUpdate = IDL.Record({
76
+ err: IDL.Opt(CanisterCallError),
77
+ dapp_canister_id: IDL.Opt(IDL.Principal)
78
+ });
79
+ export const SetDappControllersResponse = IDL.Record({
80
+ failed_updates: IDL.Vec(FailedUpdate)
81
+ });
82
+ export const Possibility = IDL.Variant({
83
+ Ok: SetDappControllersResponse,
84
+ Err: CanisterCallError
85
+ });
86
+ export const SetDappControllersCallResult = IDL.Record({
87
+ possibility: IDL.Opt(Possibility)
88
+ });
89
+ export const SweepResult = IDL.Record({
90
+ failure: IDL.Nat32,
91
+ skipped: IDL.Nat32,
92
+ invalid: IDL.Nat32,
93
+ success: IDL.Nat32,
94
+ global_failures: IDL.Nat32
95
+ });
96
+ export const GovernanceError = IDL.Record({
97
+ error_message: IDL.Text,
98
+ error_type: IDL.Int32
99
+ });
100
+ export const Response = IDL.Record({
101
+ governance_error: IDL.Opt(GovernanceError)
102
+ });
103
+ export const Possibility_1 = IDL.Variant({
104
+ Ok: Response,
105
+ Err: CanisterCallError
106
+ });
107
+ export const SettleCommunityFundParticipationResult = IDL.Record({
108
+ possibility: IDL.Opt(Possibility_1)
109
+ });
110
+ export const Ok_1 = IDL.Record({
111
+ neurons_fund_participation_icp_e8s: IDL.Opt(IDL.Nat64),
112
+ neurons_fund_neurons_count: IDL.Opt(IDL.Nat64)
113
+ });
114
+ export const Error = IDL.Record({message: IDL.Opt(IDL.Text)});
115
+ export const Possibility_2 = IDL.Variant({Ok: Ok_1, Err: Error});
116
+ export const SettleNeuronsFundParticipationResult = IDL.Record({
117
+ possibility: IDL.Opt(Possibility_2)
118
+ });
119
+ export const Possibility_3 = IDL.Variant({
120
+ Ok: IDL.Record({}),
121
+ Err: CanisterCallError
122
+ });
123
+ export const SetModeCallResult = IDL.Record({
124
+ possibility: IDL.Opt(Possibility_3)
125
+ });
126
+ export const FinalizeSwapResponse = IDL.Record({
127
+ set_dapp_controllers_call_result: IDL.Opt(SetDappControllersCallResult),
128
+ create_sns_neuron_recipes_result: IDL.Opt(SweepResult),
129
+ settle_community_fund_participation_result: IDL.Opt(SettleCommunityFundParticipationResult),
130
+ error_message: IDL.Opt(IDL.Text),
131
+ settle_neurons_fund_participation_result: IDL.Opt(SettleNeuronsFundParticipationResult),
132
+ set_mode_call_result: IDL.Opt(SetModeCallResult),
133
+ sweep_icp_result: IDL.Opt(SweepResult),
134
+ claim_neuron_result: IDL.Opt(SweepResult),
135
+ sweep_sns_result: IDL.Opt(SweepResult)
136
+ });
137
+ export const GetAutoFinalizationStatusResponse = IDL.Record({
138
+ auto_finalize_swap_response: IDL.Opt(FinalizeSwapResponse),
139
+ has_auto_finalize_been_attempted: IDL.Opt(IDL.Bool),
140
+ is_auto_finalize_enabled: IDL.Opt(IDL.Bool)
141
+ });
142
+ export const GetBuyerStateRequest = IDL.Record({
143
+ principal_id: IDL.Opt(IDL.Principal)
144
+ });
145
+ export const TransferableAmount = IDL.Record({
146
+ transfer_fee_paid_e8s: IDL.Opt(IDL.Nat64),
147
+ transfer_start_timestamp_seconds: IDL.Nat64,
148
+ amount_e8s: IDL.Nat64,
149
+ amount_transferred_e8s: IDL.Opt(IDL.Nat64),
150
+ transfer_success_timestamp_seconds: IDL.Nat64
151
+ });
152
+ export const BuyerState = IDL.Record({
153
+ icp: IDL.Opt(TransferableAmount),
154
+ has_created_neuron_recipes: IDL.Opt(IDL.Bool)
155
+ });
156
+ export const GetBuyerStateResponse = IDL.Record({
157
+ buyer_state: IDL.Opt(BuyerState)
158
+ });
159
+ export const GetBuyersTotalResponse = IDL.Record({
160
+ buyers_total: IDL.Nat64
161
+ });
162
+ export const MemoryMetrics = IDL.Record({
163
+ wasm_binary_size: IDL.Opt(IDL.Nat),
164
+ wasm_chunk_store_size: IDL.Opt(IDL.Nat),
165
+ canister_history_size: IDL.Opt(IDL.Nat),
166
+ stable_memory_size: IDL.Opt(IDL.Nat),
167
+ snapshots_size: IDL.Opt(IDL.Nat),
168
+ wasm_memory_size: IDL.Opt(IDL.Nat),
169
+ global_memory_size: IDL.Opt(IDL.Nat),
170
+ custom_sections_size: IDL.Opt(IDL.Nat)
171
+ });
172
+ export const CanisterStatusType = IDL.Variant({
173
+ stopped: IDL.Null,
174
+ stopping: IDL.Null,
175
+ running: IDL.Null
176
+ });
177
+ export const DefiniteCanisterSettingsArgs = IDL.Record({
178
+ freezing_threshold: IDL.Nat,
179
+ wasm_memory_threshold: IDL.Opt(IDL.Nat),
180
+ controllers: IDL.Vec(IDL.Principal),
181
+ wasm_memory_limit: IDL.Opt(IDL.Nat),
182
+ memory_allocation: IDL.Nat,
183
+ compute_allocation: IDL.Nat
184
+ });
185
+ export const QueryStats = IDL.Record({
186
+ response_payload_bytes_total: IDL.Opt(IDL.Nat),
187
+ num_instructions_total: IDL.Opt(IDL.Nat),
188
+ num_calls_total: IDL.Opt(IDL.Nat),
189
+ request_payload_bytes_total: IDL.Opt(IDL.Nat)
190
+ });
191
+ export const CanisterStatusResultV2 = IDL.Record({
192
+ memory_metrics: IDL.Opt(MemoryMetrics),
193
+ status: CanisterStatusType,
194
+ memory_size: IDL.Nat,
195
+ cycles: IDL.Nat,
196
+ settings: DefiniteCanisterSettingsArgs,
197
+ query_stats: IDL.Opt(QueryStats),
198
+ idle_cycles_burned_per_day: IDL.Nat,
199
+ module_hash: IDL.Opt(IDL.Vec(IDL.Nat8))
200
+ });
201
+ export const GetDerivedStateResponse = IDL.Record({
202
+ sns_tokens_per_icp: IDL.Opt(IDL.Float64),
203
+ buyer_total_icp_e8s: IDL.Opt(IDL.Nat64),
204
+ cf_participant_count: IDL.Opt(IDL.Nat64),
205
+ neurons_fund_participation_icp_e8s: IDL.Opt(IDL.Nat64),
206
+ direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),
207
+ direct_participant_count: IDL.Opt(IDL.Nat64),
208
+ cf_neuron_count: IDL.Opt(IDL.Nat64)
209
+ });
210
+ export const GetInitResponse = IDL.Record({init: IDL.Opt(Init)});
211
+ export const GetLifecycleResponse = IDL.Record({
212
+ decentralization_sale_open_timestamp_seconds: IDL.Opt(IDL.Nat64),
213
+ lifecycle: IDL.Opt(IDL.Int32),
214
+ decentralization_swap_termination_timestamp_seconds: IDL.Opt(IDL.Nat64)
215
+ });
216
+ export const Icrc1Account = IDL.Record({
217
+ owner: IDL.Opt(IDL.Principal),
218
+ subaccount: IDL.Opt(IDL.Vec(IDL.Nat8))
219
+ });
220
+ export const Ticket = IDL.Record({
221
+ creation_time: IDL.Nat64,
222
+ ticket_id: IDL.Nat64,
223
+ account: IDL.Opt(Icrc1Account),
224
+ amount_icp_e8s: IDL.Nat64
225
+ });
226
+ export const Ok_2 = IDL.Record({ticket: IDL.Opt(Ticket)});
227
+ export const Err_1 = IDL.Record({error_type: IDL.Opt(IDL.Int32)});
228
+ export const Result_1 = IDL.Variant({Ok: Ok_2, Err: Err_1});
229
+ export const GetOpenTicketResponse = IDL.Record({
230
+ result: IDL.Opt(Result_1)
231
+ });
232
+ export const Params = IDL.Record({
233
+ min_participant_icp_e8s: IDL.Nat64,
234
+ neuron_basket_construction_parameters: IDL.Opt(NeuronBasketConstructionParameters),
235
+ max_icp_e8s: IDL.Nat64,
236
+ swap_due_timestamp_seconds: IDL.Nat64,
237
+ min_participants: IDL.Nat32,
238
+ sns_token_e8s: IDL.Nat64,
239
+ sale_delay_seconds: IDL.Opt(IDL.Nat64),
240
+ max_participant_icp_e8s: IDL.Nat64,
241
+ min_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),
242
+ min_icp_e8s: IDL.Nat64,
243
+ max_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64)
244
+ });
245
+ export const GetSaleParametersResponse = IDL.Record({
246
+ params: IDL.Opt(Params)
247
+ });
248
+ export const NeuronId = IDL.Record({id: IDL.Vec(IDL.Nat8)});
249
+ export const NeuronAttributes = IDL.Record({
250
+ dissolve_delay_seconds: IDL.Nat64,
251
+ memo: IDL.Nat64,
252
+ followees: IDL.Vec(NeuronId)
253
+ });
254
+ export const Principals = IDL.Record({principals: IDL.Vec(IDL.Principal)});
255
+ export const CfInvestment = IDL.Record({
256
+ controller: IDL.Opt(IDL.Principal),
257
+ hotkey_principal: IDL.Text,
258
+ hotkeys: IDL.Opt(Principals),
259
+ nns_neuron_id: IDL.Nat64
260
+ });
261
+ export const DirectInvestment = IDL.Record({buyer_principal: IDL.Text});
262
+ export const Investor = IDL.Variant({
263
+ CommunityFund: CfInvestment,
264
+ Direct: DirectInvestment
265
+ });
266
+ export const SnsNeuronRecipe = IDL.Record({
267
+ sns: IDL.Opt(TransferableAmount),
268
+ claimed_status: IDL.Opt(IDL.Int32),
269
+ neuron_attributes: IDL.Opt(NeuronAttributes),
270
+ investor: IDL.Opt(Investor)
271
+ });
272
+ export const Timers = IDL.Record({
273
+ last_spawned_timestamp_seconds: IDL.Opt(IDL.Nat64),
274
+ last_reset_timestamp_seconds: IDL.Opt(IDL.Nat64),
275
+ requires_periodic_tasks: IDL.Opt(IDL.Bool)
276
+ });
277
+ export const CfNeuron = IDL.Record({
278
+ has_created_neuron_recipes: IDL.Opt(IDL.Bool),
279
+ hotkeys: IDL.Opt(Principals),
280
+ nns_neuron_id: IDL.Nat64,
281
+ amount_icp_e8s: IDL.Nat64
282
+ });
283
+ export const CfParticipant = IDL.Record({
284
+ controller: IDL.Opt(IDL.Principal),
285
+ hotkey_principal: IDL.Text,
286
+ cf_neurons: IDL.Vec(CfNeuron)
287
+ });
288
+ export const Swap = IDL.Record({
289
+ auto_finalize_swap_response: IDL.Opt(FinalizeSwapResponse),
290
+ neuron_recipes: IDL.Vec(SnsNeuronRecipe),
291
+ next_ticket_id: IDL.Opt(IDL.Nat64),
292
+ decentralization_sale_open_timestamp_seconds: IDL.Opt(IDL.Nat64),
293
+ finalize_swap_in_progress: IDL.Opt(IDL.Bool),
294
+ timers: IDL.Opt(Timers),
295
+ cf_participants: IDL.Vec(CfParticipant),
296
+ init: IDL.Opt(Init),
297
+ already_tried_to_auto_finalize: IDL.Opt(IDL.Bool),
298
+ neurons_fund_participation_icp_e8s: IDL.Opt(IDL.Nat64),
299
+ purge_old_tickets_last_completion_timestamp_nanoseconds: IDL.Opt(IDL.Nat64),
300
+ direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),
301
+ lifecycle: IDL.Int32,
302
+ purge_old_tickets_next_principal: IDL.Opt(IDL.Vec(IDL.Nat8)),
303
+ decentralization_swap_termination_timestamp_seconds: IDL.Opt(IDL.Nat64),
304
+ buyers: IDL.Vec(IDL.Tuple(IDL.Text, BuyerState)),
305
+ params: IDL.Opt(Params),
306
+ open_sns_token_swap_proposal_id: IDL.Opt(IDL.Nat64)
307
+ });
308
+ export const DerivedState = IDL.Record({
309
+ sns_tokens_per_icp: IDL.Float32,
310
+ buyer_total_icp_e8s: IDL.Nat64,
311
+ cf_participant_count: IDL.Opt(IDL.Nat64),
312
+ neurons_fund_participation_icp_e8s: IDL.Opt(IDL.Nat64),
313
+ direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),
314
+ direct_participant_count: IDL.Opt(IDL.Nat64),
315
+ cf_neuron_count: IDL.Opt(IDL.Nat64)
316
+ });
317
+ export const GetStateResponse = IDL.Record({
318
+ swap: IDL.Opt(Swap),
319
+ derived: IDL.Opt(DerivedState)
320
+ });
321
+ export const GetTimersResponse = IDL.Record({timers: IDL.Opt(Timers)});
322
+ export const ListCommunityFundParticipantsRequest = IDL.Record({
323
+ offset: IDL.Opt(IDL.Nat64),
324
+ limit: IDL.Opt(IDL.Nat32)
325
+ });
326
+ export const ListCommunityFundParticipantsResponse = IDL.Record({
327
+ cf_participants: IDL.Vec(CfParticipant)
328
+ });
329
+ export const ListDirectParticipantsRequest = IDL.Record({
330
+ offset: IDL.Opt(IDL.Nat32),
331
+ limit: IDL.Opt(IDL.Nat32)
332
+ });
333
+ export const Participant = IDL.Record({
334
+ participation: IDL.Opt(BuyerState),
335
+ participant_id: IDL.Opt(IDL.Principal)
336
+ });
337
+ export const ListDirectParticipantsResponse = IDL.Record({
338
+ participants: IDL.Vec(Participant)
339
+ });
340
+ export const ListSnsNeuronRecipesRequest = IDL.Record({
341
+ offset: IDL.Opt(IDL.Nat64),
342
+ limit: IDL.Opt(IDL.Nat32)
343
+ });
344
+ export const ListSnsNeuronRecipesResponse = IDL.Record({
345
+ sns_neuron_recipes: IDL.Vec(SnsNeuronRecipe)
346
+ });
347
+ export const NewSaleTicketRequest = IDL.Record({
348
+ subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)),
349
+ amount_icp_e8s: IDL.Nat64
350
+ });
351
+ export const InvalidUserAmount = IDL.Record({
352
+ min_amount_icp_e8s_included: IDL.Nat64,
353
+ max_amount_icp_e8s_included: IDL.Nat64
354
+ });
355
+ export const Err_2 = IDL.Record({
356
+ invalid_user_amount: IDL.Opt(InvalidUserAmount),
357
+ existing_ticket: IDL.Opt(Ticket),
358
+ error_type: IDL.Int32
359
+ });
360
+ export const Result_2 = IDL.Variant({Ok: Ok_2, Err: Err_2});
361
+ export const NewSaleTicketResponse = IDL.Record({
362
+ result: IDL.Opt(Result_2)
363
+ });
364
+ export const RefreshBuyerTokensRequest = IDL.Record({
365
+ confirmation_text: IDL.Opt(IDL.Text),
366
+ buyer: IDL.Text
367
+ });
368
+ export const RefreshBuyerTokensResponse = IDL.Record({
369
+ icp_accepted_participation_e8s: IDL.Nat64,
370
+ icp_ledger_account_balance_e8s: IDL.Nat64
371
+ });
372
+
373
+ export const idlService = IDL.Service({
374
+ error_refund_icp: IDL.Func([ErrorRefundIcpRequest], [ErrorRefundIcpResponse], []),
375
+ finalize_swap: IDL.Func([IDL.Record({})], [FinalizeSwapResponse], []),
376
+ get_auto_finalization_status: IDL.Func(
377
+ [IDL.Record({})],
378
+ [GetAutoFinalizationStatusResponse],
379
+ ['query']
380
+ ),
381
+ get_buyer_state: IDL.Func([GetBuyerStateRequest], [GetBuyerStateResponse], ['query']),
382
+ get_buyers_total: IDL.Func([IDL.Record({})], [GetBuyersTotalResponse], []),
383
+ get_canister_status: IDL.Func([IDL.Record({})], [CanisterStatusResultV2], []),
384
+ get_derived_state: IDL.Func([IDL.Record({})], [GetDerivedStateResponse], ['query']),
385
+ get_init: IDL.Func([IDL.Record({})], [GetInitResponse], ['query']),
386
+ get_lifecycle: IDL.Func([IDL.Record({})], [GetLifecycleResponse], ['query']),
387
+ get_open_ticket: IDL.Func([IDL.Record({})], [GetOpenTicketResponse], ['query']),
388
+ get_sale_parameters: IDL.Func([IDL.Record({})], [GetSaleParametersResponse], ['query']),
389
+ get_state: IDL.Func([IDL.Record({})], [GetStateResponse], ['query']),
390
+ get_timers: IDL.Func([IDL.Record({})], [GetTimersResponse], ['query']),
391
+ list_community_fund_participants: IDL.Func(
392
+ [ListCommunityFundParticipantsRequest],
393
+ [ListCommunityFundParticipantsResponse],
394
+ ['query']
395
+ ),
396
+ list_direct_participants: IDL.Func(
397
+ [ListDirectParticipantsRequest],
398
+ [ListDirectParticipantsResponse],
399
+ ['query']
400
+ ),
401
+ list_sns_neuron_recipes: IDL.Func(
402
+ [ListSnsNeuronRecipesRequest],
403
+ [ListSnsNeuronRecipesResponse],
404
+ ['query']
405
+ ),
406
+ new_sale_ticket: IDL.Func([NewSaleTicketRequest], [NewSaleTicketResponse], []),
407
+ notify_payment_failure: IDL.Func([IDL.Record({})], [Ok_2], []),
408
+ refresh_buyer_tokens: IDL.Func([RefreshBuyerTokensRequest], [RefreshBuyerTokensResponse], []),
409
+ reset_timers: IDL.Func([IDL.Record({})], [IDL.Record({})], [])
410
+ });
411
+
412
+ export const idlInitArgs = [Init];
413
+
414
+ export const idlFactory = ({IDL}) => {
415
+ const NeuronBasketConstructionParameters = IDL.Record({
416
+ dissolve_delay_interval_seconds: IDL.Nat64,
417
+ count: IDL.Nat64
418
+ });
419
+ const LinearScalingCoefficient = IDL.Record({
420
+ slope_numerator: IDL.Opt(IDL.Nat64),
421
+ intercept_icp_e8s: IDL.Opt(IDL.Nat64),
422
+ from_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),
423
+ slope_denominator: IDL.Opt(IDL.Nat64),
424
+ to_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64)
425
+ });
426
+ const IdealMatchedParticipationFunction = IDL.Record({
427
+ serialized_representation: IDL.Opt(IDL.Text)
428
+ });
429
+ const NeuronsFundParticipationConstraints = IDL.Record({
430
+ coefficient_intervals: IDL.Vec(LinearScalingCoefficient),
431
+ max_neurons_fund_participation_icp_e8s: IDL.Opt(IDL.Nat64),
432
+ min_direct_participation_threshold_icp_e8s: IDL.Opt(IDL.Nat64),
433
+ ideal_matched_participation_function: IDL.Opt(IdealMatchedParticipationFunction)
434
+ });
435
+ const Countries = IDL.Record({iso_codes: IDL.Vec(IDL.Text)});
436
+ const Init = IDL.Record({
437
+ nns_proposal_id: IDL.Opt(IDL.Nat64),
438
+ sns_root_canister_id: IDL.Text,
439
+ neurons_fund_participation: IDL.Opt(IDL.Bool),
440
+ min_participant_icp_e8s: IDL.Opt(IDL.Nat64),
441
+ neuron_basket_construction_parameters: IDL.Opt(NeuronBasketConstructionParameters),
442
+ fallback_controller_principal_ids: IDL.Vec(IDL.Text),
443
+ max_icp_e8s: IDL.Opt(IDL.Nat64),
444
+ neuron_minimum_stake_e8s: IDL.Opt(IDL.Nat64),
445
+ confirmation_text: IDL.Opt(IDL.Text),
446
+ swap_start_timestamp_seconds: IDL.Opt(IDL.Nat64),
447
+ swap_due_timestamp_seconds: IDL.Opt(IDL.Nat64),
448
+ min_participants: IDL.Opt(IDL.Nat32),
449
+ sns_token_e8s: IDL.Opt(IDL.Nat64),
450
+ nns_governance_canister_id: IDL.Text,
451
+ transaction_fee_e8s: IDL.Opt(IDL.Nat64),
452
+ icp_ledger_canister_id: IDL.Text,
453
+ sns_ledger_canister_id: IDL.Text,
454
+ neurons_fund_participation_constraints: IDL.Opt(NeuronsFundParticipationConstraints),
455
+ should_auto_finalize: IDL.Opt(IDL.Bool),
456
+ max_participant_icp_e8s: IDL.Opt(IDL.Nat64),
457
+ sns_governance_canister_id: IDL.Text,
458
+ min_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),
459
+ restricted_countries: IDL.Opt(Countries),
460
+ min_icp_e8s: IDL.Opt(IDL.Nat64),
461
+ max_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64)
462
+ });
463
+ const ErrorRefundIcpRequest = IDL.Record({
464
+ source_principal_id: IDL.Opt(IDL.Principal)
465
+ });
466
+ const Ok = IDL.Record({block_height: IDL.Opt(IDL.Nat64)});
467
+ const Err = IDL.Record({
468
+ description: IDL.Opt(IDL.Text),
469
+ error_type: IDL.Opt(IDL.Int32)
470
+ });
471
+ const Result = IDL.Variant({Ok: Ok, Err: Err});
472
+ const ErrorRefundIcpResponse = IDL.Record({result: IDL.Opt(Result)});
473
+ const CanisterCallError = IDL.Record({
474
+ code: IDL.Opt(IDL.Int32),
475
+ description: IDL.Text
476
+ });
477
+ const FailedUpdate = IDL.Record({
478
+ err: IDL.Opt(CanisterCallError),
479
+ dapp_canister_id: IDL.Opt(IDL.Principal)
480
+ });
481
+ const SetDappControllersResponse = IDL.Record({
482
+ failed_updates: IDL.Vec(FailedUpdate)
483
+ });
484
+ const Possibility = IDL.Variant({
485
+ Ok: SetDappControllersResponse,
486
+ Err: CanisterCallError
487
+ });
488
+ const SetDappControllersCallResult = IDL.Record({
489
+ possibility: IDL.Opt(Possibility)
490
+ });
491
+ const SweepResult = IDL.Record({
492
+ failure: IDL.Nat32,
493
+ skipped: IDL.Nat32,
494
+ invalid: IDL.Nat32,
495
+ success: IDL.Nat32,
496
+ global_failures: IDL.Nat32
497
+ });
498
+ const GovernanceError = IDL.Record({
499
+ error_message: IDL.Text,
500
+ error_type: IDL.Int32
501
+ });
502
+ const Response = IDL.Record({
503
+ governance_error: IDL.Opt(GovernanceError)
504
+ });
505
+ const Possibility_1 = IDL.Variant({
506
+ Ok: Response,
507
+ Err: CanisterCallError
508
+ });
509
+ const SettleCommunityFundParticipationResult = IDL.Record({
510
+ possibility: IDL.Opt(Possibility_1)
511
+ });
512
+ const Ok_1 = IDL.Record({
513
+ neurons_fund_participation_icp_e8s: IDL.Opt(IDL.Nat64),
514
+ neurons_fund_neurons_count: IDL.Opt(IDL.Nat64)
515
+ });
516
+ const Error = IDL.Record({message: IDL.Opt(IDL.Text)});
517
+ const Possibility_2 = IDL.Variant({Ok: Ok_1, Err: Error});
518
+ const SettleNeuronsFundParticipationResult = IDL.Record({
519
+ possibility: IDL.Opt(Possibility_2)
520
+ });
521
+ const Possibility_3 = IDL.Variant({
522
+ Ok: IDL.Record({}),
523
+ Err: CanisterCallError
524
+ });
525
+ const SetModeCallResult = IDL.Record({
526
+ possibility: IDL.Opt(Possibility_3)
527
+ });
528
+ const FinalizeSwapResponse = IDL.Record({
529
+ set_dapp_controllers_call_result: IDL.Opt(SetDappControllersCallResult),
530
+ create_sns_neuron_recipes_result: IDL.Opt(SweepResult),
531
+ settle_community_fund_participation_result: IDL.Opt(SettleCommunityFundParticipationResult),
532
+ error_message: IDL.Opt(IDL.Text),
533
+ settle_neurons_fund_participation_result: IDL.Opt(SettleNeuronsFundParticipationResult),
534
+ set_mode_call_result: IDL.Opt(SetModeCallResult),
535
+ sweep_icp_result: IDL.Opt(SweepResult),
536
+ claim_neuron_result: IDL.Opt(SweepResult),
537
+ sweep_sns_result: IDL.Opt(SweepResult)
538
+ });
539
+ const GetAutoFinalizationStatusResponse = IDL.Record({
540
+ auto_finalize_swap_response: IDL.Opt(FinalizeSwapResponse),
541
+ has_auto_finalize_been_attempted: IDL.Opt(IDL.Bool),
542
+ is_auto_finalize_enabled: IDL.Opt(IDL.Bool)
543
+ });
544
+ const GetBuyerStateRequest = IDL.Record({
545
+ principal_id: IDL.Opt(IDL.Principal)
546
+ });
547
+ const TransferableAmount = IDL.Record({
548
+ transfer_fee_paid_e8s: IDL.Opt(IDL.Nat64),
549
+ transfer_start_timestamp_seconds: IDL.Nat64,
550
+ amount_e8s: IDL.Nat64,
551
+ amount_transferred_e8s: IDL.Opt(IDL.Nat64),
552
+ transfer_success_timestamp_seconds: IDL.Nat64
553
+ });
554
+ const BuyerState = IDL.Record({
555
+ icp: IDL.Opt(TransferableAmount),
556
+ has_created_neuron_recipes: IDL.Opt(IDL.Bool)
557
+ });
558
+ const GetBuyerStateResponse = IDL.Record({
559
+ buyer_state: IDL.Opt(BuyerState)
560
+ });
561
+ const GetBuyersTotalResponse = IDL.Record({buyers_total: IDL.Nat64});
562
+ const MemoryMetrics = IDL.Record({
563
+ wasm_binary_size: IDL.Opt(IDL.Nat),
564
+ wasm_chunk_store_size: IDL.Opt(IDL.Nat),
565
+ canister_history_size: IDL.Opt(IDL.Nat),
566
+ stable_memory_size: IDL.Opt(IDL.Nat),
567
+ snapshots_size: IDL.Opt(IDL.Nat),
568
+ wasm_memory_size: IDL.Opt(IDL.Nat),
569
+ global_memory_size: IDL.Opt(IDL.Nat),
570
+ custom_sections_size: IDL.Opt(IDL.Nat)
571
+ });
572
+ const CanisterStatusType = IDL.Variant({
573
+ stopped: IDL.Null,
574
+ stopping: IDL.Null,
575
+ running: IDL.Null
576
+ });
577
+ const DefiniteCanisterSettingsArgs = IDL.Record({
578
+ freezing_threshold: IDL.Nat,
579
+ wasm_memory_threshold: IDL.Opt(IDL.Nat),
580
+ controllers: IDL.Vec(IDL.Principal),
581
+ wasm_memory_limit: IDL.Opt(IDL.Nat),
582
+ memory_allocation: IDL.Nat,
583
+ compute_allocation: IDL.Nat
584
+ });
585
+ const QueryStats = IDL.Record({
586
+ response_payload_bytes_total: IDL.Opt(IDL.Nat),
587
+ num_instructions_total: IDL.Opt(IDL.Nat),
588
+ num_calls_total: IDL.Opt(IDL.Nat),
589
+ request_payload_bytes_total: IDL.Opt(IDL.Nat)
590
+ });
591
+ const CanisterStatusResultV2 = IDL.Record({
592
+ memory_metrics: IDL.Opt(MemoryMetrics),
593
+ status: CanisterStatusType,
594
+ memory_size: IDL.Nat,
595
+ cycles: IDL.Nat,
596
+ settings: DefiniteCanisterSettingsArgs,
597
+ query_stats: IDL.Opt(QueryStats),
598
+ idle_cycles_burned_per_day: IDL.Nat,
599
+ module_hash: IDL.Opt(IDL.Vec(IDL.Nat8))
600
+ });
601
+ const GetDerivedStateResponse = IDL.Record({
602
+ sns_tokens_per_icp: IDL.Opt(IDL.Float64),
603
+ buyer_total_icp_e8s: IDL.Opt(IDL.Nat64),
604
+ cf_participant_count: IDL.Opt(IDL.Nat64),
605
+ neurons_fund_participation_icp_e8s: IDL.Opt(IDL.Nat64),
606
+ direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),
607
+ direct_participant_count: IDL.Opt(IDL.Nat64),
608
+ cf_neuron_count: IDL.Opt(IDL.Nat64)
609
+ });
610
+ const GetInitResponse = IDL.Record({init: IDL.Opt(Init)});
611
+ const GetLifecycleResponse = IDL.Record({
612
+ decentralization_sale_open_timestamp_seconds: IDL.Opt(IDL.Nat64),
613
+ lifecycle: IDL.Opt(IDL.Int32),
614
+ decentralization_swap_termination_timestamp_seconds: IDL.Opt(IDL.Nat64)
615
+ });
616
+ const Icrc1Account = IDL.Record({
617
+ owner: IDL.Opt(IDL.Principal),
618
+ subaccount: IDL.Opt(IDL.Vec(IDL.Nat8))
619
+ });
620
+ const Ticket = IDL.Record({
621
+ creation_time: IDL.Nat64,
622
+ ticket_id: IDL.Nat64,
623
+ account: IDL.Opt(Icrc1Account),
624
+ amount_icp_e8s: IDL.Nat64
625
+ });
626
+ const Ok_2 = IDL.Record({ticket: IDL.Opt(Ticket)});
627
+ const Err_1 = IDL.Record({error_type: IDL.Opt(IDL.Int32)});
628
+ const Result_1 = IDL.Variant({Ok: Ok_2, Err: Err_1});
629
+ const GetOpenTicketResponse = IDL.Record({result: IDL.Opt(Result_1)});
630
+ const Params = IDL.Record({
631
+ min_participant_icp_e8s: IDL.Nat64,
632
+ neuron_basket_construction_parameters: IDL.Opt(NeuronBasketConstructionParameters),
633
+ max_icp_e8s: IDL.Nat64,
634
+ swap_due_timestamp_seconds: IDL.Nat64,
635
+ min_participants: IDL.Nat32,
636
+ sns_token_e8s: IDL.Nat64,
637
+ sale_delay_seconds: IDL.Opt(IDL.Nat64),
638
+ max_participant_icp_e8s: IDL.Nat64,
639
+ min_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),
640
+ min_icp_e8s: IDL.Nat64,
641
+ max_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64)
642
+ });
643
+ const GetSaleParametersResponse = IDL.Record({params: IDL.Opt(Params)});
644
+ const NeuronId = IDL.Record({id: IDL.Vec(IDL.Nat8)});
645
+ const NeuronAttributes = IDL.Record({
646
+ dissolve_delay_seconds: IDL.Nat64,
647
+ memo: IDL.Nat64,
648
+ followees: IDL.Vec(NeuronId)
649
+ });
650
+ const Principals = IDL.Record({principals: IDL.Vec(IDL.Principal)});
651
+ const CfInvestment = IDL.Record({
652
+ controller: IDL.Opt(IDL.Principal),
653
+ hotkey_principal: IDL.Text,
654
+ hotkeys: IDL.Opt(Principals),
655
+ nns_neuron_id: IDL.Nat64
656
+ });
657
+ const DirectInvestment = IDL.Record({buyer_principal: IDL.Text});
658
+ const Investor = IDL.Variant({
659
+ CommunityFund: CfInvestment,
660
+ Direct: DirectInvestment
661
+ });
662
+ const SnsNeuronRecipe = IDL.Record({
663
+ sns: IDL.Opt(TransferableAmount),
664
+ claimed_status: IDL.Opt(IDL.Int32),
665
+ neuron_attributes: IDL.Opt(NeuronAttributes),
666
+ investor: IDL.Opt(Investor)
667
+ });
668
+ const Timers = IDL.Record({
669
+ last_spawned_timestamp_seconds: IDL.Opt(IDL.Nat64),
670
+ last_reset_timestamp_seconds: IDL.Opt(IDL.Nat64),
671
+ requires_periodic_tasks: IDL.Opt(IDL.Bool)
672
+ });
673
+ const CfNeuron = IDL.Record({
674
+ has_created_neuron_recipes: IDL.Opt(IDL.Bool),
675
+ hotkeys: IDL.Opt(Principals),
676
+ nns_neuron_id: IDL.Nat64,
677
+ amount_icp_e8s: IDL.Nat64
678
+ });
679
+ const CfParticipant = IDL.Record({
680
+ controller: IDL.Opt(IDL.Principal),
681
+ hotkey_principal: IDL.Text,
682
+ cf_neurons: IDL.Vec(CfNeuron)
683
+ });
684
+ const Swap = IDL.Record({
685
+ auto_finalize_swap_response: IDL.Opt(FinalizeSwapResponse),
686
+ neuron_recipes: IDL.Vec(SnsNeuronRecipe),
687
+ next_ticket_id: IDL.Opt(IDL.Nat64),
688
+ decentralization_sale_open_timestamp_seconds: IDL.Opt(IDL.Nat64),
689
+ finalize_swap_in_progress: IDL.Opt(IDL.Bool),
690
+ timers: IDL.Opt(Timers),
691
+ cf_participants: IDL.Vec(CfParticipant),
692
+ init: IDL.Opt(Init),
693
+ already_tried_to_auto_finalize: IDL.Opt(IDL.Bool),
694
+ neurons_fund_participation_icp_e8s: IDL.Opt(IDL.Nat64),
695
+ purge_old_tickets_last_completion_timestamp_nanoseconds: IDL.Opt(IDL.Nat64),
696
+ direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),
697
+ lifecycle: IDL.Int32,
698
+ purge_old_tickets_next_principal: IDL.Opt(IDL.Vec(IDL.Nat8)),
699
+ decentralization_swap_termination_timestamp_seconds: IDL.Opt(IDL.Nat64),
700
+ buyers: IDL.Vec(IDL.Tuple(IDL.Text, BuyerState)),
701
+ params: IDL.Opt(Params),
702
+ open_sns_token_swap_proposal_id: IDL.Opt(IDL.Nat64)
703
+ });
704
+ const DerivedState = IDL.Record({
705
+ sns_tokens_per_icp: IDL.Float32,
706
+ buyer_total_icp_e8s: IDL.Nat64,
707
+ cf_participant_count: IDL.Opt(IDL.Nat64),
708
+ neurons_fund_participation_icp_e8s: IDL.Opt(IDL.Nat64),
709
+ direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),
710
+ direct_participant_count: IDL.Opt(IDL.Nat64),
711
+ cf_neuron_count: IDL.Opt(IDL.Nat64)
712
+ });
713
+ const GetStateResponse = IDL.Record({
714
+ swap: IDL.Opt(Swap),
715
+ derived: IDL.Opt(DerivedState)
716
+ });
717
+ const GetTimersResponse = IDL.Record({timers: IDL.Opt(Timers)});
718
+ const ListCommunityFundParticipantsRequest = IDL.Record({
719
+ offset: IDL.Opt(IDL.Nat64),
720
+ limit: IDL.Opt(IDL.Nat32)
721
+ });
722
+ const ListCommunityFundParticipantsResponse = IDL.Record({
723
+ cf_participants: IDL.Vec(CfParticipant)
724
+ });
725
+ const ListDirectParticipantsRequest = IDL.Record({
726
+ offset: IDL.Opt(IDL.Nat32),
727
+ limit: IDL.Opt(IDL.Nat32)
728
+ });
729
+ const Participant = IDL.Record({
730
+ participation: IDL.Opt(BuyerState),
731
+ participant_id: IDL.Opt(IDL.Principal)
732
+ });
733
+ const ListDirectParticipantsResponse = IDL.Record({
734
+ participants: IDL.Vec(Participant)
735
+ });
736
+ const ListSnsNeuronRecipesRequest = IDL.Record({
737
+ offset: IDL.Opt(IDL.Nat64),
738
+ limit: IDL.Opt(IDL.Nat32)
739
+ });
740
+ const ListSnsNeuronRecipesResponse = IDL.Record({
741
+ sns_neuron_recipes: IDL.Vec(SnsNeuronRecipe)
742
+ });
743
+ const NewSaleTicketRequest = IDL.Record({
744
+ subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)),
745
+ amount_icp_e8s: IDL.Nat64
746
+ });
747
+ const InvalidUserAmount = IDL.Record({
748
+ min_amount_icp_e8s_included: IDL.Nat64,
749
+ max_amount_icp_e8s_included: IDL.Nat64
750
+ });
751
+ const Err_2 = IDL.Record({
752
+ invalid_user_amount: IDL.Opt(InvalidUserAmount),
753
+ existing_ticket: IDL.Opt(Ticket),
754
+ error_type: IDL.Int32
755
+ });
756
+ const Result_2 = IDL.Variant({Ok: Ok_2, Err: Err_2});
757
+ const NewSaleTicketResponse = IDL.Record({result: IDL.Opt(Result_2)});
758
+ const RefreshBuyerTokensRequest = IDL.Record({
759
+ confirmation_text: IDL.Opt(IDL.Text),
760
+ buyer: IDL.Text
761
+ });
762
+ const RefreshBuyerTokensResponse = IDL.Record({
763
+ icp_accepted_participation_e8s: IDL.Nat64,
764
+ icp_ledger_account_balance_e8s: IDL.Nat64
765
+ });
766
+
767
+ return IDL.Service({
768
+ error_refund_icp: IDL.Func([ErrorRefundIcpRequest], [ErrorRefundIcpResponse], []),
769
+ finalize_swap: IDL.Func([IDL.Record({})], [FinalizeSwapResponse], []),
770
+ get_auto_finalization_status: IDL.Func(
771
+ [IDL.Record({})],
772
+ [GetAutoFinalizationStatusResponse],
773
+ ['query']
774
+ ),
775
+ get_buyer_state: IDL.Func([GetBuyerStateRequest], [GetBuyerStateResponse], ['query']),
776
+ get_buyers_total: IDL.Func([IDL.Record({})], [GetBuyersTotalResponse], []),
777
+ get_canister_status: IDL.Func([IDL.Record({})], [CanisterStatusResultV2], []),
778
+ get_derived_state: IDL.Func([IDL.Record({})], [GetDerivedStateResponse], ['query']),
779
+ get_init: IDL.Func([IDL.Record({})], [GetInitResponse], ['query']),
780
+ get_lifecycle: IDL.Func([IDL.Record({})], [GetLifecycleResponse], ['query']),
781
+ get_open_ticket: IDL.Func([IDL.Record({})], [GetOpenTicketResponse], ['query']),
782
+ get_sale_parameters: IDL.Func([IDL.Record({})], [GetSaleParametersResponse], ['query']),
783
+ get_state: IDL.Func([IDL.Record({})], [GetStateResponse], ['query']),
784
+ get_timers: IDL.Func([IDL.Record({})], [GetTimersResponse], ['query']),
785
+ list_community_fund_participants: IDL.Func(
786
+ [ListCommunityFundParticipantsRequest],
787
+ [ListCommunityFundParticipantsResponse],
788
+ ['query']
789
+ ),
790
+ list_direct_participants: IDL.Func(
791
+ [ListDirectParticipantsRequest],
792
+ [ListDirectParticipantsResponse],
793
+ ['query']
794
+ ),
795
+ list_sns_neuron_recipes: IDL.Func(
796
+ [ListSnsNeuronRecipesRequest],
797
+ [ListSnsNeuronRecipesResponse],
798
+ ['query']
799
+ ),
800
+ new_sale_ticket: IDL.Func([NewSaleTicketRequest], [NewSaleTicketResponse], []),
801
+ notify_payment_failure: IDL.Func([IDL.Record({})], [Ok_2], []),
802
+ refresh_buyer_tokens: IDL.Func([RefreshBuyerTokensRequest], [RefreshBuyerTokensResponse], []),
803
+ reset_timers: IDL.Func([IDL.Record({})], [IDL.Record({})], [])
804
+ });
805
+ };
806
+
807
+ export const init = ({IDL}) => {
808
+ const NeuronBasketConstructionParameters = IDL.Record({
809
+ dissolve_delay_interval_seconds: IDL.Nat64,
810
+ count: IDL.Nat64
811
+ });
812
+ const LinearScalingCoefficient = IDL.Record({
813
+ slope_numerator: IDL.Opt(IDL.Nat64),
814
+ intercept_icp_e8s: IDL.Opt(IDL.Nat64),
815
+ from_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),
816
+ slope_denominator: IDL.Opt(IDL.Nat64),
817
+ to_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64)
818
+ });
819
+ const IdealMatchedParticipationFunction = IDL.Record({
820
+ serialized_representation: IDL.Opt(IDL.Text)
821
+ });
822
+ const NeuronsFundParticipationConstraints = IDL.Record({
823
+ coefficient_intervals: IDL.Vec(LinearScalingCoefficient),
824
+ max_neurons_fund_participation_icp_e8s: IDL.Opt(IDL.Nat64),
825
+ min_direct_participation_threshold_icp_e8s: IDL.Opt(IDL.Nat64),
826
+ ideal_matched_participation_function: IDL.Opt(IdealMatchedParticipationFunction)
827
+ });
828
+ const Countries = IDL.Record({iso_codes: IDL.Vec(IDL.Text)});
829
+ const Init = IDL.Record({
830
+ nns_proposal_id: IDL.Opt(IDL.Nat64),
831
+ sns_root_canister_id: IDL.Text,
832
+ neurons_fund_participation: IDL.Opt(IDL.Bool),
833
+ min_participant_icp_e8s: IDL.Opt(IDL.Nat64),
834
+ neuron_basket_construction_parameters: IDL.Opt(NeuronBasketConstructionParameters),
835
+ fallback_controller_principal_ids: IDL.Vec(IDL.Text),
836
+ max_icp_e8s: IDL.Opt(IDL.Nat64),
837
+ neuron_minimum_stake_e8s: IDL.Opt(IDL.Nat64),
838
+ confirmation_text: IDL.Opt(IDL.Text),
839
+ swap_start_timestamp_seconds: IDL.Opt(IDL.Nat64),
840
+ swap_due_timestamp_seconds: IDL.Opt(IDL.Nat64),
841
+ min_participants: IDL.Opt(IDL.Nat32),
842
+ sns_token_e8s: IDL.Opt(IDL.Nat64),
843
+ nns_governance_canister_id: IDL.Text,
844
+ transaction_fee_e8s: IDL.Opt(IDL.Nat64),
845
+ icp_ledger_canister_id: IDL.Text,
846
+ sns_ledger_canister_id: IDL.Text,
847
+ neurons_fund_participation_constraints: IDL.Opt(NeuronsFundParticipationConstraints),
848
+ should_auto_finalize: IDL.Opt(IDL.Bool),
849
+ max_participant_icp_e8s: IDL.Opt(IDL.Nat64),
850
+ sns_governance_canister_id: IDL.Text,
851
+ min_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),
852
+ restricted_countries: IDL.Opt(Countries),
853
+ min_icp_e8s: IDL.Opt(IDL.Nat64),
854
+ max_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64)
855
+ });
856
+
857
+ return [Init];
858
+ };