@dfinity/sns 6.0.1 → 7.0.0
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.
- package/README.md +1 -1
- package/dist/index.d.ts +54 -19
- package/dist/index.js +1 -6
- package/dist/index.js.map +4 -4
- package/dist/index.mjs +1 -6
- package/dist/index.mjs.map +4 -4
- package/package.json +3 -8
- package/dist/candid/sns_governance.certified.idl.d.ts +0 -2
- package/dist/candid/sns_governance.certified.idl.js +0 -1432
- package/dist/candid/sns_governance.d.ts +0 -933
- package/dist/candid/sns_governance.did +0 -1069
- package/dist/candid/sns_governance.idl.d.ts +0 -2
- package/dist/candid/sns_governance.idl.js +0 -1440
- package/dist/candid/sns_governance_test.certified.idl.d.ts +0 -2
- package/dist/candid/sns_governance_test.certified.idl.js +0 -1460
- package/dist/candid/sns_governance_test.d.ts +0 -962
- package/dist/candid/sns_governance_test.did +0 -1094
- package/dist/candid/sns_governance_test.idl.d.ts +0 -2
- package/dist/candid/sns_governance_test.idl.js +0 -1468
- package/dist/candid/sns_root.certified.idl.d.ts +0 -2
- package/dist/candid/sns_root.certified.idl.js +0 -251
- package/dist/candid/sns_root.d.ts +0 -212
- package/dist/candid/sns_root.did +0 -231
- package/dist/candid/sns_root.idl.d.ts +0 -2
- package/dist/candid/sns_root.idl.js +0 -251
- package/dist/candid/sns_swap.certified.idl.d.ts +0 -2
- package/dist/candid/sns_swap.certified.idl.js +0 -499
- package/dist/candid/sns_swap.d.ts +0 -438
- package/dist/candid/sns_swap.did +0 -505
- package/dist/candid/sns_swap.idl.d.ts +0 -2
- package/dist/candid/sns_swap.idl.js +0 -507
- package/dist/constants/governance.constants.d.ts +0 -8
- package/dist/converters/governance.converters.d.ts +0 -22
- package/dist/converters/swap.converters.d.ts +0 -3
- package/dist/enums/governance.enums.d.ts +0 -35
- package/dist/enums/swap.enums.d.ts +0 -22
- package/dist/errors/common.errors.d.ts +0 -4
- package/dist/errors/governance.errors.d.ts +0 -2
- package/dist/errors/swap.errors.d.ts +0 -16
- package/dist/governance.canister.d.ts +0 -138
- package/dist/governance_test.canister.d.ts +0 -16
- package/dist/root.canister.d.ts +0 -19
- package/dist/sns.d.ts +0 -21
- package/dist/sns.wrapper.d.ts +0 -160
- package/dist/swap.canister.d.ts +0 -47
- package/dist/types/actions.d.ts +0 -191
- package/dist/types/canister.options.d.ts +0 -5
- package/dist/types/common.d.ts +0 -2
- package/dist/types/governance.params.d.ts +0 -151
- package/dist/types/governance_test.params.d.ts +0 -7
- package/dist/types/swap.params.d.ts +0 -8
- package/dist/utils/error.utils.d.ts +0 -12
- package/dist/utils/governance.utils.d.ts +0 -14
|
@@ -1,499 +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
|
-
[],
|
|
385
|
-
),
|
|
386
|
-
get_buyer_state: IDL.Func(
|
|
387
|
-
[GetBuyerStateRequest],
|
|
388
|
-
[GetBuyerStateResponse],
|
|
389
|
-
[],
|
|
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
|
-
[],
|
|
401
|
-
),
|
|
402
|
-
get_init: IDL.Func([IDL.Record({})], [GetInitResponse], []),
|
|
403
|
-
get_lifecycle: IDL.Func([IDL.Record({})], [GetLifecycleResponse], []),
|
|
404
|
-
get_open_ticket: IDL.Func([IDL.Record({})], [GetOpenTicketResponse], []),
|
|
405
|
-
get_sale_parameters: IDL.Func(
|
|
406
|
-
[IDL.Record({})],
|
|
407
|
-
[GetSaleParametersResponse],
|
|
408
|
-
[],
|
|
409
|
-
),
|
|
410
|
-
get_state: IDL.Func([IDL.Record({})], [GetStateResponse], []),
|
|
411
|
-
get_timers: IDL.Func([IDL.Record({})], [GetTimersResponse], []),
|
|
412
|
-
list_community_fund_participants: IDL.Func(
|
|
413
|
-
[ListCommunityFundParticipantsRequest],
|
|
414
|
-
[ListCommunityFundParticipantsResponse],
|
|
415
|
-
[],
|
|
416
|
-
),
|
|
417
|
-
list_direct_participants: IDL.Func(
|
|
418
|
-
[ListDirectParticipantsRequest],
|
|
419
|
-
[ListDirectParticipantsResponse],
|
|
420
|
-
[],
|
|
421
|
-
),
|
|
422
|
-
list_sns_neuron_recipes: IDL.Func(
|
|
423
|
-
[ListSnsNeuronRecipesRequest],
|
|
424
|
-
[ListSnsNeuronRecipesResponse],
|
|
425
|
-
[],
|
|
426
|
-
),
|
|
427
|
-
new_sale_ticket: IDL.Func(
|
|
428
|
-
[NewSaleTicketRequest],
|
|
429
|
-
[NewSaleTicketResponse],
|
|
430
|
-
[],
|
|
431
|
-
),
|
|
432
|
-
notify_payment_failure: IDL.Func([IDL.Record({})], [Ok_2], []),
|
|
433
|
-
refresh_buyer_tokens: IDL.Func(
|
|
434
|
-
[RefreshBuyerTokensRequest],
|
|
435
|
-
[RefreshBuyerTokensResponse],
|
|
436
|
-
[],
|
|
437
|
-
),
|
|
438
|
-
reset_timers: IDL.Func([IDL.Record({})], [IDL.Record({})], []),
|
|
439
|
-
});
|
|
440
|
-
};
|
|
441
|
-
|
|
442
|
-
export const init = ({ IDL }) => {
|
|
443
|
-
const NeuronBasketConstructionParameters = IDL.Record({
|
|
444
|
-
dissolve_delay_interval_seconds: IDL.Nat64,
|
|
445
|
-
count: IDL.Nat64,
|
|
446
|
-
});
|
|
447
|
-
const LinearScalingCoefficient = IDL.Record({
|
|
448
|
-
slope_numerator: IDL.Opt(IDL.Nat64),
|
|
449
|
-
intercept_icp_e8s: IDL.Opt(IDL.Nat64),
|
|
450
|
-
from_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),
|
|
451
|
-
slope_denominator: IDL.Opt(IDL.Nat64),
|
|
452
|
-
to_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),
|
|
453
|
-
});
|
|
454
|
-
const IdealMatchedParticipationFunction = IDL.Record({
|
|
455
|
-
serialized_representation: IDL.Opt(IDL.Text),
|
|
456
|
-
});
|
|
457
|
-
const NeuronsFundParticipationConstraints = IDL.Record({
|
|
458
|
-
coefficient_intervals: IDL.Vec(LinearScalingCoefficient),
|
|
459
|
-
max_neurons_fund_participation_icp_e8s: IDL.Opt(IDL.Nat64),
|
|
460
|
-
min_direct_participation_threshold_icp_e8s: IDL.Opt(IDL.Nat64),
|
|
461
|
-
ideal_matched_participation_function: IDL.Opt(
|
|
462
|
-
IdealMatchedParticipationFunction,
|
|
463
|
-
),
|
|
464
|
-
});
|
|
465
|
-
const Countries = IDL.Record({ iso_codes: IDL.Vec(IDL.Text) });
|
|
466
|
-
const Init = IDL.Record({
|
|
467
|
-
nns_proposal_id: IDL.Opt(IDL.Nat64),
|
|
468
|
-
sns_root_canister_id: IDL.Text,
|
|
469
|
-
neurons_fund_participation: IDL.Opt(IDL.Bool),
|
|
470
|
-
min_participant_icp_e8s: IDL.Opt(IDL.Nat64),
|
|
471
|
-
neuron_basket_construction_parameters: IDL.Opt(
|
|
472
|
-
NeuronBasketConstructionParameters,
|
|
473
|
-
),
|
|
474
|
-
fallback_controller_principal_ids: IDL.Vec(IDL.Text),
|
|
475
|
-
max_icp_e8s: IDL.Opt(IDL.Nat64),
|
|
476
|
-
neuron_minimum_stake_e8s: IDL.Opt(IDL.Nat64),
|
|
477
|
-
confirmation_text: IDL.Opt(IDL.Text),
|
|
478
|
-
swap_start_timestamp_seconds: IDL.Opt(IDL.Nat64),
|
|
479
|
-
swap_due_timestamp_seconds: IDL.Opt(IDL.Nat64),
|
|
480
|
-
min_participants: IDL.Opt(IDL.Nat32),
|
|
481
|
-
sns_token_e8s: IDL.Opt(IDL.Nat64),
|
|
482
|
-
nns_governance_canister_id: IDL.Text,
|
|
483
|
-
transaction_fee_e8s: IDL.Opt(IDL.Nat64),
|
|
484
|
-
icp_ledger_canister_id: IDL.Text,
|
|
485
|
-
sns_ledger_canister_id: IDL.Text,
|
|
486
|
-
neurons_fund_participation_constraints: IDL.Opt(
|
|
487
|
-
NeuronsFundParticipationConstraints,
|
|
488
|
-
),
|
|
489
|
-
should_auto_finalize: IDL.Opt(IDL.Bool),
|
|
490
|
-
max_participant_icp_e8s: IDL.Opt(IDL.Nat64),
|
|
491
|
-
sns_governance_canister_id: IDL.Text,
|
|
492
|
-
min_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),
|
|
493
|
-
restricted_countries: IDL.Opt(Countries),
|
|
494
|
-
min_icp_e8s: IDL.Opt(IDL.Nat64),
|
|
495
|
-
max_direct_participation_icp_e8s: IDL.Opt(IDL.Nat64),
|
|
496
|
-
});
|
|
497
|
-
|
|
498
|
-
return [Init];
|
|
499
|
-
};
|