@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,366 @@
1
+ import type { Principal } from "@dfinity/principal";
2
+ export interface AccountIdentifier {
3
+ hash: Array<number>;
4
+ }
5
+ export type Action =
6
+ | {
7
+ ManageNervousSystemParameters: NervousSystemParameters;
8
+ }
9
+ | { AddGenericNervousSystemFunction: NervousSystemFunction }
10
+ | { RemoveGenericNervousSystemFunction: bigint }
11
+ | { UpgradeSnsControlledCanister: UpgradeSnsControlledCanister }
12
+ | { Unspecified: {} }
13
+ | {
14
+ ExecuteGenericNervousSystemFunction: ExecuteGenericNervousSystemFunction;
15
+ }
16
+ | { Motion: Motion };
17
+ export interface AddNeuronPermissions {
18
+ permissions_to_add: [] | [NeuronPermissionList];
19
+ principal_id: [] | [Principal];
20
+ }
21
+ export interface Amount {
22
+ e8s: bigint;
23
+ }
24
+ export interface Ballot {
25
+ vote: number;
26
+ cast_timestamp_seconds: bigint;
27
+ voting_power: bigint;
28
+ }
29
+ export type By = { MemoAndController: MemoAndController } | { NeuronId: {} };
30
+ export interface CanisterStatusResultV2 {
31
+ controller: Principal;
32
+ status: CanisterStatusType;
33
+ freezing_threshold: bigint;
34
+ balance: Array<[Array<number>, bigint]>;
35
+ memory_size: bigint;
36
+ cycles: bigint;
37
+ settings: DefiniteCanisterSettingsArgs;
38
+ idle_cycles_burned_per_day: bigint;
39
+ module_hash: [] | [Array<number>];
40
+ }
41
+ export type CanisterStatusType =
42
+ | { stopped: null }
43
+ | { stopping: null }
44
+ | { running: null };
45
+ export interface ClaimOrRefresh {
46
+ by: [] | [By];
47
+ }
48
+ export interface ClaimOrRefreshResponse {
49
+ refreshed_neuron_id: [] | [NeuronId];
50
+ }
51
+ export type Command =
52
+ | { Split: Split }
53
+ | { Follow: Follow }
54
+ | { DisburseMaturity: DisburseMaturity }
55
+ | { ClaimOrRefresh: ClaimOrRefresh }
56
+ | { Configure: Configure }
57
+ | { RegisterVote: RegisterVote }
58
+ | { MakeProposal: Proposal }
59
+ | { RemoveNeuronPermissions: RemoveNeuronPermissions }
60
+ | { AddNeuronPermissions: AddNeuronPermissions }
61
+ | { MergeMaturity: MergeMaturity }
62
+ | { Disburse: Disburse };
63
+ export type Command_1 =
64
+ | { Error: GovernanceError }
65
+ | { Split: SplitResponse }
66
+ | { Follow: {} }
67
+ | { DisburseMaturity: DisburseMaturityResponse }
68
+ | { ClaimOrRefresh: ClaimOrRefreshResponse }
69
+ | { Configure: {} }
70
+ | { RegisterVote: {} }
71
+ | { MakeProposal: GetProposal }
72
+ | { RemoveNeuronPermission: {} }
73
+ | { MergeMaturity: MergeMaturityResponse }
74
+ | { Disburse: DisburseResponse }
75
+ | { AddNeuronPermission: {} };
76
+ export type Command_2 =
77
+ | { Split: Split }
78
+ | { Follow: Follow }
79
+ | { DisburseMaturity: DisburseMaturity }
80
+ | { Configure: Configure }
81
+ | { RegisterVote: RegisterVote }
82
+ | { MakeProposal: Proposal }
83
+ | { ClaimOrRefreshNeuron: ClaimOrRefresh }
84
+ | { RemoveNeuronPermissions: RemoveNeuronPermissions }
85
+ | { AddNeuronPermissions: AddNeuronPermissions }
86
+ | { MergeMaturity: MergeMaturity }
87
+ | { Disburse: Disburse };
88
+ export interface Configure {
89
+ operation: [] | [Operation];
90
+ }
91
+ export interface DefaultFollowees {
92
+ followees: Array<[bigint, Followees]>;
93
+ }
94
+ export interface DefiniteCanisterSettingsArgs {
95
+ controller: Principal;
96
+ freezing_threshold: bigint;
97
+ controllers: Array<Principal>;
98
+ memory_allocation: bigint;
99
+ compute_allocation: bigint;
100
+ }
101
+ export interface Disburse {
102
+ to_account: [] | [AccountIdentifier];
103
+ amount: [] | [Amount];
104
+ }
105
+ export interface DisburseMaturity {
106
+ to_account: [] | [AccountIdentifier];
107
+ percentage_to_disburse: number;
108
+ }
109
+ export interface DisburseMaturityResponse {
110
+ transfer_block_height: bigint;
111
+ amount_disbursed_e8s: bigint;
112
+ }
113
+ export interface DisburseResponse {
114
+ transfer_block_height: bigint;
115
+ }
116
+ export type DissolveState =
117
+ | { DissolveDelaySeconds: bigint }
118
+ | { WhenDissolvedTimestampSeconds: bigint };
119
+ export interface ExecuteGenericNervousSystemFunction {
120
+ function_id: bigint;
121
+ payload: Array<number>;
122
+ }
123
+ export interface Follow {
124
+ function_id: bigint;
125
+ followees: Array<NeuronId>;
126
+ }
127
+ export interface Followees {
128
+ followees: Array<NeuronId>;
129
+ }
130
+ export type FunctionType =
131
+ | { NativeNervousSystemFunction: {} }
132
+ | { GenericNervousSystemFunction: GenericNervousSystemFunction };
133
+ export interface GenericNervousSystemFunction {
134
+ validator_canister_id: [] | [Principal];
135
+ target_canister_id: [] | [Principal];
136
+ validator_method_name: [] | [string];
137
+ target_method_name: [] | [string];
138
+ }
139
+ export interface GetNeuron {
140
+ neuron_id: [] | [NeuronId];
141
+ }
142
+ export interface GetNeuronResponse {
143
+ result: [] | [Result];
144
+ }
145
+ export interface GetProposal {
146
+ proposal_id: [] | [ProposalId];
147
+ }
148
+ export interface GetProposalResponse {
149
+ result: [] | [Result_1];
150
+ }
151
+ export interface Governance {
152
+ root_canister_id: [] | [Principal];
153
+ id_to_nervous_system_functions: Array<[bigint, NervousSystemFunction]>;
154
+ metrics: [] | [GovernanceCachedMetrics];
155
+ mode: number;
156
+ parameters: [] | [NervousSystemParameters];
157
+ latest_reward_event: [] | [RewardEvent];
158
+ ledger_canister_id: [] | [Principal];
159
+ proposals: Array<[bigint, ProposalData]>;
160
+ in_flight_commands: Array<[string, NeuronInFlightCommand]>;
161
+ neurons: Array<[string, Neuron]>;
162
+ genesis_timestamp_seconds: bigint;
163
+ }
164
+ export interface GovernanceCachedMetrics {
165
+ not_dissolving_neurons_e8s_buckets: Array<[bigint, number]>;
166
+ garbage_collectable_neurons_count: bigint;
167
+ neurons_with_invalid_stake_count: bigint;
168
+ not_dissolving_neurons_count_buckets: Array<[bigint, bigint]>;
169
+ neurons_with_less_than_6_months_dissolve_delay_count: bigint;
170
+ dissolved_neurons_count: bigint;
171
+ total_staked_e8s: bigint;
172
+ total_supply_governance_tokens: bigint;
173
+ not_dissolving_neurons_count: bigint;
174
+ dissolved_neurons_e8s: bigint;
175
+ neurons_with_less_than_6_months_dissolve_delay_e8s: bigint;
176
+ dissolving_neurons_count_buckets: Array<[bigint, bigint]>;
177
+ dissolving_neurons_count: bigint;
178
+ dissolving_neurons_e8s_buckets: Array<[bigint, number]>;
179
+ timestamp_seconds: bigint;
180
+ }
181
+ export interface GovernanceError {
182
+ error_message: string;
183
+ error_type: number;
184
+ }
185
+ export interface IncreaseDissolveDelay {
186
+ additional_dissolve_delay_seconds: number;
187
+ }
188
+ export interface ListNervousSystemFunctionsResponse {
189
+ reserved_ids: Array<bigint>;
190
+ functions: Array<NervousSystemFunction>;
191
+ }
192
+ export interface ListNeurons {
193
+ of_principal: [] | [Principal];
194
+ limit: number;
195
+ start_page_at: [] | [NeuronId];
196
+ }
197
+ export interface ListNeuronsResponse {
198
+ neurons: Array<Neuron>;
199
+ }
200
+ export interface ListProposals {
201
+ include_reward_status: Array<number>;
202
+ before_proposal: [] | [ProposalId];
203
+ limit: number;
204
+ exclude_type: Array<bigint>;
205
+ include_status: Array<number>;
206
+ }
207
+ export interface ListProposalsResponse {
208
+ proposals: Array<ProposalData>;
209
+ }
210
+ export interface ManageNeuron {
211
+ subaccount: Array<number>;
212
+ command: [] | [Command];
213
+ }
214
+ export interface ManageNeuronResponse {
215
+ command: [] | [Command_1];
216
+ }
217
+ export interface MemoAndController {
218
+ controller: [] | [Principal];
219
+ memo: bigint;
220
+ }
221
+ export interface MergeMaturity {
222
+ percentage_to_merge: number;
223
+ }
224
+ export interface MergeMaturityResponse {
225
+ merged_maturity_e8s: bigint;
226
+ new_stake_e8s: bigint;
227
+ }
228
+ export interface Motion {
229
+ motion_text: string;
230
+ }
231
+ export interface NervousSystemFunction {
232
+ id: bigint;
233
+ name: string;
234
+ description: [] | [string];
235
+ function_type: [] | [FunctionType];
236
+ }
237
+ export interface NervousSystemParameters {
238
+ default_followees: [] | [DefaultFollowees];
239
+ max_dissolve_delay_seconds: [] | [bigint];
240
+ max_followees_per_function: [] | [bigint];
241
+ neuron_claimer_permissions: [] | [NeuronPermissionList];
242
+ neuron_minimum_stake_e8s: [] | [bigint];
243
+ initial_voting_period: [] | [bigint];
244
+ max_neuron_age_for_age_bonus: [] | [bigint];
245
+ neuron_minimum_dissolve_delay_to_vote_seconds: [] | [bigint];
246
+ reject_cost_e8s: [] | [bigint];
247
+ max_proposals_to_keep_per_action: [] | [number];
248
+ max_number_of_neurons: [] | [bigint];
249
+ transaction_fee_e8s: [] | [bigint];
250
+ max_number_of_proposals_with_ballots: [] | [bigint];
251
+ reward_distribution_period_seconds: [] | [bigint];
252
+ neuron_grantable_permissions: [] | [NeuronPermissionList];
253
+ max_number_of_principals_per_neuron: [] | [bigint];
254
+ }
255
+ export interface Neuron {
256
+ id: [] | [NeuronId];
257
+ permissions: Array<NeuronPermission>;
258
+ maturity_e8s_equivalent: bigint;
259
+ cached_neuron_stake_e8s: bigint;
260
+ created_timestamp_seconds: bigint;
261
+ aging_since_timestamp_seconds: bigint;
262
+ dissolve_state: [] | [DissolveState];
263
+ followees: Array<[bigint, Followees]>;
264
+ neuron_fees_e8s: bigint;
265
+ }
266
+ export interface NeuronId {
267
+ id: Array<number>;
268
+ }
269
+ export interface NeuronInFlightCommand {
270
+ command: [] | [Command_2];
271
+ timestamp: bigint;
272
+ }
273
+ export interface NeuronPermission {
274
+ principal: [] | [Principal];
275
+ permission_type: Array<number>;
276
+ }
277
+ export interface NeuronPermissionList {
278
+ permissions: Array<number>;
279
+ }
280
+ export type Operation =
281
+ | { StopDissolving: {} }
282
+ | { StartDissolving: {} }
283
+ | { IncreaseDissolveDelay: IncreaseDissolveDelay }
284
+ | { SetDissolveTimestamp: SetDissolveTimestamp };
285
+ export interface Proposal {
286
+ url: string;
287
+ title: string;
288
+ action: [] | [Action];
289
+ summary: string;
290
+ }
291
+ export interface ProposalData {
292
+ id: [] | [ProposalId];
293
+ payload_text_rendering: [] | [string];
294
+ action: bigint;
295
+ failure_reason: [] | [GovernanceError];
296
+ ballots: Array<[string, Ballot]>;
297
+ reward_event_round: bigint;
298
+ failed_timestamp_seconds: bigint;
299
+ proposal_creation_timestamp_seconds: bigint;
300
+ reject_cost_e8s: bigint;
301
+ latest_tally: [] | [Tally];
302
+ decided_timestamp_seconds: bigint;
303
+ proposal: [] | [Proposal];
304
+ proposer: [] | [NeuronId];
305
+ wait_for_quiet_state: [] | [WaitForQuietState];
306
+ executed_timestamp_seconds: bigint;
307
+ }
308
+ export interface ProposalId {
309
+ id: bigint;
310
+ }
311
+ export interface RegisterVote {
312
+ vote: number;
313
+ proposal: [] | [ProposalId];
314
+ }
315
+ export interface RemoveNeuronPermissions {
316
+ permissions_to_remove: [] | [NeuronPermissionList];
317
+ principal_id: [] | [Principal];
318
+ }
319
+ export type Result = { Error: GovernanceError } | { Neuron: Neuron };
320
+ export type Result_1 = { Error: GovernanceError } | { Proposal: ProposalData };
321
+ export interface RewardEvent {
322
+ actual_timestamp_seconds: bigint;
323
+ periods_since_genesis: bigint;
324
+ distributed_e8s_equivalent: bigint;
325
+ settled_proposals: Array<ProposalId>;
326
+ }
327
+ export interface SetDissolveTimestamp {
328
+ dissolve_timestamp_seconds: bigint;
329
+ }
330
+ export interface SetMode {
331
+ mode: number;
332
+ }
333
+ export interface Split {
334
+ memo: bigint;
335
+ amount_e8s: bigint;
336
+ }
337
+ export interface SplitResponse {
338
+ created_neuron_id: [] | [NeuronId];
339
+ }
340
+ export interface Tally {
341
+ no: bigint;
342
+ yes: bigint;
343
+ total: bigint;
344
+ timestamp_seconds: bigint;
345
+ }
346
+ export interface UpgradeSnsControlledCanister {
347
+ new_canister_wasm: Array<number>;
348
+ canister_id: [] | [Principal];
349
+ }
350
+ export interface WaitForQuietState {
351
+ current_deadline_timestamp_seconds: bigint;
352
+ }
353
+ export interface _SERVICE {
354
+ get_build_metadata: () => Promise<string>;
355
+ get_nervous_system_parameters: (
356
+ arg_0: null
357
+ ) => Promise<NervousSystemParameters>;
358
+ get_neuron: (arg_0: GetNeuron) => Promise<GetNeuronResponse>;
359
+ get_proposal: (arg_0: GetProposal) => Promise<GetProposalResponse>;
360
+ get_root_canister_status: (arg_0: null) => Promise<CanisterStatusResultV2>;
361
+ list_nervous_system_functions: () => Promise<ListNervousSystemFunctionsResponse>;
362
+ list_neurons: (arg_0: ListNeurons) => Promise<ListNeuronsResponse>;
363
+ list_proposals: (arg_0: ListProposals) => Promise<ListProposalsResponse>;
364
+ manage_neuron: (arg_0: ManageNeuron) => Promise<ManageNeuronResponse>;
365
+ set_mode: (arg_0: SetMode) => Promise<{}>;
366
+ }
@@ -0,0 +1,303 @@
1
+ // Generated from IC repo commit a1080f27696c890c19d7068f668bd062f3787564 'rs/sns/governance/canister/governance.did' by import-candid
2
+ type AccountIdentifier = record { hash : vec nat8 };
3
+ type Action = variant {
4
+ ManageNervousSystemParameters : NervousSystemParameters;
5
+ AddGenericNervousSystemFunction : NervousSystemFunction;
6
+ RemoveGenericNervousSystemFunction : nat64;
7
+ UpgradeSnsControlledCanister : UpgradeSnsControlledCanister;
8
+ Unspecified : record {};
9
+ ExecuteGenericNervousSystemFunction : ExecuteGenericNervousSystemFunction;
10
+ Motion : Motion;
11
+ };
12
+ type AddNeuronPermissions = record {
13
+ permissions_to_add : opt NeuronPermissionList;
14
+ principal_id : opt principal;
15
+ };
16
+ type Amount = record { e8s : nat64 };
17
+ type Ballot = record {
18
+ vote : int32;
19
+ cast_timestamp_seconds : nat64;
20
+ voting_power : nat64;
21
+ };
22
+ type By = variant {
23
+ MemoAndController : MemoAndController;
24
+ NeuronId : record {};
25
+ };
26
+ type CanisterStatusResultV2 = record {
27
+ controller : principal;
28
+ status : CanisterStatusType;
29
+ freezing_threshold : nat;
30
+ balance : vec record { vec nat8; nat };
31
+ memory_size : nat;
32
+ cycles : nat;
33
+ settings : DefiniteCanisterSettingsArgs;
34
+ idle_cycles_burned_per_day : nat;
35
+ module_hash : opt vec nat8;
36
+ };
37
+ type CanisterStatusType = variant { stopped; stopping; running };
38
+ type ClaimOrRefresh = record { by : opt By };
39
+ type ClaimOrRefreshResponse = record { refreshed_neuron_id : opt NeuronId };
40
+ type Command = variant {
41
+ Split : Split;
42
+ Follow : Follow;
43
+ DisburseMaturity : DisburseMaturity;
44
+ ClaimOrRefresh : ClaimOrRefresh;
45
+ Configure : Configure;
46
+ RegisterVote : RegisterVote;
47
+ MakeProposal : Proposal;
48
+ RemoveNeuronPermissions : RemoveNeuronPermissions;
49
+ AddNeuronPermissions : AddNeuronPermissions;
50
+ MergeMaturity : MergeMaturity;
51
+ Disburse : Disburse;
52
+ };
53
+ type Command_1 = variant {
54
+ Error : GovernanceError;
55
+ Split : SplitResponse;
56
+ Follow : record {};
57
+ DisburseMaturity : DisburseMaturityResponse;
58
+ ClaimOrRefresh : ClaimOrRefreshResponse;
59
+ Configure : record {};
60
+ RegisterVote : record {};
61
+ MakeProposal : GetProposal;
62
+ RemoveNeuronPermission : record {};
63
+ MergeMaturity : MergeMaturityResponse;
64
+ Disburse : DisburseResponse;
65
+ AddNeuronPermission : record {};
66
+ };
67
+ type Command_2 = variant {
68
+ Split : Split;
69
+ Follow : Follow;
70
+ DisburseMaturity : DisburseMaturity;
71
+ Configure : Configure;
72
+ RegisterVote : RegisterVote;
73
+ MakeProposal : Proposal;
74
+ ClaimOrRefreshNeuron : ClaimOrRefresh;
75
+ RemoveNeuronPermissions : RemoveNeuronPermissions;
76
+ AddNeuronPermissions : AddNeuronPermissions;
77
+ MergeMaturity : MergeMaturity;
78
+ Disburse : Disburse;
79
+ };
80
+ type Configure = record { operation : opt Operation };
81
+ type DefaultFollowees = record { followees : vec record { nat64; Followees } };
82
+ type DefiniteCanisterSettingsArgs = record {
83
+ controller : principal;
84
+ freezing_threshold : nat;
85
+ controllers : vec principal;
86
+ memory_allocation : nat;
87
+ compute_allocation : nat;
88
+ };
89
+ type Disburse = record {
90
+ to_account : opt AccountIdentifier;
91
+ amount : opt Amount;
92
+ };
93
+ type DisburseMaturity = record {
94
+ to_account : opt AccountIdentifier;
95
+ percentage_to_disburse : nat32;
96
+ };
97
+ type DisburseMaturityResponse = record {
98
+ transfer_block_height : nat64;
99
+ amount_disbursed_e8s : nat64;
100
+ };
101
+ type DisburseResponse = record { transfer_block_height : nat64 };
102
+ type DissolveState = variant {
103
+ DissolveDelaySeconds : nat64;
104
+ WhenDissolvedTimestampSeconds : nat64;
105
+ };
106
+ type ExecuteGenericNervousSystemFunction = record {
107
+ function_id : nat64;
108
+ payload : vec nat8;
109
+ };
110
+ type Follow = record { function_id : nat64; followees : vec NeuronId };
111
+ type Followees = record { followees : vec NeuronId };
112
+ type FunctionType = variant {
113
+ NativeNervousSystemFunction : record {};
114
+ GenericNervousSystemFunction : GenericNervousSystemFunction;
115
+ };
116
+ type GenericNervousSystemFunction = record {
117
+ validator_canister_id : opt principal;
118
+ target_canister_id : opt principal;
119
+ validator_method_name : opt text;
120
+ target_method_name : opt text;
121
+ };
122
+ type GetNeuron = record { neuron_id : opt NeuronId };
123
+ type GetNeuronResponse = record { result : opt Result };
124
+ type GetProposal = record { proposal_id : opt ProposalId };
125
+ type GetProposalResponse = record { result : opt Result_1 };
126
+ type Governance = record {
127
+ root_canister_id : opt principal;
128
+ id_to_nervous_system_functions : vec record { nat64; NervousSystemFunction };
129
+ metrics : opt GovernanceCachedMetrics;
130
+ mode : int32;
131
+ parameters : opt NervousSystemParameters;
132
+ latest_reward_event : opt RewardEvent;
133
+ ledger_canister_id : opt principal;
134
+ proposals : vec record { nat64; ProposalData };
135
+ in_flight_commands : vec record { text; NeuronInFlightCommand };
136
+ neurons : vec record { text; Neuron };
137
+ genesis_timestamp_seconds : nat64;
138
+ };
139
+ type GovernanceCachedMetrics = record {
140
+ not_dissolving_neurons_e8s_buckets : vec record { nat64; float64 };
141
+ garbage_collectable_neurons_count : nat64;
142
+ neurons_with_invalid_stake_count : nat64;
143
+ not_dissolving_neurons_count_buckets : vec record { nat64; nat64 };
144
+ neurons_with_less_than_6_months_dissolve_delay_count : nat64;
145
+ dissolved_neurons_count : nat64;
146
+ total_staked_e8s : nat64;
147
+ total_supply_governance_tokens : nat64;
148
+ not_dissolving_neurons_count : nat64;
149
+ dissolved_neurons_e8s : nat64;
150
+ neurons_with_less_than_6_months_dissolve_delay_e8s : nat64;
151
+ dissolving_neurons_count_buckets : vec record { nat64; nat64 };
152
+ dissolving_neurons_count : nat64;
153
+ dissolving_neurons_e8s_buckets : vec record { nat64; float64 };
154
+ timestamp_seconds : nat64;
155
+ };
156
+ type GovernanceError = record { error_message : text; error_type : int32 };
157
+ type IncreaseDissolveDelay = record {
158
+ additional_dissolve_delay_seconds : nat32;
159
+ };
160
+ type ListNervousSystemFunctionsResponse = record {
161
+ reserved_ids : vec nat64;
162
+ functions : vec NervousSystemFunction;
163
+ };
164
+ type ListNeurons = record {
165
+ of_principal : opt principal;
166
+ limit : nat32;
167
+ start_page_at : opt NeuronId;
168
+ };
169
+ type ListNeuronsResponse = record { neurons : vec Neuron };
170
+ type ListProposals = record {
171
+ include_reward_status : vec int32;
172
+ before_proposal : opt ProposalId;
173
+ limit : nat32;
174
+ exclude_type : vec nat64;
175
+ include_status : vec int32;
176
+ };
177
+ type ListProposalsResponse = record { proposals : vec ProposalData };
178
+ type ManageNeuron = record { subaccount : vec nat8; command : opt Command };
179
+ type ManageNeuronResponse = record { command : opt Command_1 };
180
+ type MemoAndController = record { controller : opt principal; memo : nat64 };
181
+ type MergeMaturity = record { percentage_to_merge : nat32 };
182
+ type MergeMaturityResponse = record {
183
+ merged_maturity_e8s : nat64;
184
+ new_stake_e8s : nat64;
185
+ };
186
+ type Motion = record { motion_text : text };
187
+ type NervousSystemFunction = record {
188
+ id : nat64;
189
+ name : text;
190
+ description : opt text;
191
+ function_type : opt FunctionType;
192
+ };
193
+ type NervousSystemParameters = record {
194
+ default_followees : opt DefaultFollowees;
195
+ max_dissolve_delay_seconds : opt nat64;
196
+ max_followees_per_function : opt nat64;
197
+ neuron_claimer_permissions : opt NeuronPermissionList;
198
+ neuron_minimum_stake_e8s : opt nat64;
199
+ initial_voting_period : opt nat64;
200
+ max_neuron_age_for_age_bonus : opt nat64;
201
+ neuron_minimum_dissolve_delay_to_vote_seconds : opt nat64;
202
+ reject_cost_e8s : opt nat64;
203
+ max_proposals_to_keep_per_action : opt nat32;
204
+ max_number_of_neurons : opt nat64;
205
+ transaction_fee_e8s : opt nat64;
206
+ max_number_of_proposals_with_ballots : opt nat64;
207
+ reward_distribution_period_seconds : opt nat64;
208
+ neuron_grantable_permissions : opt NeuronPermissionList;
209
+ max_number_of_principals_per_neuron : opt nat64;
210
+ };
211
+ type Neuron = record {
212
+ id : opt NeuronId;
213
+ permissions : vec NeuronPermission;
214
+ maturity_e8s_equivalent : nat64;
215
+ cached_neuron_stake_e8s : nat64;
216
+ created_timestamp_seconds : nat64;
217
+ aging_since_timestamp_seconds : nat64;
218
+ dissolve_state : opt DissolveState;
219
+ followees : vec record { nat64; Followees };
220
+ neuron_fees_e8s : nat64;
221
+ };
222
+ type NeuronId = record { id : vec nat8 };
223
+ type NeuronInFlightCommand = record {
224
+ command : opt Command_2;
225
+ timestamp : nat64;
226
+ };
227
+ type NeuronPermission = record {
228
+ "principal" : opt principal;
229
+ permission_type : vec int32;
230
+ };
231
+ type NeuronPermissionList = record { permissions : vec int32 };
232
+ type Operation = variant {
233
+ StopDissolving : record {};
234
+ StartDissolving : record {};
235
+ IncreaseDissolveDelay : IncreaseDissolveDelay;
236
+ SetDissolveTimestamp : SetDissolveTimestamp;
237
+ };
238
+ type Proposal = record {
239
+ url : text;
240
+ title : text;
241
+ action : opt Action;
242
+ summary : text;
243
+ };
244
+ type ProposalData = record {
245
+ id : opt ProposalId;
246
+ payload_text_rendering : opt text;
247
+ action : nat64;
248
+ failure_reason : opt GovernanceError;
249
+ ballots : vec record { text; Ballot };
250
+ reward_event_round : nat64;
251
+ failed_timestamp_seconds : nat64;
252
+ proposal_creation_timestamp_seconds : nat64;
253
+ reject_cost_e8s : nat64;
254
+ latest_tally : opt Tally;
255
+ decided_timestamp_seconds : nat64;
256
+ proposal : opt Proposal;
257
+ proposer : opt NeuronId;
258
+ wait_for_quiet_state : opt WaitForQuietState;
259
+ executed_timestamp_seconds : nat64;
260
+ };
261
+ type ProposalId = record { id : nat64 };
262
+ type RegisterVote = record { vote : int32; proposal : opt ProposalId };
263
+ type RemoveNeuronPermissions = record {
264
+ permissions_to_remove : opt NeuronPermissionList;
265
+ principal_id : opt principal;
266
+ };
267
+ type Result = variant { Error : GovernanceError; Neuron : Neuron };
268
+ type Result_1 = variant { Error : GovernanceError; Proposal : ProposalData };
269
+ type RewardEvent = record {
270
+ actual_timestamp_seconds : nat64;
271
+ periods_since_genesis : nat64;
272
+ distributed_e8s_equivalent : nat64;
273
+ settled_proposals : vec ProposalId;
274
+ };
275
+ type SetDissolveTimestamp = record { dissolve_timestamp_seconds : nat64 };
276
+ type SetMode = record { mode : int32 };
277
+ type Split = record { memo : nat64; amount_e8s : nat64 };
278
+ type SplitResponse = record { created_neuron_id : opt NeuronId };
279
+ type Tally = record {
280
+ no : nat64;
281
+ yes : nat64;
282
+ total : nat64;
283
+ timestamp_seconds : nat64;
284
+ };
285
+ type UpgradeSnsControlledCanister = record {
286
+ new_canister_wasm : vec nat8;
287
+ canister_id : opt principal;
288
+ };
289
+ type WaitForQuietState = record { current_deadline_timestamp_seconds : nat64 };
290
+ service : (Governance) -> {
291
+ get_build_metadata : () -> (text) query;
292
+ get_nervous_system_parameters : (null) -> (NervousSystemParameters) query;
293
+ get_neuron : (GetNeuron) -> (GetNeuronResponse) query;
294
+ get_proposal : (GetProposal) -> (GetProposalResponse) query;
295
+ get_root_canister_status : (null) -> (CanisterStatusResultV2);
296
+ list_nervous_system_functions : () -> (
297
+ ListNervousSystemFunctionsResponse,
298
+ ) query;
299
+ list_neurons : (ListNeurons) -> (ListNeuronsResponse) query;
300
+ list_proposals : (ListProposals) -> (ListProposalsResponse) query;
301
+ manage_neuron : (ManageNeuron) -> (ManageNeuronResponse);
302
+ set_mode : (SetMode) -> (record {});
303
+ }
@@ -0,0 +1,2 @@
1
+ import type { IDL } from "@dfinity/candid";
2
+ export const idlFactory: IDL.InterfaceFactory;