@dfinity/nns 0.1.8 → 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 (71) hide show
  1. package/README.md +10 -11
  2. package/dist/candid/governance.certified.idl.d.ts +2 -0
  3. package/dist/candid/governance.certified.idl.js +704 -0
  4. package/dist/candid/governance.did +338 -0
  5. package/dist/candid/governance.idl.d.ts +5 -0
  6. package/dist/candid/governance.idl.js +712 -0
  7. package/dist/candid/governanceTypes.d.ts +413 -0
  8. package/dist/candid/nns_dapp.certified.idl.js +206 -0
  9. package/dist/candid/nns_dapp.did +240 -0
  10. package/dist/candid/nns_dapp.idl.js +206 -0
  11. package/dist/candid/payloads.did +168 -0
  12. package/dist/candid/payloads.idl.d.ts +20 -0
  13. package/dist/candid/payloads.idl.js +163 -0
  14. package/dist/cjs/index.cjs.js +869 -0
  15. package/dist/cjs/index.cjs.js.map +7 -0
  16. package/dist/esm/account_identifier.js +2 -0
  17. package/dist/esm/account_identifier.js.map +7 -0
  18. package/dist/esm/chunk-2DZXLOEC.js +14 -0
  19. package/dist/esm/chunk-2DZXLOEC.js.map +7 -0
  20. package/dist/esm/chunk-4FZAJTYF.js +2 -0
  21. package/dist/esm/chunk-4FZAJTYF.js.map +7 -0
  22. package/dist/esm/chunk-D2W3ELRE.js +3 -0
  23. package/dist/esm/chunk-D2W3ELRE.js.map +7 -0
  24. package/dist/esm/chunk-FVDRR6PO.js +17 -0
  25. package/dist/esm/chunk-FVDRR6PO.js.map +7 -0
  26. package/dist/esm/chunk-HMU24NWJ.js +825 -0
  27. package/dist/esm/chunk-HMU24NWJ.js.map +7 -0
  28. package/dist/esm/chunk-LNMGZ6W7.js +3 -0
  29. package/dist/esm/chunk-LNMGZ6W7.js.map +7 -0
  30. package/dist/esm/chunk-QR4654XK.js +2 -0
  31. package/dist/esm/chunk-QR4654XK.js.map +7 -0
  32. package/dist/esm/chunk-RUFBUR7C.js +4 -0
  33. package/dist/esm/chunk-RUFBUR7C.js.map +7 -0
  34. package/dist/esm/chunk-ZWZRSVU4.js +2 -0
  35. package/dist/esm/chunk-ZWZRSVU4.js.map +7 -0
  36. package/dist/esm/governance.js +2 -0
  37. package/dist/esm/governance.js.map +7 -0
  38. package/dist/esm/icp.js +2 -0
  39. package/dist/esm/icp.js.map +7 -0
  40. package/dist/esm/index.js +2 -0
  41. package/dist/esm/index.js.map +7 -0
  42. package/dist/esm/ledger.js +2 -0
  43. package/dist/esm/ledger.js.map +7 -0
  44. package/dist/index.cjs.js +1 -0
  45. package/dist/index.js +1 -0
  46. package/dist/proto/base_types.proto +60 -0
  47. package/dist/proto/base_types_pb.d.ts +144 -0
  48. package/dist/proto/base_types_pb.js +1071 -0
  49. package/dist/proto/ledger.proto +277 -0
  50. package/dist/proto/ledger_pb.d.ts +911 -0
  51. package/dist/proto/ledger_pb.js +6555 -0
  52. package/dist/types/account_identifier.d.ts +24 -0
  53. package/dist/types/canisters/governance/payloads.d.ts +3 -0
  54. package/dist/types/canisters/governance/request.converters.d.ts +27 -0
  55. package/dist/types/canisters/governance/response.converters.d.ts +35 -0
  56. package/dist/types/constants/canister_ids.d.ts +4 -0
  57. package/dist/types/constants/constants.d.ts +5 -0
  58. package/dist/types/governance.d.ts +49 -0
  59. package/dist/types/icp.d.ts +17 -0
  60. package/dist/types/index.d.ts +8 -0
  61. package/dist/types/ledger.d.ts +33 -0
  62. package/dist/types/types/common.d.ts +8 -0
  63. package/dist/types/types/governance.d.ts +9 -0
  64. package/dist/types/types/governance_converters.d.ts +532 -0
  65. package/dist/types/types/icp.d.ts +4 -0
  66. package/dist/types/types/ledger.d.ts +30 -0
  67. package/dist/types/types/option.d.ts +1 -0
  68. package/dist/types/utils/agent.utils.d.ts +5 -0
  69. package/dist/types/utils/converter.utils.d.ts +18 -0
  70. package/dist/types/utils/proto.utils.d.ts +12 -0
  71. package/package.json +18 -15
