@dfinity/nns 0.2.1 → 0.2.2

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 (37) hide show
  1. package/dist/candid/governance.certified.idl.d.ts +2 -0
  2. package/dist/candid/governance.certified.idl.js +704 -0
  3. package/dist/candid/governance.did +338 -0
  4. package/dist/candid/governance.idl.d.ts +5 -0
  5. package/dist/candid/governance.idl.js +712 -0
  6. package/dist/candid/governanceTypes.d.ts +413 -0
  7. package/dist/candid/nns_dapp.certified.idl.js +206 -0
  8. package/dist/candid/nns_dapp.did +240 -0
  9. package/dist/candid/nns_dapp.idl.js +206 -0
  10. package/dist/candid/payloads.did +168 -0
  11. package/dist/candid/payloads.idl.d.ts +20 -0
  12. package/dist/candid/payloads.idl.js +163 -0
  13. package/dist/cjs/index.cjs.js +32 -32
  14. package/dist/cjs/index.cjs.js.map +2 -2
  15. package/dist/esm/account_identifier.js +1 -1
  16. package/dist/esm/{chunk-NYI672WX.js → chunk-2DZXLOEC.js} +3 -3
  17. package/dist/esm/{chunk-NYI672WX.js.map → chunk-2DZXLOEC.js.map} +2 -2
  18. package/dist/esm/{chunk-SO23SIWX.js → chunk-D2W3ELRE.js} +2 -2
  19. package/dist/esm/{chunk-SO23SIWX.js.map → chunk-D2W3ELRE.js.map} +0 -0
  20. package/dist/esm/{chunk-X2SHUWG3.js → chunk-QR4654XK.js} +2 -2
  21. package/dist/esm/{chunk-X2SHUWG3.js.map → chunk-QR4654XK.js.map} +0 -0
  22. package/dist/esm/{chunk-YL3F3CIN.js → chunk-RUFBUR7C.js} +2 -2
  23. package/dist/esm/{chunk-YL3F3CIN.js.map → chunk-RUFBUR7C.js.map} +0 -0
  24. package/dist/esm/{chunk-RPOIUQZO.js → chunk-ZWZRSVU4.js} +2 -2
  25. package/dist/esm/{chunk-RPOIUQZO.js.map → chunk-ZWZRSVU4.js.map} +2 -2
  26. package/dist/esm/governance.js +1 -1
  27. package/dist/esm/icp.js +1 -1
  28. package/dist/esm/index.js +1 -1
  29. package/dist/esm/ledger.js +1 -1
  30. package/dist/proto/base_types.proto +60 -0
  31. package/dist/proto/base_types_pb.d.ts +144 -0
  32. package/dist/proto/base_types_pb.js +1071 -0
  33. package/dist/proto/ledger.proto +277 -0
  34. package/dist/proto/ledger_pb.d.ts +911 -0
  35. package/dist/proto/ledger_pb.js +6555 -0
  36. package/dist/types/governance.d.ts +5 -1
  37. package/package.json +2 -2
