@dfinity/sns 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +5 -0
  3. package/dist/candid/ledger.certified.idl.d.ts +2 -0
  4. package/dist/candid/ledger.certified.idl.js +97 -0
  5. package/dist/candid/ledger.d.ts +106 -0
  6. package/dist/candid/ledger.did +250 -0
  7. package/dist/candid/ledger.idl.d.ts +2 -0
  8. package/dist/candid/ledger.idl.js +109 -0
  9. package/dist/candid/sns_governance.certified.idl.d.ts +2 -0
  10. package/dist/candid/sns_governance.certified.idl.js +596 -0
  11. package/dist/candid/sns_governance.d.ts +366 -0
  12. package/dist/candid/sns_governance.did +303 -0
  13. package/dist/candid/sns_governance.idl.d.ts +2 -0
  14. package/dist/candid/sns_governance.idl.js +600 -0
  15. package/dist/candid/sns_root.certified.idl.d.ts +2 -0
  16. package/dist/candid/sns_root.certified.idl.js +34 -0
  17. package/dist/candid/sns_root.d.ts +28 -0
  18. package/dist/candid/sns_root.did +26 -0
  19. package/dist/candid/sns_root.idl.d.ts +2 -0
  20. package/dist/candid/sns_root.idl.js +34 -0
  21. package/dist/candid/sns_swap.certified.idl.d.ts +2 -0
  22. package/dist/candid/sns_swap.certified.idl.js +110 -0
  23. package/dist/candid/sns_swap.d.ts +81 -0
  24. package/dist/candid/sns_swap.did +61 -0
  25. package/dist/candid/sns_swap.idl.d.ts +2 -0
  26. package/dist/candid/sns_swap.idl.js +110 -0
  27. package/dist/cjs/index.cjs.js +853 -0
  28. package/dist/cjs/index.cjs.js.map +7 -0
  29. package/dist/esm/chunk-7F6PCBCJ.js +2 -0
  30. package/dist/esm/chunk-7F6PCBCJ.js.map +7 -0
  31. package/dist/esm/chunk-A576P2ZR.js +2 -0
  32. package/dist/esm/chunk-A576P2ZR.js.map +7 -0
  33. package/dist/esm/chunk-LXL5LYD3.js +2 -0
  34. package/dist/esm/chunk-LXL5LYD3.js.map +7 -0
  35. package/dist/esm/chunk-RB6XGLR7.js +2 -0
  36. package/dist/esm/chunk-RB6XGLR7.js.map +7 -0
  37. package/dist/esm/chunk-VMVMYL6O.js +840 -0
  38. package/dist/esm/chunk-VMVMYL6O.js.map +7 -0
  39. package/dist/esm/chunk-WPRZTZWQ.js +2 -0
  40. package/dist/esm/chunk-WPRZTZWQ.js.map +7 -0
  41. package/dist/esm/chunk-YKP66JDM.js +2 -0
  42. package/dist/esm/chunk-YKP66JDM.js.map +7 -0
  43. package/dist/esm/chunk-YL4WAPXH.js +2 -0
  44. package/dist/esm/chunk-YL4WAPXH.js.map +7 -0
  45. package/dist/esm/governance.canister.js +2 -0
  46. package/dist/esm/governance.canister.js.map +7 -0
  47. package/dist/esm/index.js +2 -0
  48. package/dist/esm/index.js.map +7 -0
  49. package/dist/esm/ledger.canister.js +2 -0
  50. package/dist/esm/ledger.canister.js.map +7 -0
  51. package/dist/esm/root.canister.js +2 -0
  52. package/dist/esm/root.canister.js.map +7 -0
  53. package/dist/esm/sns.js +2 -0
  54. package/dist/esm/sns.js.map +7 -0
  55. package/dist/esm/sns.wrapper.js +2 -0
  56. package/dist/esm/sns.wrapper.js.map +7 -0
  57. package/dist/index.cjs.js +1 -0
  58. package/dist/index.js +1 -0
  59. package/dist/types/constants/governance.constants.d.ts +6 -0
  60. package/dist/types/governance.canister.d.ts +13 -0
  61. package/dist/types/index.d.ts +10 -0
  62. package/dist/types/ledger.canister.d.ts +6 -0
  63. package/dist/types/root.canister.d.ts +22 -0
  64. package/dist/types/services/canister.d.ts +10 -0
  65. package/dist/types/sns.d.ts +21 -0
  66. package/dist/types/sns.wrapper.d.ts +43 -0
  67. package/dist/types/types/canister.options.d.ts +8 -0
  68. package/dist/types/types/governance.params.d.ts +14 -0
  69. package/dist/types/types/query.params.d.ts +7 -0
  70. package/dist/types/utils/actor.utils.d.ts +14 -0
  71. package/dist/types/utils/agent.utils.d.ts +5 -0
  72. package/dist/types/utils/asserts.utils.d.ts +3 -0
  73. package/dist/types/utils/did.utils.d.ts +1 -0
  74. package/package.json +40 -0