@@ -0,0 +1,413 @@
1
+ import type { Principal } from "@dfinity/principal";
2
+ export interface AccountIdentifier {
3
+ hash: Array<number>;
4
+ }
5
+ export type Action =
6
+ | { RegisterKnownNeuron: KnownNeuron }
7
+ | { ManageNeuron: ManageNeuron }
8
+ | { ExecuteNnsFunction: ExecuteNnsFunction }
9
+ | { RewardNodeProvider: RewardNodeProvider }
10
+ | { SetDefaultFollowees: SetDefaultFollowees }
11
+ | { RewardNodeProviders: RewardNodeProviders }
12
+ | { ManageNetworkEconomics: NetworkEconomics }
13
+ | { ApproveGenesisKyc: ApproveGenesisKyc }
14
+ | { AddOrRemoveNodeProvider: AddOrRemoveNodeProvider }
15
+ | { Motion: Motion };
16
+ export interface AddHotKey {
17
+ new_hot_key: [] | [Principal];
18
+ }
19
+ export interface AddOrRemoveNodeProvider {
20
+ change: [] | [Change];
21
+ }
22
+ export interface Amount {
23
+ e8s: bigint;
24
+ }
25
+ export interface ApproveGenesisKyc {
26
+ principals: Array<Principal>;
27
+ }
28
+ export interface Ballot {
29
+ vote: number;
30
+ voting_power: bigint;
31
+ }
32
+ export interface BallotInfo {
33
+ vote: number;
34
+ proposal_id: [] | [NeuronId];
35
+ }
36
+ export type By =
37
+ | { NeuronIdOrSubaccount: {} }
38
+ | { MemoAndController: ClaimOrRefreshNeuronFromAccount }
39
+ | { Memo: bigint };
40
+ export type Change = { ToRemove: NodeProvider } | { ToAdd: NodeProvider };
41
+ export interface ClaimOrRefresh {
42
+ by: [] | [By];
43
+ }
44
+ export interface ClaimOrRefreshNeuronFromAccount {
45
+ controller: [] | [Principal];
46
+ memo: bigint;
47
+ }
48
+ export interface ClaimOrRefreshNeuronFromAccountResponse {
49
+ result: [] | [Result_1];
50
+ }
51
+ export interface ClaimOrRefreshResponse {
52
+ refreshed_neuron_id: [] | [NeuronId];
53
+ }
54
+ export type Command =
55
+ | { Spawn: Spawn }
56
+ | { Split: Split }
57
+ | { Follow: Follow }
58
+ | { ClaimOrRefresh: ClaimOrRefresh }
59
+ | { Configure: Configure }
60
+ | { RegisterVote: RegisterVote }
61
+ | { Merge: Merge }
62
+ | { DisburseToNeuron: DisburseToNeuron }
63
+ | { MakeProposal: Proposal }
64
+ | { MergeMaturity: MergeMaturity }
65
+ | { Disburse: Disburse };
66
+ export type Command_1 =
67
+ | { Error: GovernanceError }
68
+ | { Spawn: SpawnResponse }
69
+ | { Split: SpawnResponse }
70
+ | { Follow: {} }
71
+ | { ClaimOrRefresh: ClaimOrRefreshResponse }
72
+ | { Configure: {} }
73
+ | { RegisterVote: {} }
74
+ | { Merge: {} }
75
+ | { DisburseToNeuron: SpawnResponse }
76
+ | { MakeProposal: MakeProposalResponse }
77
+ | { MergeMaturity: MergeMaturityResponse }
78
+ | { Disburse: DisburseResponse };
79
+ export type Command_2 =
80
+ | { Spawn: Spawn }
81
+ | { Split: Split }
82
+ | { Configure: Configure }
83
+ | { Merge: Merge }
84
+ | { DisburseToNeuron: DisburseToNeuron }
85
+ | { ClaimOrRefreshNeuron: ClaimOrRefresh }
86
+ | { MergeMaturity: MergeMaturity }
87
+ | { Disburse: Disburse };
88
+ export interface Configure {
89
+ operation: [] | [Operation];
90
+ }
91
+ export interface Disburse {
92
+ to_account: [] | [AccountIdentifier];
93
+ amount: [] | [Amount];
94
+ }
95
+ export interface DisburseResponse {
96
+ transfer_block_height: bigint;
97
+ }
98
+ export interface DisburseToNeuron {
99
+ dissolve_delay_seconds: bigint;
100
+ kyc_verified: boolean;
101
+ amount_e8s: bigint;
102
+ new_controller: [] | [Principal];
103
+ nonce: bigint;
104
+ }
105
+ export type DissolveState =
106
+ | { DissolveDelaySeconds: bigint }
107
+ | { WhenDissolvedTimestampSeconds: bigint };
108
+ export interface ExecuteNnsFunction {
109
+ nns_function: number;
110
+ payload: Array<number>;
111
+ }
112
+ export interface Follow {
113
+ topic: number;
114
+ followees: Array<NeuronId>;
115
+ }
116
+ export interface Followees {
117
+ followees: Array<NeuronId>;
118
+ }
119
+ export interface Governance {
120
+ default_followees: Array<[number, Followees]>;
121
+ wait_for_quiet_threshold_seconds: bigint;
122
+ metrics: [] | [GovernanceCachedMetrics];
123
+ node_providers: Array<NodeProvider>;
124
+ economics: [] | [NetworkEconomics];
125
+ latest_reward_event: [] | [RewardEvent];
126
+ to_claim_transfers: Array<NeuronStakeTransfer>;
127
+ short_voting_period_seconds: bigint;
128
+ proposals: Array<[bigint, ProposalData]>;
129
+ in_flight_commands: Array<[bigint, NeuronInFlightCommand]>;
130
+ neurons: Array<[bigint, Neuron]>;
131
+ genesis_timestamp_seconds: bigint;
132
+ }
133
+ export interface GovernanceCachedMetrics {
134
+ not_dissolving_neurons_e8s_buckets: Array<[bigint, number]>;
135
+ garbage_collectable_neurons_count: bigint;
136
+ neurons_with_invalid_stake_count: bigint;
137
+ not_dissolving_neurons_count_buckets: Array<[bigint, bigint]>;
138
+ total_supply_icp: bigint;
139
+ neurons_with_less_than_6_months_dissolve_delay_count: bigint;
140
+ dissolved_neurons_count: bigint;
141
+ total_staked_e8s: bigint;
142
+ not_dissolving_neurons_count: bigint;
143
+ dissolved_neurons_e8s: bigint;
144
+ neurons_with_less_than_6_months_dissolve_delay_e8s: bigint;
145
+ dissolving_neurons_count_buckets: Array<[bigint, bigint]>;
146
+ dissolving_neurons_count: bigint;
147
+ dissolving_neurons_e8s_buckets: Array<[bigint, number]>;
148
+ community_fund_total_staked_e8s: bigint;
149
+ timestamp_seconds: bigint;
150
+ }
151
+ export interface GovernanceError {
152
+ error_message: string;
153
+ error_type: number;
154
+ }
155
+ export interface IncreaseDissolveDelay {
156
+ additional_dissolve_delay_seconds: number;
157
+ }
158
+ export interface KnownNeuron {
159
+ id: [] | [NeuronId];
160
+ known_neuron_data: [] | [KnownNeuronData];
161
+ }
162
+ export interface KnownNeuronData {
163
+ name: string;
164
+ description: [] | [string];
165
+ }
166
+ export interface ListKnownNeuronsResponse {
167
+ known_neurons: Array<KnownNeuron>;
168
+ }
169
+ export interface ListNeurons {
170
+ neuron_ids: Array<bigint>;
171
+ include_neurons_readable_by_caller: boolean;
172
+ }
173
+ export interface ListNeuronsResponse {
174
+ neuron_infos: Array<[bigint, NeuronInfo]>;
175
+ full_neurons: Array<Neuron>;
176
+ }
177
+ export interface ListProposalInfo {
178
+ include_reward_status: Array<number>;
179
+ before_proposal: [] | [NeuronId];
180
+ limit: number;
181
+ exclude_topic: Array<number>;
182
+ include_status: Array<number>;
183
+ }
184
+ export interface ListProposalInfoResponse {
185
+ proposal_info: Array<ProposalInfo>;
186
+ }
187
+ export interface MakeProposalResponse {
188
+ proposal_id: [] | [NeuronId];
189
+ }
190
+ export interface ManageNeuron {
191
+ id: [] | [NeuronId];
192
+ command: [] | [Command];
193
+ neuron_id_or_subaccount: [] | [NeuronIdOrSubaccount];
194
+ }
195
+ export interface ManageNeuronResponse {
196
+ command: [] | [Command_1];
197
+ }
198
+ export interface Merge {
199
+ source_neuron_id: [] | [NeuronId];
200
+ }
201
+ export interface MergeMaturity {
202
+ percentage_to_merge: number;
203
+ }
204
+ export interface MergeMaturityResponse {
205
+ merged_maturity_e8s: bigint;
206
+ new_stake_e8s: bigint;
207
+ }
208
+ export interface Motion {
209
+ motion_text: string;
210
+ }
211
+ export interface NetworkEconomics {
212
+ neuron_minimum_stake_e8s: bigint;
213
+ max_proposals_to_keep_per_topic: number;
214
+ neuron_management_fee_per_proposal_e8s: bigint;
215
+ reject_cost_e8s: bigint;
216
+ transaction_fee_e8s: bigint;
217
+ neuron_spawn_dissolve_delay_seconds: bigint;
218
+ minimum_icp_xdr_rate: bigint;
219
+ maximum_node_provider_rewards_e8s: bigint;
220
+ }
221
+ export interface Neuron {
222
+ id: [] | [NeuronId];
223
+ controller: [] | [Principal];
224
+ recent_ballots: Array<BallotInfo>;
225
+ kyc_verified: boolean;
226
+ not_for_profit: boolean;
227
+ maturity_e8s_equivalent: bigint;
228
+ cached_neuron_stake_e8s: bigint;
229
+ created_timestamp_seconds: bigint;
230
+ aging_since_timestamp_seconds: bigint;
231
+ hot_keys: Array<Principal>;
232
+ account: Array<number>;
233
+ joined_community_fund_timestamp_seconds: [] | [bigint];
234
+ dissolve_state: [] | [DissolveState];
235
+ followees: Array<[number, Followees]>;
236
+ neuron_fees_e8s: bigint;
237
+ transfer: [] | [NeuronStakeTransfer];
238
+ known_neuron_data: [] | [KnownNeuronData];
239
+ }
240
+ export interface NeuronId {
241
+ id: bigint;
242
+ }
243
+ export type NeuronIdOrSubaccount =
244
+ | { Subaccount: Array<number> }
245
+ | { NeuronId: NeuronId };
246
+ export interface NeuronInFlightCommand {
247
+ command: [] | [Command_2];
248
+ timestamp: bigint;
249
+ }
250
+ export interface NeuronInfo {
251
+ dissolve_delay_seconds: bigint;
252
+ recent_ballots: Array<BallotInfo>;
253
+ created_timestamp_seconds: bigint;
254
+ state: number;
255
+ stake_e8s: bigint;
256
+ joined_community_fund_timestamp_seconds: [] | [bigint];
257
+ retrieved_at_timestamp_seconds: bigint;
258
+ known_neuron_data: [] | [KnownNeuronData];
259
+ voting_power: bigint;
260
+ age_seconds: bigint;
261
+ }
262
+ export interface NeuronStakeTransfer {
263
+ to_subaccount: Array<number>;
264
+ neuron_stake_e8s: bigint;
265
+ from: [] | [Principal];
266
+ memo: bigint;
267
+ from_subaccount: Array<number>;
268
+ transfer_timestamp: bigint;
269
+ block_height: bigint;
270
+ }
271
+ export interface NodeProvider {
272
+ id: [] | [Principal];
273
+ reward_account: [] | [AccountIdentifier];
274
+ }
275
+ export type Operation =
276
+ | { RemoveHotKey: RemoveHotKey }
277
+ | { AddHotKey: AddHotKey }
278
+ | { StopDissolving: {} }
279
+ | { StartDissolving: {} }
280
+ | { IncreaseDissolveDelay: IncreaseDissolveDelay }
281
+ | { JoinCommunityFund: {} }
282
+ | { SetDissolveTimestamp: SetDissolveTimestamp };
283
+ export interface Proposal {
284
+ url: string;
285
+ title: [] | [string];
286
+ action: [] | [Action];
287
+ summary: string;
288
+ }
289
+ export interface ProposalData {
290
+ id: [] | [NeuronId];
291
+ failure_reason: [] | [GovernanceError];
292
+ ballots: Array<[bigint, Ballot]>;
293
+ proposal_timestamp_seconds: bigint;
294
+ reward_event_round: bigint;
295
+ failed_timestamp_seconds: bigint;
296
+ reject_cost_e8s: bigint;
297
+ latest_tally: [] | [Tally];
298
+ decided_timestamp_seconds: bigint;
299
+ proposal: [] | [Proposal];
300
+ proposer: [] | [NeuronId];
301
+ wait_for_quiet_state: [] | [WaitForQuietState];
302
+ executed_timestamp_seconds: bigint;
303
+ }
304
+ export interface ProposalInfo {
305
+ id: [] | [NeuronId];
306
+ status: number;
307
+ topic: number;
308
+ failure_reason: [] | [GovernanceError];
309
+ ballots: Array<[bigint, Ballot]>;
310
+ proposal_timestamp_seconds: bigint;
311
+ reward_event_round: bigint;
312
+ deadline_timestamp_seconds: [] | [bigint];
313
+ failed_timestamp_seconds: bigint;
314
+ reject_cost_e8s: bigint;
315
+ latest_tally: [] | [Tally];
316
+ reward_status: number;
317
+ decided_timestamp_seconds: bigint;
318
+ proposal: [] | [Proposal];
319
+ proposer: [] | [NeuronId];
320
+ executed_timestamp_seconds: bigint;
321
+ }
322
+ export interface RegisterVote {
323
+ vote: number;
324
+ proposal: [] | [NeuronId];
325
+ }
326
+ export interface RemoveHotKey {
327
+ hot_key_to_remove: [] | [Principal];
328
+ }
329
+ export type Result = { Ok: null } | { Err: GovernanceError };
330
+ export type Result_1 = { Error: GovernanceError } | { NeuronId: NeuronId };
331
+ export type Result_2 = { Ok: Neuron } | { Err: GovernanceError };
332
+ export type Result_3 = { Ok: RewardNodeProviders } | { Err: GovernanceError };
333
+ export type Result_4 = { Ok: NeuronInfo } | { Err: GovernanceError };
334
+ export interface RewardEvent {
335
+ day_after_genesis: bigint;
336
+ actual_timestamp_seconds: bigint;
337
+ distributed_e8s_equivalent: bigint;
338
+ settled_proposals: Array<NeuronId>;
339
+ }
340
+ export type RewardMode =
341
+ | { RewardToNeuron: RewardToNeuron }
342
+ | { RewardToAccount: RewardToAccount };
343
+ export interface RewardNodeProvider {
344
+ node_provider: [] | [NodeProvider];
345
+ reward_mode: [] | [RewardMode];
346
+ amount_e8s: bigint;
347
+ }
348
+ export interface RewardNodeProviders {
349
+ rewards: Array<RewardNodeProvider>;
350
+ }
351
+ export interface RewardToAccount {
352
+ to_account: [] | [AccountIdentifier];
353
+ }
354
+ export interface RewardToNeuron {
355
+ dissolve_delay_seconds: bigint;
356
+ }
357
+ export interface SetDefaultFollowees {
358
+ default_followees: Array<[number, Followees]>;
359
+ }
360
+ export interface SetDissolveTimestamp {
361
+ dissolve_timestamp_seconds: bigint;
362
+ }
363
+ export interface Spawn {
364
+ new_controller: [] | [Principal];
365
+ nonce: [] | [bigint];
366
+ }
367
+ export interface SpawnResponse {
368
+ created_neuron_id: [] | [NeuronId];
369
+ }
370
+ export interface Split {
371
+ amount_e8s: bigint;
372
+ }
373
+ export interface Tally {
374
+ no: bigint;
375
+ yes: bigint;
376
+ total: bigint;
377
+ timestamp_seconds: bigint;
378
+ }
379
+ export interface UpdateNodeProvider {
380
+ reward_account: [] | [AccountIdentifier];
381
+ }
382
+ export interface WaitForQuietState {
383
+ current_deadline_timestamp_seconds: bigint;
384
+ }
385
+ export interface _SERVICE {
386
+ claim_gtc_neurons: (
387
+ arg_0: Principal,
388
+ arg_1: Array<NeuronId>
389
+ ) => Promise<Result>;
390
+ claim_or_refresh_neuron_from_account: (
391
+ arg_0: ClaimOrRefreshNeuronFromAccount
392
+ ) => Promise<ClaimOrRefreshNeuronFromAccountResponse>;
393
+ get_full_neuron: (arg_0: bigint) => Promise<Result_2>;
394
+ get_full_neuron_by_id_or_subaccount: (
395
+ arg_0: NeuronIdOrSubaccount
396
+ ) => Promise<Result_2>;
397
+ get_monthly_node_provider_rewards: () => Promise<Result_3>;
398
+ get_neuron_ids: () => Promise<Array<bigint>>;
399
+ get_neuron_info: (arg_0: bigint) => Promise<Result_4>;
400
+ get_neuron_info_by_id_or_subaccount: (
401
+ arg_0: NeuronIdOrSubaccount
402
+ ) => Promise<Result_4>;
403
+ get_pending_proposals: () => Promise<Array<ProposalInfo>>;
404
+ get_proposal_info: (arg_0: bigint) => Promise<[] | [ProposalInfo]>;
405
+ list_known_neurons: () => Promise<ListKnownNeuronsResponse>;
406
+ list_neurons: (arg_0: ListNeurons) => Promise<ListNeuronsResponse>;
407
+ list_proposals: (
408
+ arg_0: ListProposalInfo
409
+ ) => Promise<ListProposalInfoResponse>;
410
+ manage_neuron: (arg_0: ManageNeuron) => Promise<ManageNeuronResponse>;
411
+ transfer_gtc_neuron: (arg_0: NeuronId, arg_1: NeuronId) => Promise<Result>;
412
+ update_node_provider: (arg_0: UpdateNodeProvider) => Promise<Result>;
413
+ }
@@ -0,0 +1,206 @@
1
+ /* Do not edit. Compiled with ./scripts/compile-idl-js from candid/nns_dapp.did */
2
+ export const idlFactory = ({ IDL }) => {
3
+ const AccountIdentifier = IDL.Text;
4
+ const AttachCanisterRequest = IDL.Record({
5
+ 'name' : IDL.Text,
6
+ 'canister_id' : IDL.Principal,
7
+ });
8
+ const AttachCanisterResponse = IDL.Variant({
9
+ 'Ok' : IDL.Null,
10
+ 'CanisterAlreadyAttached' : IDL.Null,
11
+ 'NameAlreadyTaken' : IDL.Null,
12
+ 'NameTooLong' : IDL.Null,
13
+ 'CanisterLimitExceeded' : IDL.Null,
14
+ });
15
+ const SubAccount = IDL.Vec(IDL.Nat8);
16
+ const SubAccountDetails = IDL.Record({
17
+ 'name' : IDL.Text,
18
+ 'sub_account' : SubAccount,
19
+ 'account_identifier' : AccountIdentifier,
20
+ });
21
+ const CreateSubAccountResponse = IDL.Variant({
22
+ 'Ok' : SubAccountDetails,
23
+ 'AccountNotFound' : IDL.Null,
24
+ 'NameTooLong' : IDL.Null,
25
+ 'SubAccountLimitExceeded' : IDL.Null,
26
+ });
27
+ const DetachCanisterRequest = IDL.Record({ 'canister_id' : IDL.Principal });
28
+ const DetachCanisterResponse = IDL.Variant({
29
+ 'Ok' : IDL.Null,
30
+ 'CanisterNotFound' : IDL.Null,
31
+ });
32
+ const HardwareWalletAccountDetails = IDL.Record({
33
+ 'principal' : IDL.Principal,
34
+ 'name' : IDL.Text,
35
+ 'account_identifier' : AccountIdentifier,
36
+ });
37
+ const AccountDetails = IDL.Record({
38
+ 'principal' : IDL.Principal,
39
+ 'account_identifier' : AccountIdentifier,
40
+ 'hardware_wallet_accounts' : IDL.Vec(HardwareWalletAccountDetails),
41
+ 'sub_accounts' : IDL.Vec(SubAccountDetails),
42
+ });
43
+ const GetAccountResponse = IDL.Variant({
44
+ 'Ok' : AccountDetails,
45
+ 'AccountNotFound' : IDL.Null,
46
+ });
47
+ const CanisterDetails = IDL.Record({
48
+ 'name' : IDL.Text,
49
+ 'canister_id' : IDL.Principal,
50
+ });
51
+ const BlockHeight = IDL.Nat64;
52
+ const MultiPartTransactionError = IDL.Record({
53
+ 'error_message' : IDL.Text,
54
+ 'block_height' : BlockHeight,
55
+ });
56
+ const CanisterId = IDL.Principal;
57
+ const NeuronId = IDL.Nat64;
58
+ const MultiPartTransactionStatus = IDL.Variant({
59
+ 'Queued' : IDL.Null,
60
+ 'Error' : IDL.Text,
61
+ 'Refunded' : IDL.Tuple(BlockHeight, IDL.Text),
62
+ 'CanisterCreated' : CanisterId,
63
+ 'Complete' : IDL.Null,
64
+ 'NotFound' : IDL.Null,
65
+ 'NeuronCreated' : NeuronId,
66
+ 'PendingSync' : IDL.Null,
67
+ 'ErrorWithRefundPending' : IDL.Text,
68
+ });
69
+ const Stats = IDL.Record({
70
+ 'latest_transaction_block_height' : BlockHeight,
71
+ 'seconds_since_last_ledger_sync' : IDL.Nat64,
72
+ 'sub_accounts_count' : IDL.Nat64,
73
+ 'neurons_topped_up_count' : IDL.Nat64,
74
+ 'transactions_to_process_queue_length' : IDL.Nat32,
75
+ 'neurons_created_count' : IDL.Nat64,
76
+ 'hardware_wallet_accounts_count' : IDL.Nat64,
77
+ 'accounts_count' : IDL.Nat64,
78
+ 'earliest_transaction_block_height' : BlockHeight,
79
+ 'transactions_count' : IDL.Nat64,
80
+ 'block_height_synced_up_to' : IDL.Opt(IDL.Nat64),
81
+ 'latest_transaction_timestamp_nanos' : IDL.Nat64,
82
+ 'earliest_transaction_timestamp_nanos' : IDL.Nat64,
83
+ });
84
+ const GetTransactionsRequest = IDL.Record({
85
+ 'page_size' : IDL.Nat8,
86
+ 'offset' : IDL.Nat32,
87
+ 'account_identifier' : AccountIdentifier,
88
+ });
89
+ const TransactionType = IDL.Variant({
90
+ 'Burn' : IDL.Null,
91
+ 'Mint' : IDL.Null,
92
+ 'Send' : IDL.Null,
93
+ 'StakeNeuronNotification' : IDL.Null,
94
+ 'TopUpCanister' : CanisterId,
95
+ 'CreateCanister' : IDL.Null,
96
+ 'TopUpNeuron' : IDL.Null,
97
+ 'StakeNeuron' : IDL.Null,
98
+ });
99
+ const Timestamp = IDL.Record({ 'timestamp_nanos' : IDL.Nat64 });
100
+ const ICPTs = IDL.Record({ 'e8s' : IDL.Nat64 });
101
+ const Send = IDL.Record({
102
+ 'to' : AccountIdentifier,
103
+ 'fee' : ICPTs,
104
+ 'amount' : ICPTs,
105
+ });
106
+ const Receive = IDL.Record({
107
+ 'fee' : ICPTs,
108
+ 'from' : AccountIdentifier,
109
+ 'amount' : ICPTs,
110
+ });
111
+ const Transfer = IDL.Variant({
112
+ 'Burn' : IDL.Record({ 'amount' : ICPTs }),
113
+ 'Mint' : IDL.Record({ 'amount' : ICPTs }),
114
+ 'Send' : Send,
115
+ 'Receive' : Receive,
116
+ });
117
+ const Transaction = IDL.Record({
118
+ 'transaction_type' : IDL.Opt(TransactionType),
119
+ 'memo' : IDL.Nat64,
120
+ 'timestamp' : Timestamp,
121
+ 'block_height' : BlockHeight,
122
+ 'transfer' : Transfer,
123
+ });
124
+ const GetTransactionsResponse = IDL.Record({
125
+ 'total' : IDL.Nat32,
126
+ 'transactions' : IDL.Vec(Transaction),
127
+ });
128
+ const HeaderField = IDL.Tuple(IDL.Text, IDL.Text);
129
+ const HttpRequest = IDL.Record({
130
+ 'url' : IDL.Text,
131
+ 'method' : IDL.Text,
132
+ 'body' : IDL.Vec(IDL.Nat8),
133
+ 'headers' : IDL.Vec(HeaderField),
134
+ });
135
+ const HttpResponse = IDL.Record({
136
+ 'body' : IDL.Vec(IDL.Nat8),
137
+ 'headers' : IDL.Vec(HeaderField),
138
+ 'status_code' : IDL.Nat16,
139
+ });
140
+ const RegisterHardwareWalletRequest = IDL.Record({
141
+ 'principal' : IDL.Principal,
142
+ 'name' : IDL.Text,
143
+ });
144
+ const RegisterHardwareWalletResponse = IDL.Variant({
145
+ 'Ok' : IDL.Null,
146
+ 'AccountNotFound' : IDL.Null,
147
+ 'HardwareWalletAlreadyRegistered' : IDL.Null,
148
+ 'HardwareWalletLimitExceeded' : IDL.Null,
149
+ 'NameTooLong' : IDL.Null,
150
+ });
151
+ const RenameSubAccountRequest = IDL.Record({
152
+ 'new_name' : IDL.Text,
153
+ 'account_identifier' : AccountIdentifier,
154
+ });
155
+ const RenameSubAccountResponse = IDL.Variant({
156
+ 'Ok' : IDL.Null,
157
+ 'AccountNotFound' : IDL.Null,
158
+ 'SubAccountNotFound' : IDL.Null,
159
+ 'NameTooLong' : IDL.Null,
160
+ });
161
+ return IDL.Service({
162
+ 'add_account' : IDL.Func([], [AccountIdentifier], []),
163
+ 'add_stable_asset' : IDL.Func([IDL.Vec(IDL.Nat8)], [], []),
164
+ 'attach_canister' : IDL.Func(
165
+ [AttachCanisterRequest],
166
+ [AttachCanisterResponse],
167
+ [],
168
+ ),
169
+ 'create_sub_account' : IDL.Func([IDL.Text], [CreateSubAccountResponse], []),
170
+ 'detach_canister' : IDL.Func(
171
+ [DetachCanisterRequest],
172
+ [DetachCanisterResponse],
173
+ [],
174
+ ),
175
+ 'get_account' : IDL.Func([], [GetAccountResponse], []),
176
+ 'get_canisters' : IDL.Func([], [IDL.Vec(CanisterDetails)], []),
177
+ 'get_multi_part_transaction_errors' : IDL.Func(
178
+ [],
179
+ [IDL.Vec(MultiPartTransactionError)],
180
+ [],
181
+ ),
182
+ 'get_multi_part_transaction_status' : IDL.Func(
183
+ [IDL.Principal, BlockHeight],
184
+ [MultiPartTransactionStatus],
185
+ [],
186
+ ),
187
+ 'get_stats' : IDL.Func([], [Stats], []),
188
+ 'get_transactions' : IDL.Func(
189
+ [GetTransactionsRequest],
190
+ [GetTransactionsResponse],
191
+ [],
192
+ ),
193
+ 'http_request' : IDL.Func([HttpRequest], [HttpResponse], []),
194
+ 'register_hardware_wallet' : IDL.Func(
195
+ [RegisterHardwareWalletRequest],
196
+ [RegisterHardwareWalletResponse],
197
+ [],
198
+ ),
199
+ 'rename_sub_account' : IDL.Func(
200
+ [RenameSubAccountRequest],
201
+ [RenameSubAccountResponse],
202
+ [],
203
+ ),
204
+ });
205
+ };
206
+ export const init = ({ IDL }) => { return []; };