@@ -0,0 +1,704 @@
1
+ /* Do not edit. Compiled with ./scripts/compile-idl-js from candid/governance.did */
2
+ export const idlFactory = ({ IDL }) => {
3
+ const Proposal = IDL.Rec();
4
+ const NeuronId = IDL.Record({ 'id' : IDL.Nat64 });
5
+ const Followees = IDL.Record({ 'followees' : IDL.Vec(NeuronId) });
6
+ const GovernanceCachedMetrics = IDL.Record({
7
+ 'not_dissolving_neurons_e8s_buckets' : IDL.Vec(
8
+ IDL.Tuple(IDL.Nat64, IDL.Float64)
9
+ ),
10
+ 'garbage_collectable_neurons_count' : IDL.Nat64,
11
+ 'neurons_with_invalid_stake_count' : IDL.Nat64,
12
+ 'not_dissolving_neurons_count_buckets' : IDL.Vec(
13
+ IDL.Tuple(IDL.Nat64, IDL.Nat64)
14
+ ),
15
+ 'total_supply_icp' : IDL.Nat64,
16
+ 'neurons_with_less_than_6_months_dissolve_delay_count' : IDL.Nat64,
17
+ 'dissolved_neurons_count' : IDL.Nat64,
18
+ 'total_staked_e8s' : IDL.Nat64,
19
+ 'not_dissolving_neurons_count' : IDL.Nat64,
20
+ 'dissolved_neurons_e8s' : IDL.Nat64,
21
+ 'neurons_with_less_than_6_months_dissolve_delay_e8s' : IDL.Nat64,
22
+ 'dissolving_neurons_count_buckets' : IDL.Vec(
23
+ IDL.Tuple(IDL.Nat64, IDL.Nat64)
24
+ ),
25
+ 'dissolving_neurons_count' : IDL.Nat64,
26
+ 'dissolving_neurons_e8s_buckets' : IDL.Vec(
27
+ IDL.Tuple(IDL.Nat64, IDL.Float64)
28
+ ),
29
+ 'community_fund_total_staked_e8s' : IDL.Nat64,
30
+ 'timestamp_seconds' : IDL.Nat64,
31
+ });
32
+ const AccountIdentifier = IDL.Record({ 'hash' : IDL.Vec(IDL.Nat8) });
33
+ const NodeProvider = IDL.Record({
34
+ 'id' : IDL.Opt(IDL.Principal),
35
+ 'reward_account' : IDL.Opt(AccountIdentifier),
36
+ });
37
+ const NetworkEconomics = IDL.Record({
38
+ 'neuron_minimum_stake_e8s' : IDL.Nat64,
39
+ 'max_proposals_to_keep_per_topic' : IDL.Nat32,
40
+ 'neuron_management_fee_per_proposal_e8s' : IDL.Nat64,
41
+ 'reject_cost_e8s' : IDL.Nat64,
42
+ 'transaction_fee_e8s' : IDL.Nat64,
43
+ 'neuron_spawn_dissolve_delay_seconds' : IDL.Nat64,
44
+ 'minimum_icp_xdr_rate' : IDL.Nat64,
45
+ 'maximum_node_provider_rewards_e8s' : IDL.Nat64,
46
+ });
47
+ const RewardEvent = IDL.Record({
48
+ 'day_after_genesis' : IDL.Nat64,
49
+ 'actual_timestamp_seconds' : IDL.Nat64,
50
+ 'distributed_e8s_equivalent' : IDL.Nat64,
51
+ 'settled_proposals' : IDL.Vec(NeuronId),
52
+ });
53
+ const NeuronStakeTransfer = IDL.Record({
54
+ 'to_subaccount' : IDL.Vec(IDL.Nat8),
55
+ 'neuron_stake_e8s' : IDL.Nat64,
56
+ 'from' : IDL.Opt(IDL.Principal),
57
+ 'memo' : IDL.Nat64,
58
+ 'from_subaccount' : IDL.Vec(IDL.Nat8),
59
+ 'transfer_timestamp' : IDL.Nat64,
60
+ 'block_height' : IDL.Nat64,
61
+ });
62
+ const GovernanceError = IDL.Record({
63
+ 'error_message' : IDL.Text,
64
+ 'error_type' : IDL.Int32,
65
+ });
66
+ const Ballot = IDL.Record({ 'vote' : IDL.Int32, 'voting_power' : IDL.Nat64 });
67
+ const Tally = IDL.Record({
68
+ 'no' : IDL.Nat64,
69
+ 'yes' : IDL.Nat64,
70
+ 'total' : IDL.Nat64,
71
+ 'timestamp_seconds' : IDL.Nat64,
72
+ });
73
+ const KnownNeuronData = IDL.Record({
74
+ 'name' : IDL.Text,
75
+ 'description' : IDL.Opt(IDL.Text),
76
+ });
77
+ const KnownNeuron = IDL.Record({
78
+ 'id' : IDL.Opt(NeuronId),
79
+ 'known_neuron_data' : IDL.Opt(KnownNeuronData),
80
+ });
81
+ const Spawn = IDL.Record({
82
+ 'new_controller' : IDL.Opt(IDL.Principal),
83
+ 'nonce' : IDL.Opt(IDL.Nat64),
84
+ });
85
+ const Split = IDL.Record({ 'amount_e8s' : IDL.Nat64 });
86
+ const Follow = IDL.Record({
87
+ 'topic' : IDL.Int32,
88
+ 'followees' : IDL.Vec(NeuronId),
89
+ });
90
+ const ClaimOrRefreshNeuronFromAccount = IDL.Record({
91
+ 'controller' : IDL.Opt(IDL.Principal),
92
+ 'memo' : IDL.Nat64,
93
+ });
94
+ const By = IDL.Variant({
95
+ 'NeuronIdOrSubaccount' : IDL.Record({}),
96
+ 'MemoAndController' : ClaimOrRefreshNeuronFromAccount,
97
+ 'Memo' : IDL.Nat64,
98
+ });
99
+ const ClaimOrRefresh = IDL.Record({ 'by' : IDL.Opt(By) });
100
+ const RemoveHotKey = IDL.Record({
101
+ 'hot_key_to_remove' : IDL.Opt(IDL.Principal),
102
+ });
103
+ const AddHotKey = IDL.Record({ 'new_hot_key' : IDL.Opt(IDL.Principal) });
104
+ const IncreaseDissolveDelay = IDL.Record({
105
+ 'additional_dissolve_delay_seconds' : IDL.Nat32,
106
+ });
107
+ const SetDissolveTimestamp = IDL.Record({
108
+ 'dissolve_timestamp_seconds' : IDL.Nat64,
109
+ });
110
+ const Operation = IDL.Variant({
111
+ 'RemoveHotKey' : RemoveHotKey,
112
+ 'AddHotKey' : AddHotKey,
113
+ 'StopDissolving' : IDL.Record({}),
114
+ 'StartDissolving' : IDL.Record({}),
115
+ 'IncreaseDissolveDelay' : IncreaseDissolveDelay,
116
+ 'JoinCommunityFund' : IDL.Record({}),
117
+ 'SetDissolveTimestamp' : SetDissolveTimestamp,
118
+ });
119
+ const Configure = IDL.Record({ 'operation' : IDL.Opt(Operation) });
120
+ const RegisterVote = IDL.Record({
121
+ 'vote' : IDL.Int32,
122
+ 'proposal' : IDL.Opt(NeuronId),
123
+ });
124
+ const Merge = IDL.Record({ 'source_neuron_id' : IDL.Opt(NeuronId) });
125
+ const DisburseToNeuron = IDL.Record({
126
+ 'dissolve_delay_seconds' : IDL.Nat64,
127
+ 'kyc_verified' : IDL.Bool,
128
+ 'amount_e8s' : IDL.Nat64,
129
+ 'new_controller' : IDL.Opt(IDL.Principal),
130
+ 'nonce' : IDL.Nat64,
131
+ });
132
+ const MergeMaturity = IDL.Record({ 'percentage_to_merge' : IDL.Nat32 });
133
+ const Amount = IDL.Record({ 'e8s' : IDL.Nat64 });
134
+ const Disburse = IDL.Record({
135
+ 'to_account' : IDL.Opt(AccountIdentifier),
136
+ 'amount' : IDL.Opt(Amount),
137
+ });
138
+ const Command = IDL.Variant({
139
+ 'Spawn' : Spawn,
140
+ 'Split' : Split,
141
+ 'Follow' : Follow,
142
+ 'ClaimOrRefresh' : ClaimOrRefresh,
143
+ 'Configure' : Configure,
144
+ 'RegisterVote' : RegisterVote,
145
+ 'Merge' : Merge,
146
+ 'DisburseToNeuron' : DisburseToNeuron,
147
+ 'MakeProposal' : Proposal,
148
+ 'MergeMaturity' : MergeMaturity,
149
+ 'Disburse' : Disburse,
150
+ });
151
+ const NeuronIdOrSubaccount = IDL.Variant({
152
+ 'Subaccount' : IDL.Vec(IDL.Nat8),
153
+ 'NeuronId' : NeuronId,
154
+ });
155
+ const ManageNeuron = IDL.Record({
156
+ 'id' : IDL.Opt(NeuronId),
157
+ 'command' : IDL.Opt(Command),
158
+ 'neuron_id_or_subaccount' : IDL.Opt(NeuronIdOrSubaccount),
159
+ });
160
+ const ExecuteNnsFunction = IDL.Record({
161
+ 'nns_function' : IDL.Int32,
162
+ 'payload' : IDL.Vec(IDL.Nat8),
163
+ });
164
+ const RewardToNeuron = IDL.Record({ 'dissolve_delay_seconds' : IDL.Nat64 });
165
+ const RewardToAccount = IDL.Record({
166
+ 'to_account' : IDL.Opt(AccountIdentifier),
167
+ });
168
+ const RewardMode = IDL.Variant({
169
+ 'RewardToNeuron' : RewardToNeuron,
170
+ 'RewardToAccount' : RewardToAccount,
171
+ });
172
+ const RewardNodeProvider = IDL.Record({
173
+ 'node_provider' : IDL.Opt(NodeProvider),
174
+ 'reward_mode' : IDL.Opt(RewardMode),
175
+ 'amount_e8s' : IDL.Nat64,
176
+ });
177
+ const SetDefaultFollowees = IDL.Record({
178
+ 'default_followees' : IDL.Vec(IDL.Tuple(IDL.Int32, Followees)),
179
+ });
180
+ const RewardNodeProviders = IDL.Record({
181
+ 'rewards' : IDL.Vec(RewardNodeProvider),
182
+ });
183
+ const ApproveGenesisKyc = IDL.Record({
184
+ 'principals' : IDL.Vec(IDL.Principal),
185
+ });
186
+ const Change = IDL.Variant({
187
+ 'ToRemove' : NodeProvider,
188
+ 'ToAdd' : NodeProvider,
189
+ });
190
+ const AddOrRemoveNodeProvider = IDL.Record({ 'change' : IDL.Opt(Change) });
191
+ const Motion = IDL.Record({ 'motion_text' : IDL.Text });
192
+ const Action = IDL.Variant({
193
+ 'RegisterKnownNeuron' : KnownNeuron,
194
+ 'ManageNeuron' : ManageNeuron,
195
+ 'ExecuteNnsFunction' : ExecuteNnsFunction,
196
+ 'RewardNodeProvider' : RewardNodeProvider,
197
+ 'SetDefaultFollowees' : SetDefaultFollowees,
198
+ 'RewardNodeProviders' : RewardNodeProviders,
199
+ 'ManageNetworkEconomics' : NetworkEconomics,
200
+ 'ApproveGenesisKyc' : ApproveGenesisKyc,
201
+ 'AddOrRemoveNodeProvider' : AddOrRemoveNodeProvider,
202
+ 'Motion' : Motion,
203
+ });
204
+ Proposal.fill(
205
+ IDL.Record({
206
+ 'url' : IDL.Text,
207
+ 'title' : IDL.Opt(IDL.Text),
208
+ 'action' : IDL.Opt(Action),
209
+ 'summary' : IDL.Text,
210
+ })
211
+ );
212
+ const WaitForQuietState = IDL.Record({
213
+ 'current_deadline_timestamp_seconds' : IDL.Nat64,
214
+ });
215
+ const ProposalData = IDL.Record({
216
+ 'id' : IDL.Opt(NeuronId),
217
+ 'failure_reason' : IDL.Opt(GovernanceError),
218
+ 'ballots' : IDL.Vec(IDL.Tuple(IDL.Nat64, Ballot)),
219
+ 'proposal_timestamp_seconds' : IDL.Nat64,
220
+ 'reward_event_round' : IDL.Nat64,
221
+ 'failed_timestamp_seconds' : IDL.Nat64,
222
+ 'reject_cost_e8s' : IDL.Nat64,
223
+ 'latest_tally' : IDL.Opt(Tally),
224
+ 'decided_timestamp_seconds' : IDL.Nat64,
225
+ 'proposal' : IDL.Opt(Proposal),
226
+ 'proposer' : IDL.Opt(NeuronId),
227
+ 'wait_for_quiet_state' : IDL.Opt(WaitForQuietState),
228
+ 'executed_timestamp_seconds' : IDL.Nat64,
229
+ });
230
+ const Command_2 = IDL.Variant({
231
+ 'Spawn' : Spawn,
232
+ 'Split' : Split,
233
+ 'Configure' : Configure,
234
+ 'Merge' : Merge,
235
+ 'DisburseToNeuron' : DisburseToNeuron,
236
+ 'ClaimOrRefreshNeuron' : ClaimOrRefresh,
237
+ 'MergeMaturity' : MergeMaturity,
238
+ 'Disburse' : Disburse,
239
+ });
240
+ const NeuronInFlightCommand = IDL.Record({
241
+ 'command' : IDL.Opt(Command_2),
242
+ 'timestamp' : IDL.Nat64,
243
+ });
244
+ const BallotInfo = IDL.Record({
245
+ 'vote' : IDL.Int32,
246
+ 'proposal_id' : IDL.Opt(NeuronId),
247
+ });
248
+ const DissolveState = IDL.Variant({
249
+ 'DissolveDelaySeconds' : IDL.Nat64,
250
+ 'WhenDissolvedTimestampSeconds' : IDL.Nat64,
251
+ });
252
+ const Neuron = IDL.Record({
253
+ 'id' : IDL.Opt(NeuronId),
254
+ 'controller' : IDL.Opt(IDL.Principal),
255
+ 'recent_ballots' : IDL.Vec(BallotInfo),
256
+ 'kyc_verified' : IDL.Bool,
257
+ 'not_for_profit' : IDL.Bool,
258
+ 'maturity_e8s_equivalent' : IDL.Nat64,
259
+ 'cached_neuron_stake_e8s' : IDL.Nat64,
260
+ 'created_timestamp_seconds' : IDL.Nat64,
261
+ 'aging_since_timestamp_seconds' : IDL.Nat64,
262
+ 'hot_keys' : IDL.Vec(IDL.Principal),
263
+ 'account' : IDL.Vec(IDL.Nat8),
264
+ 'joined_community_fund_timestamp_seconds' : IDL.Opt(IDL.Nat64),
265
+ 'dissolve_state' : IDL.Opt(DissolveState),
266
+ 'followees' : IDL.Vec(IDL.Tuple(IDL.Int32, Followees)),
267
+ 'neuron_fees_e8s' : IDL.Nat64,
268
+ 'transfer' : IDL.Opt(NeuronStakeTransfer),
269
+ 'known_neuron_data' : IDL.Opt(KnownNeuronData),
270
+ });
271
+ const Governance = IDL.Record({
272
+ 'default_followees' : IDL.Vec(IDL.Tuple(IDL.Int32, Followees)),
273
+ 'wait_for_quiet_threshold_seconds' : IDL.Nat64,
274
+ 'metrics' : IDL.Opt(GovernanceCachedMetrics),
275
+ 'node_providers' : IDL.Vec(NodeProvider),
276
+ 'economics' : IDL.Opt(NetworkEconomics),
277
+ 'latest_reward_event' : IDL.Opt(RewardEvent),
278
+ 'to_claim_transfers' : IDL.Vec(NeuronStakeTransfer),
279
+ 'short_voting_period_seconds' : IDL.Nat64,
280
+ 'proposals' : IDL.Vec(IDL.Tuple(IDL.Nat64, ProposalData)),
281
+ 'in_flight_commands' : IDL.Vec(IDL.Tuple(IDL.Nat64, NeuronInFlightCommand)),
282
+ 'neurons' : IDL.Vec(IDL.Tuple(IDL.Nat64, Neuron)),
283
+ 'genesis_timestamp_seconds' : IDL.Nat64,
284
+ });
285
+ const Result = IDL.Variant({ 'Ok' : IDL.Null, 'Err' : GovernanceError });
286
+ const Result_1 = IDL.Variant({
287
+ 'Error' : GovernanceError,
288
+ 'NeuronId' : NeuronId,
289
+ });
290
+ const ClaimOrRefreshNeuronFromAccountResponse = IDL.Record({
291
+ 'result' : IDL.Opt(Result_1),
292
+ });
293
+ const Result_2 = IDL.Variant({ 'Ok' : Neuron, 'Err' : GovernanceError });
294
+ const Result_3 = IDL.Variant({
295
+ 'Ok' : RewardNodeProviders,
296
+ 'Err' : GovernanceError,
297
+ });
298
+ const NeuronInfo = IDL.Record({
299
+ 'dissolve_delay_seconds' : IDL.Nat64,
300
+ 'recent_ballots' : IDL.Vec(BallotInfo),
301
+ 'created_timestamp_seconds' : IDL.Nat64,
302
+ 'state' : IDL.Int32,
303
+ 'stake_e8s' : IDL.Nat64,
304
+ 'joined_community_fund_timestamp_seconds' : IDL.Opt(IDL.Nat64),
305
+ 'retrieved_at_timestamp_seconds' : IDL.Nat64,
306
+ 'known_neuron_data' : IDL.Opt(KnownNeuronData),
307
+ 'voting_power' : IDL.Nat64,
308
+ 'age_seconds' : IDL.Nat64,
309
+ });
310
+ const Result_4 = IDL.Variant({ 'Ok' : NeuronInfo, 'Err' : GovernanceError });
311
+ const ProposalInfo = IDL.Record({
312
+ 'id' : IDL.Opt(NeuronId),
313
+ 'status' : IDL.Int32,
314
+ 'topic' : IDL.Int32,
315
+ 'failure_reason' : IDL.Opt(GovernanceError),
316
+ 'ballots' : IDL.Vec(IDL.Tuple(IDL.Nat64, Ballot)),
317
+ 'proposal_timestamp_seconds' : IDL.Nat64,
318
+ 'reward_event_round' : IDL.Nat64,
319
+ 'deadline_timestamp_seconds' : IDL.Opt(IDL.Nat64),
320
+ 'failed_timestamp_seconds' : IDL.Nat64,
321
+ 'reject_cost_e8s' : IDL.Nat64,
322
+ 'latest_tally' : IDL.Opt(Tally),
323
+ 'reward_status' : IDL.Int32,
324
+ 'decided_timestamp_seconds' : IDL.Nat64,
325
+ 'proposal' : IDL.Opt(Proposal),
326
+ 'proposer' : IDL.Opt(NeuronId),
327
+ 'executed_timestamp_seconds' : IDL.Nat64,
328
+ });
329
+ const ListKnownNeuronsResponse = IDL.Record({
330
+ 'known_neurons' : IDL.Vec(KnownNeuron),
331
+ });
332
+ const ListNeurons = IDL.Record({
333
+ 'neuron_ids' : IDL.Vec(IDL.Nat64),
334
+ 'include_neurons_readable_by_caller' : IDL.Bool,
335
+ });
336
+ const ListNeuronsResponse = IDL.Record({
337
+ 'neuron_infos' : IDL.Vec(IDL.Tuple(IDL.Nat64, NeuronInfo)),
338
+ 'full_neurons' : IDL.Vec(Neuron),
339
+ });
340
+ const ListProposalInfo = IDL.Record({
341
+ 'include_reward_status' : IDL.Vec(IDL.Int32),
342
+ 'before_proposal' : IDL.Opt(NeuronId),
343
+ 'limit' : IDL.Nat32,
344
+ 'exclude_topic' : IDL.Vec(IDL.Int32),
345
+ 'include_status' : IDL.Vec(IDL.Int32),
346
+ });
347
+ const ListProposalInfoResponse = IDL.Record({
348
+ 'proposal_info' : IDL.Vec(ProposalInfo),
349
+ });
350
+ const SpawnResponse = IDL.Record({ 'created_neuron_id' : IDL.Opt(NeuronId) });
351
+ const ClaimOrRefreshResponse = IDL.Record({
352
+ 'refreshed_neuron_id' : IDL.Opt(NeuronId),
353
+ });
354
+ const MakeProposalResponse = IDL.Record({
355
+ 'proposal_id' : IDL.Opt(NeuronId),
356
+ });
357
+ const MergeMaturityResponse = IDL.Record({
358
+ 'merged_maturity_e8s' : IDL.Nat64,
359
+ 'new_stake_e8s' : IDL.Nat64,
360
+ });
361
+ const DisburseResponse = IDL.Record({ 'transfer_block_height' : IDL.Nat64 });
362
+ const Command_1 = IDL.Variant({
363
+ 'Error' : GovernanceError,
364
+ 'Spawn' : SpawnResponse,
365
+ 'Split' : SpawnResponse,
366
+ 'Follow' : IDL.Record({}),
367
+ 'ClaimOrRefresh' : ClaimOrRefreshResponse,
368
+ 'Configure' : IDL.Record({}),
369
+ 'RegisterVote' : IDL.Record({}),
370
+ 'Merge' : IDL.Record({}),
371
+ 'DisburseToNeuron' : SpawnResponse,
372
+ 'MakeProposal' : MakeProposalResponse,
373
+ 'MergeMaturity' : MergeMaturityResponse,
374
+ 'Disburse' : DisburseResponse,
375
+ });
376
+ const ManageNeuronResponse = IDL.Record({ 'command' : IDL.Opt(Command_1) });
377
+ const UpdateNodeProvider = IDL.Record({
378
+ 'reward_account' : IDL.Opt(AccountIdentifier),
379
+ });
380
+ return IDL.Service({
381
+ 'claim_gtc_neurons' : IDL.Func(
382
+ [IDL.Principal, IDL.Vec(NeuronId)],
383
+ [Result],
384
+ [],
385
+ ),
386
+ 'claim_or_refresh_neuron_from_account' : IDL.Func(
387
+ [ClaimOrRefreshNeuronFromAccount],
388
+ [ClaimOrRefreshNeuronFromAccountResponse],
389
+ [],
390
+ ),
391
+ 'get_build_metadata' : IDL.Func([], [IDL.Text], []),
392
+ 'get_full_neuron' : IDL.Func([IDL.Nat64], [Result_2], []),
393
+ 'get_full_neuron_by_id_or_subaccount' : IDL.Func(
394
+ [NeuronIdOrSubaccount],
395
+ [Result_2],
396
+ [],
397
+ ),
398
+ 'get_monthly_node_provider_rewards' : IDL.Func([], [Result_3], []),
399
+ 'get_neuron_ids' : IDL.Func([], [IDL.Vec(IDL.Nat64)], []),
400
+ 'get_neuron_info' : IDL.Func([IDL.Nat64], [Result_4], []),
401
+ 'get_neuron_info_by_id_or_subaccount' : IDL.Func(
402
+ [NeuronIdOrSubaccount],
403
+ [Result_4],
404
+ [],
405
+ ),
406
+ 'get_pending_proposals' : IDL.Func([], [IDL.Vec(ProposalInfo)], []),
407
+ 'get_proposal_info' : IDL.Func([IDL.Nat64], [IDL.Opt(ProposalInfo)], []),
408
+ 'list_known_neurons' : IDL.Func([], [ListKnownNeuronsResponse], []),
409
+ 'list_neurons' : IDL.Func([ListNeurons], [ListNeuronsResponse], []),
410
+ 'list_proposals' : IDL.Func(
411
+ [ListProposalInfo],
412
+ [ListProposalInfoResponse],
413
+ [],
414
+ ),
415
+ 'manage_neuron' : IDL.Func([ManageNeuron], [ManageNeuronResponse], []),
416
+ 'transfer_gtc_neuron' : IDL.Func([NeuronId, NeuronId], [Result], []),
417
+ 'update_node_provider' : IDL.Func([UpdateNodeProvider], [Result], []),
418
+ });
419
+ };
420
+ export const init = ({ IDL }) => {
421
+ const Proposal = IDL.Rec();
422
+ const NeuronId = IDL.Record({ 'id' : IDL.Nat64 });
423
+ const Followees = IDL.Record({ 'followees' : IDL.Vec(NeuronId) });
424
+ const GovernanceCachedMetrics = IDL.Record({
425
+ 'not_dissolving_neurons_e8s_buckets' : IDL.Vec(
426
+ IDL.Tuple(IDL.Nat64, IDL.Float64)
427
+ ),
428
+ 'garbage_collectable_neurons_count' : IDL.Nat64,
429
+ 'neurons_with_invalid_stake_count' : IDL.Nat64,
430
+ 'not_dissolving_neurons_count_buckets' : IDL.Vec(
431
+ IDL.Tuple(IDL.Nat64, IDL.Nat64)
432
+ ),
433
+ 'total_supply_icp' : IDL.Nat64,
434
+ 'neurons_with_less_than_6_months_dissolve_delay_count' : IDL.Nat64,
435
+ 'dissolved_neurons_count' : IDL.Nat64,
436
+ 'total_staked_e8s' : IDL.Nat64,
437
+ 'not_dissolving_neurons_count' : IDL.Nat64,
438
+ 'dissolved_neurons_e8s' : IDL.Nat64,
439
+ 'neurons_with_less_than_6_months_dissolve_delay_e8s' : IDL.Nat64,
440
+ 'dissolving_neurons_count_buckets' : IDL.Vec(
441
+ IDL.Tuple(IDL.Nat64, IDL.Nat64)
442
+ ),
443
+ 'dissolving_neurons_count' : IDL.Nat64,
444
+ 'dissolving_neurons_e8s_buckets' : IDL.Vec(
445
+ IDL.Tuple(IDL.Nat64, IDL.Float64)
446
+ ),
447
+ 'community_fund_total_staked_e8s' : IDL.Nat64,
448
+ 'timestamp_seconds' : IDL.Nat64,
449
+ });
450
+ const AccountIdentifier = IDL.Record({ 'hash' : IDL.Vec(IDL.Nat8) });
451
+ const NodeProvider = IDL.Record({
452
+ 'id' : IDL.Opt(IDL.Principal),
453
+ 'reward_account' : IDL.Opt(AccountIdentifier),
454
+ });
455
+ const NetworkEconomics = IDL.Record({
456
+ 'neuron_minimum_stake_e8s' : IDL.Nat64,
457
+ 'max_proposals_to_keep_per_topic' : IDL.Nat32,
458
+ 'neuron_management_fee_per_proposal_e8s' : IDL.Nat64,
459
+ 'reject_cost_e8s' : IDL.Nat64,
460
+ 'transaction_fee_e8s' : IDL.Nat64,
461
+ 'neuron_spawn_dissolve_delay_seconds' : IDL.Nat64,
462
+ 'minimum_icp_xdr_rate' : IDL.Nat64,
463
+ 'maximum_node_provider_rewards_e8s' : IDL.Nat64,
464
+ });
465
+ const RewardEvent = IDL.Record({
466
+ 'day_after_genesis' : IDL.Nat64,
467
+ 'actual_timestamp_seconds' : IDL.Nat64,
468
+ 'distributed_e8s_equivalent' : IDL.Nat64,
469
+ 'settled_proposals' : IDL.Vec(NeuronId),
470
+ });
471
+ const NeuronStakeTransfer = IDL.Record({
472
+ 'to_subaccount' : IDL.Vec(IDL.Nat8),
473
+ 'neuron_stake_e8s' : IDL.Nat64,
474
+ 'from' : IDL.Opt(IDL.Principal),
475
+ 'memo' : IDL.Nat64,
476
+ 'from_subaccount' : IDL.Vec(IDL.Nat8),
477
+ 'transfer_timestamp' : IDL.Nat64,
478
+ 'block_height' : IDL.Nat64,
479
+ });
480
+ const GovernanceError = IDL.Record({
481
+ 'error_message' : IDL.Text,
482
+ 'error_type' : IDL.Int32,
483
+ });
484
+ const Ballot = IDL.Record({ 'vote' : IDL.Int32, 'voting_power' : IDL.Nat64 });
485
+ const Tally = IDL.Record({
486
+ 'no' : IDL.Nat64,
487
+ 'yes' : IDL.Nat64,
488
+ 'total' : IDL.Nat64,
489
+ 'timestamp_seconds' : IDL.Nat64,
490
+ });
491
+ const KnownNeuronData = IDL.Record({
492
+ 'name' : IDL.Text,
493
+ 'description' : IDL.Opt(IDL.Text),
494
+ });
495
+ const KnownNeuron = IDL.Record({
496
+ 'id' : IDL.Opt(NeuronId),
497
+ 'known_neuron_data' : IDL.Opt(KnownNeuronData),
498
+ });
499
+ const Spawn = IDL.Record({
500
+ 'new_controller' : IDL.Opt(IDL.Principal),
501
+ 'nonce' : IDL.Opt(IDL.Nat64),
502
+ });
503
+ const Split = IDL.Record({ 'amount_e8s' : IDL.Nat64 });
504
+ const Follow = IDL.Record({
505
+ 'topic' : IDL.Int32,
506
+ 'followees' : IDL.Vec(NeuronId),
507
+ });
508
+ const ClaimOrRefreshNeuronFromAccount = IDL.Record({
509
+ 'controller' : IDL.Opt(IDL.Principal),
510
+ 'memo' : IDL.Nat64,
511
+ });
512
+ const By = IDL.Variant({
513
+ 'NeuronIdOrSubaccount' : IDL.Record({}),
514
+ 'MemoAndController' : ClaimOrRefreshNeuronFromAccount,
515
+ 'Memo' : IDL.Nat64,
516
+ });
517
+ const ClaimOrRefresh = IDL.Record({ 'by' : IDL.Opt(By) });
518
+ const RemoveHotKey = IDL.Record({
519
+ 'hot_key_to_remove' : IDL.Opt(IDL.Principal),
520
+ });
521
+ const AddHotKey = IDL.Record({ 'new_hot_key' : IDL.Opt(IDL.Principal) });
522
+ const IncreaseDissolveDelay = IDL.Record({
523
+ 'additional_dissolve_delay_seconds' : IDL.Nat32,
524
+ });
525
+ const SetDissolveTimestamp = IDL.Record({
526
+ 'dissolve_timestamp_seconds' : IDL.Nat64,
527
+ });
528
+ const Operation = IDL.Variant({
529
+ 'RemoveHotKey' : RemoveHotKey,
530
+ 'AddHotKey' : AddHotKey,
531
+ 'StopDissolving' : IDL.Record({}),
532
+ 'StartDissolving' : IDL.Record({}),
533
+ 'IncreaseDissolveDelay' : IncreaseDissolveDelay,
534
+ 'JoinCommunityFund' : IDL.Record({}),
535
+ 'SetDissolveTimestamp' : SetDissolveTimestamp,
536
+ });
537
+ const Configure = IDL.Record({ 'operation' : IDL.Opt(Operation) });
538
+ const RegisterVote = IDL.Record({
539
+ 'vote' : IDL.Int32,
540
+ 'proposal' : IDL.Opt(NeuronId),
541
+ });
542
+ const Merge = IDL.Record({ 'source_neuron_id' : IDL.Opt(NeuronId) });
543
+ const DisburseToNeuron = IDL.Record({
544
+ 'dissolve_delay_seconds' : IDL.Nat64,
545
+ 'kyc_verified' : IDL.Bool,
546
+ 'amount_e8s' : IDL.Nat64,
547
+ 'new_controller' : IDL.Opt(IDL.Principal),
548
+ 'nonce' : IDL.Nat64,
549
+ });
550
+ const MergeMaturity = IDL.Record({ 'percentage_to_merge' : IDL.Nat32 });
551
+ const Amount = IDL.Record({ 'e8s' : IDL.Nat64 });
552
+ const Disburse = IDL.Record({
553
+ 'to_account' : IDL.Opt(AccountIdentifier),
554
+ 'amount' : IDL.Opt(Amount),
555
+ });
556
+ const Command = IDL.Variant({
557
+ 'Spawn' : Spawn,
558
+ 'Split' : Split,
559
+ 'Follow' : Follow,
560
+ 'ClaimOrRefresh' : ClaimOrRefresh,
561
+ 'Configure' : Configure,
562
+ 'RegisterVote' : RegisterVote,
563
+ 'Merge' : Merge,
564
+ 'DisburseToNeuron' : DisburseToNeuron,
565
+ 'MakeProposal' : Proposal,
566
+ 'MergeMaturity' : MergeMaturity,
567
+ 'Disburse' : Disburse,
568
+ });
569
+ const NeuronIdOrSubaccount = IDL.Variant({
570
+ 'Subaccount' : IDL.Vec(IDL.Nat8),
571
+ 'NeuronId' : NeuronId,
572
+ });
573
+ const ManageNeuron = IDL.Record({
574
+ 'id' : IDL.Opt(NeuronId),
575
+ 'command' : IDL.Opt(Command),
576
+ 'neuron_id_or_subaccount' : IDL.Opt(NeuronIdOrSubaccount),
577
+ });
578
+ const ExecuteNnsFunction = IDL.Record({
579
+ 'nns_function' : IDL.Int32,
580
+ 'payload' : IDL.Vec(IDL.Nat8),
581
+ });
582
+ const RewardToNeuron = IDL.Record({ 'dissolve_delay_seconds' : IDL.Nat64 });
583
+ const RewardToAccount = IDL.Record({
584
+ 'to_account' : IDL.Opt(AccountIdentifier),
585
+ });
586
+ const RewardMode = IDL.Variant({
587
+ 'RewardToNeuron' : RewardToNeuron,
588
+ 'RewardToAccount' : RewardToAccount,
589
+ });
590
+ const RewardNodeProvider = IDL.Record({
591
+ 'node_provider' : IDL.Opt(NodeProvider),
592
+ 'reward_mode' : IDL.Opt(RewardMode),
593
+ 'amount_e8s' : IDL.Nat64,
594
+ });
595
+ const SetDefaultFollowees = IDL.Record({
596
+ 'default_followees' : IDL.Vec(IDL.Tuple(IDL.Int32, Followees)),
597
+ });
598
+ const RewardNodeProviders = IDL.Record({
599
+ 'rewards' : IDL.Vec(RewardNodeProvider),
600
+ });
601
+ const ApproveGenesisKyc = IDL.Record({
602
+ 'principals' : IDL.Vec(IDL.Principal),
603
+ });
604
+ const Change = IDL.Variant({
605
+ 'ToRemove' : NodeProvider,
606
+ 'ToAdd' : NodeProvider,
607
+ });
608
+ const AddOrRemoveNodeProvider = IDL.Record({ 'change' : IDL.Opt(Change) });
609
+ const Motion = IDL.Record({ 'motion_text' : IDL.Text });
610
+ const Action = IDL.Variant({
611
+ 'RegisterKnownNeuron' : KnownNeuron,
612
+ 'ManageNeuron' : ManageNeuron,
613
+ 'ExecuteNnsFunction' : ExecuteNnsFunction,
614
+ 'RewardNodeProvider' : RewardNodeProvider,
615
+ 'SetDefaultFollowees' : SetDefaultFollowees,
616
+ 'RewardNodeProviders' : RewardNodeProviders,
617
+ 'ManageNetworkEconomics' : NetworkEconomics,
618
+ 'ApproveGenesisKyc' : ApproveGenesisKyc,
619
+ 'AddOrRemoveNodeProvider' : AddOrRemoveNodeProvider,
620
+ 'Motion' : Motion,
621
+ });
622
+ Proposal.fill(
623
+ IDL.Record({
624
+ 'url' : IDL.Text,
625
+ 'title' : IDL.Opt(IDL.Text),
626
+ 'action' : IDL.Opt(Action),
627
+ 'summary' : IDL.Text,
628
+ })
629
+ );
630
+ const WaitForQuietState = IDL.Record({
631
+ 'current_deadline_timestamp_seconds' : IDL.Nat64,
632
+ });
633
+ const ProposalData = IDL.Record({
634
+ 'id' : IDL.Opt(NeuronId),
635
+ 'failure_reason' : IDL.Opt(GovernanceError),
636
+ 'ballots' : IDL.Vec(IDL.Tuple(IDL.Nat64, Ballot)),
637
+ 'proposal_timestamp_seconds' : IDL.Nat64,
638
+ 'reward_event_round' : IDL.Nat64,
639
+ 'failed_timestamp_seconds' : IDL.Nat64,
640
+ 'reject_cost_e8s' : IDL.Nat64,
641
+ 'latest_tally' : IDL.Opt(Tally),
642
+ 'decided_timestamp_seconds' : IDL.Nat64,
643
+ 'proposal' : IDL.Opt(Proposal),
644
+ 'proposer' : IDL.Opt(NeuronId),
645
+ 'wait_for_quiet_state' : IDL.Opt(WaitForQuietState),
646
+ 'executed_timestamp_seconds' : IDL.Nat64,
647
+ });
648
+ const Command_2 = IDL.Variant({
649
+ 'Spawn' : Spawn,
650
+ 'Split' : Split,
651
+ 'Configure' : Configure,
652
+ 'Merge' : Merge,
653
+ 'DisburseToNeuron' : DisburseToNeuron,
654
+ 'ClaimOrRefreshNeuron' : ClaimOrRefresh,
655
+ 'MergeMaturity' : MergeMaturity,
656
+ 'Disburse' : Disburse,
657
+ });
658
+ const NeuronInFlightCommand = IDL.Record({
659
+ 'command' : IDL.Opt(Command_2),
660
+ 'timestamp' : IDL.Nat64,
661
+ });
662
+ const BallotInfo = IDL.Record({
663
+ 'vote' : IDL.Int32,
664
+ 'proposal_id' : IDL.Opt(NeuronId),
665
+ });
666
+ const DissolveState = IDL.Variant({
667
+ 'DissolveDelaySeconds' : IDL.Nat64,
668
+ 'WhenDissolvedTimestampSeconds' : IDL.Nat64,
669
+ });
670
+ const Neuron = IDL.Record({
671
+ 'id' : IDL.Opt(NeuronId),
672
+ 'controller' : IDL.Opt(IDL.Principal),
673
+ 'recent_ballots' : IDL.Vec(BallotInfo),
674
+ 'kyc_verified' : IDL.Bool,
675
+ 'not_for_profit' : IDL.Bool,
676
+ 'maturity_e8s_equivalent' : IDL.Nat64,
677
+ 'cached_neuron_stake_e8s' : IDL.Nat64,
678
+ 'created_timestamp_seconds' : IDL.Nat64,
679
+ 'aging_since_timestamp_seconds' : IDL.Nat64,
680
+ 'hot_keys' : IDL.Vec(IDL.Principal),
681
+ 'account' : IDL.Vec(IDL.Nat8),
682
+ 'joined_community_fund_timestamp_seconds' : IDL.Opt(IDL.Nat64),
683
+ 'dissolve_state' : IDL.Opt(DissolveState),
684
+ 'followees' : IDL.Vec(IDL.Tuple(IDL.Int32, Followees)),
685
+ 'neuron_fees_e8s' : IDL.Nat64,
686
+ 'transfer' : IDL.Opt(NeuronStakeTransfer),
687
+ 'known_neuron_data' : IDL.Opt(KnownNeuronData),
688
+ });
689
+ const Governance = IDL.Record({
690
+ 'default_followees' : IDL.Vec(IDL.Tuple(IDL.Int32, Followees)),
691
+ 'wait_for_quiet_threshold_seconds' : IDL.Nat64,
692
+ 'metrics' : IDL.Opt(GovernanceCachedMetrics),
693
+ 'node_providers' : IDL.Vec(NodeProvider),
694
+ 'economics' : IDL.Opt(NetworkEconomics),
695
+ 'latest_reward_event' : IDL.Opt(RewardEvent),
696
+ 'to_claim_transfers' : IDL.Vec(NeuronStakeTransfer),
697
+ 'short_voting_period_seconds' : IDL.Nat64,
698
+ 'proposals' : IDL.Vec(IDL.Tuple(IDL.Nat64, ProposalData)),
699
+ 'in_flight_commands' : IDL.Vec(IDL.Tuple(IDL.Nat64, NeuronInFlightCommand)),
700
+ 'neurons' : IDL.Vec(IDL.Tuple(IDL.Nat64, Neuron)),
701
+ 'genesis_timestamp_seconds' : IDL.Nat64,
702
+ });
703
+ return [Governance];
704
+ };