@@ -0,0 +1,596 @@
1
+ /* Do not edit. Compiled with ./scripts/compile-idl-js from packages/sns/candid/sns_governance.did */
2
+ export const idlFactory = ({ IDL }) => {
3
+ const GenericNervousSystemFunction = IDL.Record({
4
+ 'validator_canister_id' : IDL.Opt(IDL.Principal),
5
+ 'target_canister_id' : IDL.Opt(IDL.Principal),
6
+ 'validator_method_name' : IDL.Opt(IDL.Text),
7
+ 'target_method_name' : IDL.Opt(IDL.Text),
8
+ });
9
+ const FunctionType = IDL.Variant({
10
+ 'NativeNervousSystemFunction' : IDL.Record({}),
11
+ 'GenericNervousSystemFunction' : GenericNervousSystemFunction,
12
+ });
13
+ const NervousSystemFunction = IDL.Record({
14
+ 'id' : IDL.Nat64,
15
+ 'name' : IDL.Text,
16
+ 'description' : IDL.Opt(IDL.Text),
17
+ 'function_type' : IDL.Opt(FunctionType),
18
+ });
19
+ const GovernanceCachedMetrics = IDL.Record({
20
+ 'not_dissolving_neurons_e8s_buckets' : IDL.Vec(
21
+ IDL.Tuple(IDL.Nat64, IDL.Float64)
22
+ ),
23
+ 'garbage_collectable_neurons_count' : IDL.Nat64,
24
+ 'neurons_with_invalid_stake_count' : IDL.Nat64,
25
+ 'not_dissolving_neurons_count_buckets' : IDL.Vec(
26
+ IDL.Tuple(IDL.Nat64, IDL.Nat64)
27
+ ),
28
+ 'neurons_with_less_than_6_months_dissolve_delay_count' : IDL.Nat64,
29
+ 'dissolved_neurons_count' : IDL.Nat64,
30
+ 'total_staked_e8s' : IDL.Nat64,
31
+ 'total_supply_governance_tokens' : IDL.Nat64,
32
+ 'not_dissolving_neurons_count' : IDL.Nat64,
33
+ 'dissolved_neurons_e8s' : IDL.Nat64,
34
+ 'neurons_with_less_than_6_months_dissolve_delay_e8s' : IDL.Nat64,
35
+ 'dissolving_neurons_count_buckets' : IDL.Vec(
36
+ IDL.Tuple(IDL.Nat64, IDL.Nat64)
37
+ ),
38
+ 'dissolving_neurons_count' : IDL.Nat64,
39
+ 'dissolving_neurons_e8s_buckets' : IDL.Vec(
40
+ IDL.Tuple(IDL.Nat64, IDL.Float64)
41
+ ),
42
+ 'timestamp_seconds' : IDL.Nat64,
43
+ });
44
+ const NeuronId = IDL.Record({ 'id' : IDL.Vec(IDL.Nat8) });
45
+ const Followees = IDL.Record({ 'followees' : IDL.Vec(NeuronId) });
46
+ const DefaultFollowees = IDL.Record({
47
+ 'followees' : IDL.Vec(IDL.Tuple(IDL.Nat64, Followees)),
48
+ });
49
+ const NeuronPermissionList = IDL.Record({
50
+ 'permissions' : IDL.Vec(IDL.Int32),
51
+ });
52
+ const NervousSystemParameters = IDL.Record({
53
+ 'default_followees' : IDL.Opt(DefaultFollowees),
54
+ 'max_dissolve_delay_seconds' : IDL.Opt(IDL.Nat64),
55
+ 'max_followees_per_function' : IDL.Opt(IDL.Nat64),
56
+ 'neuron_claimer_permissions' : IDL.Opt(NeuronPermissionList),
57
+ 'neuron_minimum_stake_e8s' : IDL.Opt(IDL.Nat64),
58
+ 'initial_voting_period' : IDL.Opt(IDL.Nat64),
59
+ 'max_neuron_age_for_age_bonus' : IDL.Opt(IDL.Nat64),
60
+ 'neuron_minimum_dissolve_delay_to_vote_seconds' : IDL.Opt(IDL.Nat64),
61
+ 'reject_cost_e8s' : IDL.Opt(IDL.Nat64),
62
+ 'max_proposals_to_keep_per_action' : IDL.Opt(IDL.Nat32),
63
+ 'max_number_of_neurons' : IDL.Opt(IDL.Nat64),
64
+ 'transaction_fee_e8s' : IDL.Opt(IDL.Nat64),
65
+ 'max_number_of_proposals_with_ballots' : IDL.Opt(IDL.Nat64),
66
+ 'reward_distribution_period_seconds' : IDL.Opt(IDL.Nat64),
67
+ 'neuron_grantable_permissions' : IDL.Opt(NeuronPermissionList),
68
+ 'max_number_of_principals_per_neuron' : IDL.Opt(IDL.Nat64),
69
+ });
70
+ const ProposalId = IDL.Record({ 'id' : IDL.Nat64 });
71
+ const RewardEvent = IDL.Record({
72
+ 'actual_timestamp_seconds' : IDL.Nat64,
73
+ 'periods_since_genesis' : IDL.Nat64,
74
+ 'distributed_e8s_equivalent' : IDL.Nat64,
75
+ 'settled_proposals' : IDL.Vec(ProposalId),
76
+ });
77
+ const GovernanceError = IDL.Record({
78
+ 'error_message' : IDL.Text,
79
+ 'error_type' : IDL.Int32,
80
+ });
81
+ const Ballot = IDL.Record({
82
+ 'vote' : IDL.Int32,
83
+ 'cast_timestamp_seconds' : IDL.Nat64,
84
+ 'voting_power' : IDL.Nat64,
85
+ });
86
+ const Tally = IDL.Record({
87
+ 'no' : IDL.Nat64,
88
+ 'yes' : IDL.Nat64,
89
+ 'total' : IDL.Nat64,
90
+ 'timestamp_seconds' : IDL.Nat64,
91
+ });
92
+ const UpgradeSnsControlledCanister = IDL.Record({
93
+ 'new_canister_wasm' : IDL.Vec(IDL.Nat8),
94
+ 'canister_id' : IDL.Opt(IDL.Principal),
95
+ });
96
+ const ExecuteGenericNervousSystemFunction = IDL.Record({
97
+ 'function_id' : IDL.Nat64,
98
+ 'payload' : IDL.Vec(IDL.Nat8),
99
+ });
100
+ const Motion = IDL.Record({ 'motion_text' : IDL.Text });
101
+ const Action = IDL.Variant({
102
+ 'ManageNervousSystemParameters' : NervousSystemParameters,
103
+ 'AddGenericNervousSystemFunction' : NervousSystemFunction,
104
+ 'RemoveGenericNervousSystemFunction' : IDL.Nat64,
105
+ 'UpgradeSnsControlledCanister' : UpgradeSnsControlledCanister,
106
+ 'Unspecified' : IDL.Record({}),
107
+ 'ExecuteGenericNervousSystemFunction' : ExecuteGenericNervousSystemFunction,
108
+ 'Motion' : Motion,
109
+ });
110
+ const Proposal = IDL.Record({
111
+ 'url' : IDL.Text,
112
+ 'title' : IDL.Text,
113
+ 'action' : IDL.Opt(Action),
114
+ 'summary' : IDL.Text,
115
+ });
116
+ const WaitForQuietState = IDL.Record({
117
+ 'current_deadline_timestamp_seconds' : IDL.Nat64,
118
+ });
119
+ const ProposalData = IDL.Record({
120
+ 'id' : IDL.Opt(ProposalId),
121
+ 'payload_text_rendering' : IDL.Opt(IDL.Text),
122
+ 'action' : IDL.Nat64,
123
+ 'failure_reason' : IDL.Opt(GovernanceError),
124
+ 'ballots' : IDL.Vec(IDL.Tuple(IDL.Text, Ballot)),
125
+ 'reward_event_round' : IDL.Nat64,
126
+ 'failed_timestamp_seconds' : IDL.Nat64,
127
+ 'proposal_creation_timestamp_seconds' : IDL.Nat64,
128
+ 'reject_cost_e8s' : IDL.Nat64,
129
+ 'latest_tally' : IDL.Opt(Tally),
130
+ 'decided_timestamp_seconds' : IDL.Nat64,
131
+ 'proposal' : IDL.Opt(Proposal),
132
+ 'proposer' : IDL.Opt(NeuronId),
133
+ 'wait_for_quiet_state' : IDL.Opt(WaitForQuietState),
134
+ 'executed_timestamp_seconds' : IDL.Nat64,
135
+ });
136
+ const Split = IDL.Record({ 'memo' : IDL.Nat64, 'amount_e8s' : IDL.Nat64 });
137
+ const Follow = IDL.Record({
138
+ 'function_id' : IDL.Nat64,
139
+ 'followees' : IDL.Vec(NeuronId),
140
+ });
141
+ const AccountIdentifier = IDL.Record({ 'hash' : IDL.Vec(IDL.Nat8) });
142
+ const DisburseMaturity = IDL.Record({
143
+ 'to_account' : IDL.Opt(AccountIdentifier),
144
+ 'percentage_to_disburse' : IDL.Nat32,
145
+ });
146
+ const IncreaseDissolveDelay = IDL.Record({
147
+ 'additional_dissolve_delay_seconds' : IDL.Nat32,
148
+ });
149
+ const SetDissolveTimestamp = IDL.Record({
150
+ 'dissolve_timestamp_seconds' : IDL.Nat64,
151
+ });
152
+ const Operation = IDL.Variant({
153
+ 'StopDissolving' : IDL.Record({}),
154
+ 'StartDissolving' : IDL.Record({}),
155
+ 'IncreaseDissolveDelay' : IncreaseDissolveDelay,
156
+ 'SetDissolveTimestamp' : SetDissolveTimestamp,
157
+ });
158
+ const Configure = IDL.Record({ 'operation' : IDL.Opt(Operation) });
159
+ const RegisterVote = IDL.Record({
160
+ 'vote' : IDL.Int32,
161
+ 'proposal' : IDL.Opt(ProposalId),
162
+ });
163
+ const MemoAndController = IDL.Record({
164
+ 'controller' : IDL.Opt(IDL.Principal),
165
+ 'memo' : IDL.Nat64,
166
+ });
167
+ const By = IDL.Variant({
168
+ 'MemoAndController' : MemoAndController,
169
+ 'NeuronId' : IDL.Record({}),
170
+ });
171
+ const ClaimOrRefresh = IDL.Record({ 'by' : IDL.Opt(By) });
172
+ const RemoveNeuronPermissions = IDL.Record({
173
+ 'permissions_to_remove' : IDL.Opt(NeuronPermissionList),
174
+ 'principal_id' : IDL.Opt(IDL.Principal),
175
+ });
176
+ const AddNeuronPermissions = IDL.Record({
177
+ 'permissions_to_add' : IDL.Opt(NeuronPermissionList),
178
+ 'principal_id' : IDL.Opt(IDL.Principal),
179
+ });
180
+ const MergeMaturity = IDL.Record({ 'percentage_to_merge' : IDL.Nat32 });
181
+ const Amount = IDL.Record({ 'e8s' : IDL.Nat64 });
182
+ const Disburse = IDL.Record({
183
+ 'to_account' : IDL.Opt(AccountIdentifier),
184
+ 'amount' : IDL.Opt(Amount),
185
+ });
186
+ const Command_2 = IDL.Variant({
187
+ 'Split' : Split,
188
+ 'Follow' : Follow,
189
+ 'DisburseMaturity' : DisburseMaturity,
190
+ 'Configure' : Configure,
191
+ 'RegisterVote' : RegisterVote,
192
+ 'MakeProposal' : Proposal,
193
+ 'ClaimOrRefreshNeuron' : ClaimOrRefresh,
194
+ 'RemoveNeuronPermissions' : RemoveNeuronPermissions,
195
+ 'AddNeuronPermissions' : AddNeuronPermissions,
196
+ 'MergeMaturity' : MergeMaturity,
197
+ 'Disburse' : Disburse,
198
+ });
199
+ const NeuronInFlightCommand = IDL.Record({
200
+ 'command' : IDL.Opt(Command_2),
201
+ 'timestamp' : IDL.Nat64,
202
+ });
203
+ const NeuronPermission = IDL.Record({
204
+ 'principal' : IDL.Opt(IDL.Principal),
205
+ 'permission_type' : IDL.Vec(IDL.Int32),
206
+ });
207
+ const DissolveState = IDL.Variant({
208
+ 'DissolveDelaySeconds' : IDL.Nat64,
209
+ 'WhenDissolvedTimestampSeconds' : IDL.Nat64,
210
+ });
211
+ const Neuron = IDL.Record({
212
+ 'id' : IDL.Opt(NeuronId),
213
+ 'permissions' : IDL.Vec(NeuronPermission),
214
+ 'maturity_e8s_equivalent' : IDL.Nat64,
215
+ 'cached_neuron_stake_e8s' : IDL.Nat64,
216
+ 'created_timestamp_seconds' : IDL.Nat64,
217
+ 'aging_since_timestamp_seconds' : IDL.Nat64,
218
+ 'dissolve_state' : IDL.Opt(DissolveState),
219
+ 'followees' : IDL.Vec(IDL.Tuple(IDL.Nat64, Followees)),
220
+ 'neuron_fees_e8s' : IDL.Nat64,
221
+ });
222
+ const Governance = IDL.Record({
223
+ 'root_canister_id' : IDL.Opt(IDL.Principal),
224
+ 'id_to_nervous_system_functions' : IDL.Vec(
225
+ IDL.Tuple(IDL.Nat64, NervousSystemFunction)
226
+ ),
227
+ 'metrics' : IDL.Opt(GovernanceCachedMetrics),
228
+ 'mode' : IDL.Int32,
229
+ 'parameters' : IDL.Opt(NervousSystemParameters),
230
+ 'latest_reward_event' : IDL.Opt(RewardEvent),
231
+ 'ledger_canister_id' : IDL.Opt(IDL.Principal),
232
+ 'proposals' : IDL.Vec(IDL.Tuple(IDL.Nat64, ProposalData)),
233
+ 'in_flight_commands' : IDL.Vec(IDL.Tuple(IDL.Text, NeuronInFlightCommand)),
234
+ 'neurons' : IDL.Vec(IDL.Tuple(IDL.Text, Neuron)),
235
+ 'genesis_timestamp_seconds' : IDL.Nat64,
236
+ });
237
+ const GetNeuron = IDL.Record({ 'neuron_id' : IDL.Opt(NeuronId) });
238
+ const Result = IDL.Variant({ 'Error' : GovernanceError, 'Neuron' : Neuron });
239
+ const GetNeuronResponse = IDL.Record({ 'result' : IDL.Opt(Result) });
240
+ const GetProposal = IDL.Record({ 'proposal_id' : IDL.Opt(ProposalId) });
241
+ const Result_1 = IDL.Variant({
242
+ 'Error' : GovernanceError,
243
+ 'Proposal' : ProposalData,
244
+ });
245
+ const GetProposalResponse = IDL.Record({ 'result' : IDL.Opt(Result_1) });
246
+ const CanisterStatusType = IDL.Variant({
247
+ 'stopped' : IDL.Null,
248
+ 'stopping' : IDL.Null,
249
+ 'running' : IDL.Null,
250
+ });
251
+ const DefiniteCanisterSettingsArgs = IDL.Record({
252
+ 'controller' : IDL.Principal,
253
+ 'freezing_threshold' : IDL.Nat,
254
+ 'controllers' : IDL.Vec(IDL.Principal),
255
+ 'memory_allocation' : IDL.Nat,
256
+ 'compute_allocation' : IDL.Nat,
257
+ });
258
+ const CanisterStatusResultV2 = IDL.Record({
259
+ 'controller' : IDL.Principal,
260
+ 'status' : CanisterStatusType,
261
+ 'freezing_threshold' : IDL.Nat,
262
+ 'balance' : IDL.Vec(IDL.Tuple(IDL.Vec(IDL.Nat8), IDL.Nat)),
263
+ 'memory_size' : IDL.Nat,
264
+ 'cycles' : IDL.Nat,
265
+ 'settings' : DefiniteCanisterSettingsArgs,
266
+ 'idle_cycles_burned_per_day' : IDL.Nat,
267
+ 'module_hash' : IDL.Opt(IDL.Vec(IDL.Nat8)),
268
+ });
269
+ const ListNervousSystemFunctionsResponse = IDL.Record({
270
+ 'reserved_ids' : IDL.Vec(IDL.Nat64),
271
+ 'functions' : IDL.Vec(NervousSystemFunction),
272
+ });
273
+ const ListNeurons = IDL.Record({
274
+ 'of_principal' : IDL.Opt(IDL.Principal),
275
+ 'limit' : IDL.Nat32,
276
+ 'start_page_at' : IDL.Opt(NeuronId),
277
+ });
278
+ const ListNeuronsResponse = IDL.Record({ 'neurons' : IDL.Vec(Neuron) });
279
+ const ListProposals = IDL.Record({
280
+ 'include_reward_status' : IDL.Vec(IDL.Int32),
281
+ 'before_proposal' : IDL.Opt(ProposalId),
282
+ 'limit' : IDL.Nat32,
283
+ 'exclude_type' : IDL.Vec(IDL.Nat64),
284
+ 'include_status' : IDL.Vec(IDL.Int32),
285
+ });
286
+ const ListProposalsResponse = IDL.Record({
287
+ 'proposals' : IDL.Vec(ProposalData),
288
+ });
289
+ const Command = IDL.Variant({
290
+ 'Split' : Split,
291
+ 'Follow' : Follow,
292
+ 'DisburseMaturity' : DisburseMaturity,
293
+ 'ClaimOrRefresh' : ClaimOrRefresh,
294
+ 'Configure' : Configure,
295
+ 'RegisterVote' : RegisterVote,
296
+ 'MakeProposal' : Proposal,
297
+ 'RemoveNeuronPermissions' : RemoveNeuronPermissions,
298
+ 'AddNeuronPermissions' : AddNeuronPermissions,
299
+ 'MergeMaturity' : MergeMaturity,
300
+ 'Disburse' : Disburse,
301
+ });
302
+ const ManageNeuron = IDL.Record({
303
+ 'subaccount' : IDL.Vec(IDL.Nat8),
304
+ 'command' : IDL.Opt(Command),
305
+ });
306
+ const SplitResponse = IDL.Record({ 'created_neuron_id' : IDL.Opt(NeuronId) });
307
+ const DisburseMaturityResponse = IDL.Record({
308
+ 'transfer_block_height' : IDL.Nat64,
309
+ 'amount_disbursed_e8s' : IDL.Nat64,
310
+ });
311
+ const ClaimOrRefreshResponse = IDL.Record({
312
+ 'refreshed_neuron_id' : IDL.Opt(NeuronId),
313
+ });
314
+ const MergeMaturityResponse = IDL.Record({
315
+ 'merged_maturity_e8s' : IDL.Nat64,
316
+ 'new_stake_e8s' : IDL.Nat64,
317
+ });
318
+ const DisburseResponse = IDL.Record({ 'transfer_block_height' : IDL.Nat64 });
319
+ const Command_1 = IDL.Variant({
320
+ 'Error' : GovernanceError,
321
+ 'Split' : SplitResponse,
322
+ 'Follow' : IDL.Record({}),
323
+ 'DisburseMaturity' : DisburseMaturityResponse,
324
+ 'ClaimOrRefresh' : ClaimOrRefreshResponse,
325
+ 'Configure' : IDL.Record({}),
326
+ 'RegisterVote' : IDL.Record({}),
327
+ 'MakeProposal' : GetProposal,
328
+ 'RemoveNeuronPermission' : IDL.Record({}),
329
+ 'MergeMaturity' : MergeMaturityResponse,
330
+ 'Disburse' : DisburseResponse,
331
+ 'AddNeuronPermission' : IDL.Record({}),
332
+ });
333
+ const ManageNeuronResponse = IDL.Record({ 'command' : IDL.Opt(Command_1) });
334
+ const SetMode = IDL.Record({ 'mode' : IDL.Int32 });
335
+ return IDL.Service({
336
+ 'get_build_metadata' : IDL.Func([], [IDL.Text], []),
337
+ 'get_nervous_system_parameters' : IDL.Func(
338
+ [IDL.Null],
339
+ [NervousSystemParameters],
340
+ [],
341
+ ),
342
+ 'get_neuron' : IDL.Func([GetNeuron], [GetNeuronResponse], []),
343
+ 'get_proposal' : IDL.Func([GetProposal], [GetProposalResponse], []),
344
+ 'get_root_canister_status' : IDL.Func(
345
+ [IDL.Null],
346
+ [CanisterStatusResultV2],
347
+ [],
348
+ ),
349
+ 'list_nervous_system_functions' : IDL.Func(
350
+ [],
351
+ [ListNervousSystemFunctionsResponse],
352
+ [],
353
+ ),
354
+ 'list_neurons' : IDL.Func([ListNeurons], [ListNeuronsResponse], []),
355
+ 'list_proposals' : IDL.Func([ListProposals], [ListProposalsResponse], []),
356
+ 'manage_neuron' : IDL.Func([ManageNeuron], [ManageNeuronResponse], []),
357
+ 'set_mode' : IDL.Func([SetMode], [IDL.Record({})], []),
358
+ });
359
+ };
360
+ export const init = ({ IDL }) => {
361
+ const GenericNervousSystemFunction = IDL.Record({
362
+ 'validator_canister_id' : IDL.Opt(IDL.Principal),
363
+ 'target_canister_id' : IDL.Opt(IDL.Principal),
364
+ 'validator_method_name' : IDL.Opt(IDL.Text),
365
+ 'target_method_name' : IDL.Opt(IDL.Text),
366
+ });
367
+ const FunctionType = IDL.Variant({
368
+ 'NativeNervousSystemFunction' : IDL.Record({}),
369
+ 'GenericNervousSystemFunction' : GenericNervousSystemFunction,
370
+ });
371
+ const NervousSystemFunction = IDL.Record({
372
+ 'id' : IDL.Nat64,
373
+ 'name' : IDL.Text,
374
+ 'description' : IDL.Opt(IDL.Text),
375
+ 'function_type' : IDL.Opt(FunctionType),
376
+ });
377
+ const GovernanceCachedMetrics = IDL.Record({
378
+ 'not_dissolving_neurons_e8s_buckets' : IDL.Vec(
379
+ IDL.Tuple(IDL.Nat64, IDL.Float64)
380
+ ),
381
+ 'garbage_collectable_neurons_count' : IDL.Nat64,
382
+ 'neurons_with_invalid_stake_count' : IDL.Nat64,
383
+ 'not_dissolving_neurons_count_buckets' : IDL.Vec(
384
+ IDL.Tuple(IDL.Nat64, IDL.Nat64)
385
+ ),
386
+ 'neurons_with_less_than_6_months_dissolve_delay_count' : IDL.Nat64,
387
+ 'dissolved_neurons_count' : IDL.Nat64,
388
+ 'total_staked_e8s' : IDL.Nat64,
389
+ 'total_supply_governance_tokens' : IDL.Nat64,
390
+ 'not_dissolving_neurons_count' : IDL.Nat64,
391
+ 'dissolved_neurons_e8s' : IDL.Nat64,
392
+ 'neurons_with_less_than_6_months_dissolve_delay_e8s' : IDL.Nat64,
393
+ 'dissolving_neurons_count_buckets' : IDL.Vec(
394
+ IDL.Tuple(IDL.Nat64, IDL.Nat64)
395
+ ),
396
+ 'dissolving_neurons_count' : IDL.Nat64,
397
+ 'dissolving_neurons_e8s_buckets' : IDL.Vec(
398
+ IDL.Tuple(IDL.Nat64, IDL.Float64)
399
+ ),
400
+ 'timestamp_seconds' : IDL.Nat64,
401
+ });
402
+ const NeuronId = IDL.Record({ 'id' : IDL.Vec(IDL.Nat8) });
403
+ const Followees = IDL.Record({ 'followees' : IDL.Vec(NeuronId) });
404
+ const DefaultFollowees = IDL.Record({
405
+ 'followees' : IDL.Vec(IDL.Tuple(IDL.Nat64, Followees)),
406
+ });
407
+ const NeuronPermissionList = IDL.Record({
408
+ 'permissions' : IDL.Vec(IDL.Int32),
409
+ });
410
+ const NervousSystemParameters = IDL.Record({
411
+ 'default_followees' : IDL.Opt(DefaultFollowees),
412
+ 'max_dissolve_delay_seconds' : IDL.Opt(IDL.Nat64),
413
+ 'max_followees_per_function' : IDL.Opt(IDL.Nat64),
414
+ 'neuron_claimer_permissions' : IDL.Opt(NeuronPermissionList),
415
+ 'neuron_minimum_stake_e8s' : IDL.Opt(IDL.Nat64),
416
+ 'initial_voting_period' : IDL.Opt(IDL.Nat64),
417
+ 'max_neuron_age_for_age_bonus' : IDL.Opt(IDL.Nat64),
418
+ 'neuron_minimum_dissolve_delay_to_vote_seconds' : IDL.Opt(IDL.Nat64),
419
+ 'reject_cost_e8s' : IDL.Opt(IDL.Nat64),
420
+ 'max_proposals_to_keep_per_action' : IDL.Opt(IDL.Nat32),
421
+ 'max_number_of_neurons' : IDL.Opt(IDL.Nat64),
422
+ 'transaction_fee_e8s' : IDL.Opt(IDL.Nat64),
423
+ 'max_number_of_proposals_with_ballots' : IDL.Opt(IDL.Nat64),
424
+ 'reward_distribution_period_seconds' : IDL.Opt(IDL.Nat64),
425
+ 'neuron_grantable_permissions' : IDL.Opt(NeuronPermissionList),
426
+ 'max_number_of_principals_per_neuron' : IDL.Opt(IDL.Nat64),
427
+ });
428
+ const ProposalId = IDL.Record({ 'id' : IDL.Nat64 });
429
+ const RewardEvent = IDL.Record({
430
+ 'actual_timestamp_seconds' : IDL.Nat64,
431
+ 'periods_since_genesis' : IDL.Nat64,
432
+ 'distributed_e8s_equivalent' : IDL.Nat64,
433
+ 'settled_proposals' : IDL.Vec(ProposalId),
434
+ });
435
+ const GovernanceError = IDL.Record({
436
+ 'error_message' : IDL.Text,
437
+ 'error_type' : IDL.Int32,
438
+ });
439
+ const Ballot = IDL.Record({
440
+ 'vote' : IDL.Int32,
441
+ 'cast_timestamp_seconds' : IDL.Nat64,
442
+ 'voting_power' : IDL.Nat64,
443
+ });
444
+ const Tally = IDL.Record({
445
+ 'no' : IDL.Nat64,
446
+ 'yes' : IDL.Nat64,
447
+ 'total' : IDL.Nat64,
448
+ 'timestamp_seconds' : IDL.Nat64,
449
+ });
450
+ const UpgradeSnsControlledCanister = IDL.Record({
451
+ 'new_canister_wasm' : IDL.Vec(IDL.Nat8),
452
+ 'canister_id' : IDL.Opt(IDL.Principal),
453
+ });
454
+ const ExecuteGenericNervousSystemFunction = IDL.Record({
455
+ 'function_id' : IDL.Nat64,
456
+ 'payload' : IDL.Vec(IDL.Nat8),
457
+ });
458
+ const Motion = IDL.Record({ 'motion_text' : IDL.Text });
459
+ const Action = IDL.Variant({
460
+ 'ManageNervousSystemParameters' : NervousSystemParameters,
461
+ 'AddGenericNervousSystemFunction' : NervousSystemFunction,
462
+ 'RemoveGenericNervousSystemFunction' : IDL.Nat64,
463
+ 'UpgradeSnsControlledCanister' : UpgradeSnsControlledCanister,
464
+ 'Unspecified' : IDL.Record({}),
465
+ 'ExecuteGenericNervousSystemFunction' : ExecuteGenericNervousSystemFunction,
466
+ 'Motion' : Motion,
467
+ });
468
+ const Proposal = IDL.Record({
469
+ 'url' : IDL.Text,
470
+ 'title' : IDL.Text,
471
+ 'action' : IDL.Opt(Action),
472
+ 'summary' : IDL.Text,
473
+ });
474
+ const WaitForQuietState = IDL.Record({
475
+ 'current_deadline_timestamp_seconds' : IDL.Nat64,
476
+ });
477
+ const ProposalData = IDL.Record({
478
+ 'id' : IDL.Opt(ProposalId),
479
+ 'payload_text_rendering' : IDL.Opt(IDL.Text),
480
+ 'action' : IDL.Nat64,
481
+ 'failure_reason' : IDL.Opt(GovernanceError),
482
+ 'ballots' : IDL.Vec(IDL.Tuple(IDL.Text, Ballot)),
483
+ 'reward_event_round' : IDL.Nat64,
484
+ 'failed_timestamp_seconds' : IDL.Nat64,
485
+ 'proposal_creation_timestamp_seconds' : IDL.Nat64,
486
+ 'reject_cost_e8s' : IDL.Nat64,
487
+ 'latest_tally' : IDL.Opt(Tally),
488
+ 'decided_timestamp_seconds' : IDL.Nat64,
489
+ 'proposal' : IDL.Opt(Proposal),
490
+ 'proposer' : IDL.Opt(NeuronId),
491
+ 'wait_for_quiet_state' : IDL.Opt(WaitForQuietState),
492
+ 'executed_timestamp_seconds' : IDL.Nat64,
493
+ });
494
+ const Split = IDL.Record({ 'memo' : IDL.Nat64, 'amount_e8s' : IDL.Nat64 });
495
+ const Follow = IDL.Record({
496
+ 'function_id' : IDL.Nat64,
497
+ 'followees' : IDL.Vec(NeuronId),
498
+ });
499
+ const AccountIdentifier = IDL.Record({ 'hash' : IDL.Vec(IDL.Nat8) });
500
+ const DisburseMaturity = IDL.Record({
501
+ 'to_account' : IDL.Opt(AccountIdentifier),
502
+ 'percentage_to_disburse' : IDL.Nat32,
503
+ });
504
+ const IncreaseDissolveDelay = IDL.Record({
505
+ 'additional_dissolve_delay_seconds' : IDL.Nat32,
506
+ });
507
+ const SetDissolveTimestamp = IDL.Record({
508
+ 'dissolve_timestamp_seconds' : IDL.Nat64,
509
+ });
510
+ const Operation = IDL.Variant({
511
+ 'StopDissolving' : IDL.Record({}),
512
+ 'StartDissolving' : IDL.Record({}),
513
+ 'IncreaseDissolveDelay' : IncreaseDissolveDelay,
514
+ 'SetDissolveTimestamp' : SetDissolveTimestamp,
515
+ });
516
+ const Configure = IDL.Record({ 'operation' : IDL.Opt(Operation) });
517
+ const RegisterVote = IDL.Record({
518
+ 'vote' : IDL.Int32,
519
+ 'proposal' : IDL.Opt(ProposalId),
520
+ });
521
+ const MemoAndController = IDL.Record({
522
+ 'controller' : IDL.Opt(IDL.Principal),
523
+ 'memo' : IDL.Nat64,
524
+ });
525
+ const By = IDL.Variant({
526
+ 'MemoAndController' : MemoAndController,
527
+ 'NeuronId' : IDL.Record({}),
528
+ });
529
+ const ClaimOrRefresh = IDL.Record({ 'by' : IDL.Opt(By) });
530
+ const RemoveNeuronPermissions = IDL.Record({
531
+ 'permissions_to_remove' : IDL.Opt(NeuronPermissionList),
532
+ 'principal_id' : IDL.Opt(IDL.Principal),
533
+ });
534
+ const AddNeuronPermissions = IDL.Record({
535
+ 'permissions_to_add' : IDL.Opt(NeuronPermissionList),
536
+ 'principal_id' : IDL.Opt(IDL.Principal),
537
+ });
538
+ const MergeMaturity = IDL.Record({ 'percentage_to_merge' : IDL.Nat32 });
539
+ const Amount = IDL.Record({ 'e8s' : IDL.Nat64 });
540
+ const Disburse = IDL.Record({
541
+ 'to_account' : IDL.Opt(AccountIdentifier),
542
+ 'amount' : IDL.Opt(Amount),
543
+ });
544
+ const Command_2 = IDL.Variant({
545
+ 'Split' : Split,
546
+ 'Follow' : Follow,
547
+ 'DisburseMaturity' : DisburseMaturity,
548
+ 'Configure' : Configure,
549
+ 'RegisterVote' : RegisterVote,
550
+ 'MakeProposal' : Proposal,
551
+ 'ClaimOrRefreshNeuron' : ClaimOrRefresh,
552
+ 'RemoveNeuronPermissions' : RemoveNeuronPermissions,
553
+ 'AddNeuronPermissions' : AddNeuronPermissions,
554
+ 'MergeMaturity' : MergeMaturity,
555
+ 'Disburse' : Disburse,
556
+ });
557
+ const NeuronInFlightCommand = IDL.Record({
558
+ 'command' : IDL.Opt(Command_2),
559
+ 'timestamp' : IDL.Nat64,
560
+ });
561
+ const NeuronPermission = IDL.Record({
562
+ 'principal' : IDL.Opt(IDL.Principal),
563
+ 'permission_type' : IDL.Vec(IDL.Int32),
564
+ });
565
+ const DissolveState = IDL.Variant({
566
+ 'DissolveDelaySeconds' : IDL.Nat64,
567
+ 'WhenDissolvedTimestampSeconds' : IDL.Nat64,
568
+ });
569
+ const Neuron = IDL.Record({
570
+ 'id' : IDL.Opt(NeuronId),
571
+ 'permissions' : IDL.Vec(NeuronPermission),
572
+ 'maturity_e8s_equivalent' : IDL.Nat64,
573
+ 'cached_neuron_stake_e8s' : IDL.Nat64,
574
+ 'created_timestamp_seconds' : IDL.Nat64,
575
+ 'aging_since_timestamp_seconds' : IDL.Nat64,
576
+ 'dissolve_state' : IDL.Opt(DissolveState),
577
+ 'followees' : IDL.Vec(IDL.Tuple(IDL.Nat64, Followees)),
578
+ 'neuron_fees_e8s' : IDL.Nat64,
579
+ });
580
+ const Governance = IDL.Record({
581
+ 'root_canister_id' : IDL.Opt(IDL.Principal),
582
+ 'id_to_nervous_system_functions' : IDL.Vec(
583
+ IDL.Tuple(IDL.Nat64, NervousSystemFunction)
584
+ ),
585
+ 'metrics' : IDL.Opt(GovernanceCachedMetrics),
586
+ 'mode' : IDL.Int32,
587
+ 'parameters' : IDL.Opt(NervousSystemParameters),
588
+ 'latest_reward_event' : IDL.Opt(RewardEvent),
589
+ 'ledger_canister_id' : IDL.Opt(IDL.Principal),
590
+ 'proposals' : IDL.Vec(IDL.Tuple(IDL.Nat64, ProposalData)),
591
+ 'in_flight_commands' : IDL.Vec(IDL.Tuple(IDL.Text, NeuronInFlightCommand)),
592
+ 'neurons' : IDL.Vec(IDL.Tuple(IDL.Text, Neuron)),
593
+ 'genesis_timestamp_seconds' : IDL.Nat64,
594
+ });
595
+ return [Governance];
596
+ };