@junobuild/functions 0.4.1 → 0.5.1-next-2025-11-29

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 (137) hide show
  1. package/canisters/_canister.d.ts +17 -0
  2. package/canisters/_constants.d.ts +3 -0
  3. package/canisters/ckbtc/index.d.ts +1 -0
  4. package/canisters/ckbtc/index.js +2 -0
  5. package/canisters/cketh/index.d.ts +1 -0
  6. package/canisters/cketh/index.js +2 -0
  7. package/canisters/cketh/index.js.map +7 -0
  8. package/canisters/cmc/cmc.canister.d.ts +28 -0
  9. package/canisters/cmc/index.d.ts +2 -0
  10. package/canisters/cmc/index.js +2 -0
  11. package/canisters/cmc/index.js.map +7 -0
  12. package/canisters/declarations/_idl.d.ts +16 -0
  13. package/canisters/declarations/_types.d.ts +16 -0
  14. package/canisters/declarations/ckbtc/bitcoin.did.d.ts +134 -0
  15. package/canisters/declarations/ckbtc/bitcoin.did.idl.d.ts +40 -0
  16. package/canisters/declarations/ckbtc/minter.did.d.ts +831 -0
  17. package/canisters/declarations/ckbtc/minter.did.idl.d.ts +61 -0
  18. package/canisters/declarations/cketh/minter.did.d.ts +893 -0
  19. package/canisters/declarations/cketh/minter.did.idl.d.ts +58 -0
  20. package/canisters/declarations/cketh/orchestrator.did.d.ts +302 -0
  21. package/canisters/declarations/cketh/orchestrator.did.idl.d.ts +34 -0
  22. package/canisters/declarations/cmc/cmc.did.d.ts +344 -0
  23. package/canisters/declarations/cmc/cmc.did.idl.d.ts +53 -0
  24. package/canisters/declarations/ic-management/ic-management.did.d.ts +583 -0
  25. package/canisters/declarations/ic-management/ic-management.did.idl.d.ts +147 -0
  26. package/canisters/declarations/index.d.ts +2 -0
  27. package/canisters/declarations/ledger-icp/index.did.d.ts +119 -0
  28. package/canisters/declarations/ledger-icp/index.did.idl.d.ts +35 -0
  29. package/canisters/declarations/ledger-icp/ledger.did.d.ts +606 -0
  30. package/canisters/declarations/ledger-icp/ledger.did.idl.d.ts +106 -0
  31. package/canisters/declarations/ledger-icrc/icrc_index-ng.did.d.ts +148 -0
  32. package/canisters/declarations/ledger-icrc/icrc_index-ng.did.idl.d.ts +44 -0
  33. package/canisters/declarations/ledger-icrc/icrc_index.did.d.ts +102 -0
  34. package/canisters/declarations/ledger-icrc/icrc_index.did.idl.d.ts +28 -0
  35. package/canisters/declarations/ledger-icrc/icrc_ledger.did.d.ts +579 -0
  36. package/canisters/declarations/ledger-icrc/icrc_ledger.did.idl.d.ts +100 -0
  37. package/canisters/declarations/ledger-icrc/icrc_nft-ledger.did.d.ts +81 -0
  38. package/canisters/declarations/ledger-icrc/icrc_nft-ledger.did.idl.d.ts +39 -0
  39. package/canisters/declarations/nns/genesis_token.did.d.ts +49 -0
  40. package/canisters/declarations/nns/genesis_token.did.idl.d.ts +24 -0
  41. package/canisters/declarations/nns/governance.did.d.ts +1254 -0
  42. package/canisters/declarations/nns/governance.did.idl.d.ts +217 -0
  43. package/canisters/declarations/nns/governance_test.did.d.ts +1258 -0
  44. package/canisters/declarations/nns/governance_test.did.idl.d.ts +218 -0
  45. package/canisters/declarations/nns/sns_wasm.did.d.ts +286 -0
  46. package/canisters/declarations/nns/sns_wasm.did.idl.d.ts +80 -0
  47. package/canisters/declarations/sns/sns_governance.did.d.ts +834 -0
  48. package/canisters/declarations/sns/sns_governance.did.idl.d.ts +189 -0
  49. package/canisters/declarations/sns/sns_governance_test.did.d.ts +861 -0
  50. package/canisters/declarations/sns/sns_governance_test.did.idl.d.ts +199 -0
  51. package/canisters/declarations/sns/sns_root.did.d.ts +204 -0
  52. package/canisters/declarations/sns/sns_root.did.idl.d.ts +53 -0
  53. package/canisters/declarations/sns/sns_swap.did.d.ts +411 -0
  54. package/canisters/declarations/sns/sns_swap.did.idl.d.ts +108 -0
  55. package/canisters/ic-management/index.d.ts +1 -0
  56. package/canisters/ic-management/index.js +2 -0
  57. package/canisters/ic-management/index.js.map +7 -0
  58. package/canisters/index.d.ts +1 -0
  59. package/canisters/index.js +2 -0
  60. package/canisters/index.js.map +7 -0
  61. package/canisters/ledger/icp/index.d.ts +2 -0
  62. package/canisters/ledger/icp/index.js +2 -0
  63. package/canisters/ledger/icp/index.js.map +7 -0
  64. package/canisters/ledger/icp/ledger.canister.d.ts +24 -0
  65. package/canisters/ledger/icrc/index.d.ts +3 -0
  66. package/canisters/ledger/icrc/index.js +2 -0
  67. package/canisters/ledger/icrc/index.js.map +7 -0
  68. package/canisters/ledger/icrc/ledger.canister.d.ts +45 -0
  69. package/canisters/ledger/icrc/schemas.d.ts +11 -0
  70. package/canisters/nns/index.d.ts +1 -0
  71. package/canisters/nns/index.js +2 -0
  72. package/canisters/nns/index.js.map +7 -0
  73. package/canisters/schemas.d.ts +11 -0
  74. package/canisters/sns/index.d.ts +1 -0
  75. package/canisters/sns/index.js +2 -0
  76. package/canisters/sns/index.js.map +7 -0
  77. package/chunk-4C666HHU.js +2 -0
  78. package/chunk-4C666HHU.js.map +7 -0
  79. package/chunk-5NZMOUKF.js +2 -0
  80. package/chunk-5NZMOUKF.js.map +7 -0
  81. package/chunk-BXZ5PSUW.js +2 -0
  82. package/chunk-BXZ5PSUW.js.map +7 -0
  83. package/chunk-EMQQE34V.js +2 -0
  84. package/chunk-EMQQE34V.js.map +7 -0
  85. package/chunk-HANEPD6T.js +2 -0
  86. package/chunk-HANEPD6T.js.map +7 -0
  87. package/chunk-TZVF5LQY.js +2 -0
  88. package/chunk-TZVF5LQY.js.map +7 -0
  89. package/ic-cdk.js +1 -1
  90. package/ic-cdk.js.map +4 -4
  91. package/index.js +1 -1
  92. package/index.js.map +1 -1
  93. package/package.json +43 -6
  94. package/sdk.js +1 -1
  95. package/sdk.js.map +1 -1
  96. package/src/canisters/declarations/ckbtc/bitcoin.did.d.ts +134 -0
  97. package/src/canisters/declarations/ckbtc/bitcoin.did.idl.js +302 -0
  98. package/src/canisters/declarations/ckbtc/minter.did.d.ts +831 -0
  99. package/src/canisters/declarations/ckbtc/minter.did.idl.js +893 -0
  100. package/src/canisters/declarations/cketh/minter.did.d.ts +893 -0
  101. package/src/canisters/declarations/cketh/minter.did.idl.js +878 -0
  102. package/src/canisters/declarations/cketh/orchestrator.did.d.ts +302 -0
  103. package/src/canisters/declarations/cketh/orchestrator.did.idl.js +343 -0
  104. package/src/canisters/declarations/cmc/cmc.did.d.ts +344 -0
  105. package/src/canisters/declarations/cmc/cmc.did.idl.js +338 -0
  106. package/src/canisters/declarations/ic-management/ic-management.did.d.ts +583 -0
  107. package/src/canisters/declarations/ic-management/ic-management.did.idl.js +1150 -0
  108. package/src/canisters/declarations/ledger-icp/index.did.d.ts +119 -0
  109. package/src/canisters/declarations/ledger-icp/index.did.idl.js +225 -0
  110. package/src/canisters/declarations/ledger-icp/ledger.did.d.ts +606 -0
  111. package/src/canisters/declarations/ledger-icp/ledger.did.idl.js +813 -0
  112. package/src/canisters/declarations/ledger-icrc/icrc_index-ng.did.d.ts +148 -0
  113. package/src/canisters/declarations/ledger-icrc/icrc_index-ng.did.idl.js +274 -0
  114. package/src/canisters/declarations/ledger-icrc/icrc_index.did.d.ts +102 -0
  115. package/src/canisters/declarations/ledger-icrc/icrc_index.did.idl.js +171 -0
  116. package/src/canisters/declarations/ledger-icrc/icrc_ledger.did.d.ts +579 -0
  117. package/src/canisters/declarations/ledger-icrc/icrc_ledger.did.idl.js +923 -0
  118. package/src/canisters/declarations/ledger-icrc/icrc_nft-ledger.did.d.ts +81 -0
  119. package/src/canisters/declarations/ledger-icrc/icrc_nft-ledger.did.idl.js +163 -0
  120. package/src/canisters/declarations/nns/genesis_token.did.d.ts +49 -0
  121. package/src/canisters/declarations/nns/genesis_token.did.idl.js +84 -0
  122. package/src/canisters/declarations/nns/governance.did.d.ts +1254 -0
  123. package/src/canisters/declarations/nns/governance.did.idl.js +2756 -0
  124. package/src/canisters/declarations/nns/governance_test.did.d.ts +1258 -0
  125. package/src/canisters/declarations/nns/governance_test.did.idl.js +2758 -0
  126. package/src/canisters/declarations/nns/sns_wasm.did.d.ts +286 -0
  127. package/src/canisters/declarations/nns/sns_wasm.did.idl.js +589 -0
  128. package/src/canisters/declarations/sns/sns_governance.did.d.ts +834 -0
  129. package/src/canisters/declarations/sns/sns_governance.did.idl.js +2235 -0
  130. package/src/canisters/declarations/sns/sns_governance_test.did.d.ts +861 -0
  131. package/src/canisters/declarations/sns/sns_governance_test.did.idl.js +2283 -0
  132. package/src/canisters/declarations/sns/sns_root.did.d.ts +204 -0
  133. package/src/canisters/declarations/sns/sns_root.did.idl.js +433 -0
  134. package/src/canisters/declarations/sns/sns_swap.did.d.ts +411 -0
  135. package/src/canisters/declarations/sns/sns_swap.did.idl.js +858 -0
  136. package/global.d.js +0 -1
  137. /package/{global.d.js.map → canisters/ckbtc/index.js.map} +0 -0
@@ -0,0 +1,344 @@
1
+ /* eslint-disable */
2
+
3
+ // @ts-nocheck
4
+
5
+ // This file was automatically generated by @icp-sdk/bindgen@0.2.0.
6
+ // You should NOT make any changes in this file as it will be overwritten.
7
+ // Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
8
+
9
+ import type { ActorMethod } from '@icp-sdk/core/agent';
10
+ import type { IDL } from '@icp-sdk/core/candid';
11
+ import type { Principal } from '@icp-sdk/core/principal';
12
+
13
+ export type AccountIdentifier = string;
14
+ export type BlockIndex = bigint;
15
+ export interface CanisterSettings {
16
+ 'freezing_threshold' : [] | [bigint],
17
+ 'wasm_memory_threshold' : [] | [bigint],
18
+ 'environment_variables' : [] | [Array<environment_variable>],
19
+ 'controllers' : [] | [Array<Principal>],
20
+ 'reserved_cycles_limit' : [] | [bigint],
21
+ 'log_visibility' : [] | [log_visibility],
22
+ 'log_memory_limit' : [] | [bigint],
23
+ 'wasm_memory_limit' : [] | [bigint],
24
+ 'memory_allocation' : [] | [bigint],
25
+ 'compute_allocation' : [] | [bigint],
26
+ }
27
+ export type ChangeSubnetTypeAssignmentArgs = { 'Add' : SubnetListWithType } |
28
+ { 'Remove' : SubnetListWithType };
29
+ /**
30
+ * The argument of the [create_canister] method.
31
+ */
32
+ export interface CreateCanisterArg {
33
+ /**
34
+ * Optional instructions to select on which subnet the new canister will be created on.
35
+ */
36
+ 'subnet_selection' : [] | [SubnetSelection],
37
+ /**
38
+ * Optional canister settings that, if set, are applied to the newly created canister.
39
+ * If not specified, the caller is the controller of the canister and the other settings are set to default values.
40
+ */
41
+ 'settings' : [] | [CanisterSettings],
42
+ /**
43
+ * An optional subnet type that, if set, determines what type of subnet
44
+ * the new canister will be created on.
45
+ * Deprecated. Use subnet_selection instead.
46
+ */
47
+ 'subnet_type' : [] | [string],
48
+ }
49
+ /**
50
+ * Canister creation failed and the cycles attached to the call were returned to the calling canister.
51
+ * A small fee may be charged.
52
+ */
53
+ export type CreateCanisterError = {
54
+ 'Refunded' : {
55
+ /**
56
+ * The reason why creating a canister failed.
57
+ */
58
+ 'create_error' : string,
59
+ /**
60
+ * The amount of cycles returned to the calling canister
61
+ */
62
+ 'refund_amount' : bigint,
63
+ }
64
+ };
65
+ export type CreateCanisterResult = {
66
+ /**
67
+ * The principal of the newly created canister.
68
+ */
69
+ 'Ok' : Principal
70
+ } |
71
+ { 'Err' : CreateCanisterError };
72
+ export type Cycles = bigint;
73
+ export interface CyclesCanisterInitPayload {
74
+ 'exchange_rate_canister' : [] | [ExchangeRateCanister],
75
+ 'cycles_ledger_canister_id' : [] | [Principal],
76
+ 'last_purged_notification' : [] | [bigint],
77
+ 'governance_canister_id' : [] | [Principal],
78
+ 'minting_account_id' : [] | [AccountIdentifier],
79
+ 'ledger_canister_id' : [] | [Principal],
80
+ }
81
+ export type ExchangeRateCanister = {
82
+ /**
83
+ * / Enables the exchange rate canister with the given canister ID.
84
+ */
85
+ 'Set' : Principal
86
+ } |
87
+ {
88
+ /**
89
+ * / Disable the exchange rate canister.
90
+ */
91
+ 'Unset' : null
92
+ };
93
+ export interface IcpXdrConversionRate {
94
+ /**
95
+ * The number of 10,000ths of IMF SDR (currency code XDR) that corresponds
96
+ * to 1 ICP. This value reflects the current market price of one ICP token.
97
+ */
98
+ 'xdr_permyriad_per_icp' : bigint,
99
+ /**
100
+ * The time for which the market data was queried, expressed in UNIX epoch
101
+ * time in seconds.
102
+ */
103
+ 'timestamp_seconds' : bigint,
104
+ }
105
+ export interface IcpXdrConversionRateResponse {
106
+ /**
107
+ * System certificate as specified in
108
+ * https://internetcomputer.org/docs/interface-spec/index.html#certification-encoding
109
+ */
110
+ 'certificate' : Uint8Array,
111
+ /**
112
+ * The latest ICP/XDR conversion rate.
113
+ */
114
+ 'data' : IcpXdrConversionRate,
115
+ /**
116
+ * CBOR-serialized hash tree as specified in
117
+ * https://internetcomputer.org/docs/interface-spec/index.html#certification-encoding
118
+ * The hash tree is used for certification and hash the following structure:
119
+ * ```
120
+ * *
121
+ * |
122
+ * +-- ICP_XDR_CONVERSION_RATE -- [ Candid encoded IcpXdrConversionRate ]
123
+ * |
124
+ * `-- AVERAGE_ICP_XDR_CONVERSION_RATE -- [ Candid encoded IcpXdrConversionRate ]
125
+ * ```
126
+ */
127
+ 'hash_tree' : Uint8Array,
128
+ }
129
+ export type Memo = [] | [Uint8Array];
130
+ /**
131
+ * The argument of the [notify_create_canister] method.
132
+ */
133
+ export interface NotifyCreateCanisterArg {
134
+ /**
135
+ * The controller of canister to create.
136
+ */
137
+ 'controller' : Principal,
138
+ /**
139
+ * Index of the block on the ICP ledger that contains the payment.
140
+ */
141
+ 'block_index' : BlockIndex,
142
+ /**
143
+ * Optional instructions to select on which subnet the new canister will be created on.
144
+ * vec may contain no more than one element.
145
+ */
146
+ 'subnet_selection' : [] | [SubnetSelection],
147
+ /**
148
+ * Optional canister settings that, if set, are applied to the newly created canister.
149
+ * If not specified, the caller is the controller of the canister and the other settings are set to default values.
150
+ */
151
+ 'settings' : [] | [CanisterSettings],
152
+ /**
153
+ * An optional subnet type that, if set, determines what type of subnet
154
+ * the new canister will be created on.
155
+ * Deprecated. Use subnet_selection instead.
156
+ */
157
+ 'subnet_type' : [] | [string],
158
+ }
159
+ export type NotifyCreateCanisterResult = {
160
+ /**
161
+ * The principal of the newly created canister.
162
+ */
163
+ 'Ok' : Principal
164
+ } |
165
+ { 'Err' : NotifyError };
166
+ export type NotifyError = {
167
+ /**
168
+ * The payment processing failed and the payment was returned the caller.
169
+ * This is a non-retriable error.
170
+ */
171
+ 'Refunded' : {
172
+ /**
173
+ * The index of the block containing the refund.
174
+ */
175
+ 'block_index' : [] | [BlockIndex],
176
+ /**
177
+ * The reason for the refund.
178
+ */
179
+ 'reason' : string,
180
+ }
181
+ } |
182
+ {
183
+ /**
184
+ * The transaction does not satisfy the cycle minting canister payment protocol.
185
+ * The text contains the description of the problem.
186
+ * This is a non-retriable error.
187
+ */
188
+ 'InvalidTransaction' : string
189
+ } |
190
+ {
191
+ /**
192
+ * Other error.
193
+ */
194
+ 'Other' : { 'error_message' : string, 'error_code' : bigint }
195
+ } |
196
+ {
197
+ /**
198
+ * The same payment is already being processed by a concurrent request.
199
+ * This is a retriable error.
200
+ */
201
+ 'Processing' : null
202
+ } |
203
+ {
204
+ /**
205
+ * The payment was too old to be processed.
206
+ * The value of the variant is the oldest block index that can still be processed.
207
+ * This a non-retriable error.
208
+ */
209
+ 'TransactionTooOld' : BlockIndex
210
+ };
211
+ export interface NotifyMintCyclesArg {
212
+ 'block_index' : BlockIndex,
213
+ 'deposit_memo' : Memo,
214
+ 'to_subaccount' : Subaccount,
215
+ }
216
+ export type NotifyMintCyclesResult = { 'Ok' : NotifyMintCyclesSuccess } |
217
+ { 'Err' : NotifyError };
218
+ export interface NotifyMintCyclesSuccess {
219
+ /**
220
+ * New balance of the cycles ledger account
221
+ */
222
+ 'balance' : bigint,
223
+ /**
224
+ * Cycles ledger block index of deposit
225
+ */
226
+ 'block_index' : bigint,
227
+ /**
228
+ * Amount of cycles that were minted and deposited to the cycles ledger
229
+ */
230
+ 'minted' : bigint,
231
+ }
232
+ /**
233
+ * The argument of the [notify_top_up] method.
234
+ */
235
+ export interface NotifyTopUpArg {
236
+ /**
237
+ * Index of the block on the ICP ledger that contains the payment.
238
+ */
239
+ 'block_index' : BlockIndex,
240
+ /**
241
+ * The canister to top up.
242
+ */
243
+ 'canister_id' : Principal,
244
+ }
245
+ export type NotifyTopUpResult = {
246
+ /**
247
+ * The amount of cycles sent to the specified canister.
248
+ */
249
+ 'Ok' : Cycles
250
+ } |
251
+ { 'Err' : NotifyError };
252
+ export interface PrincipalsAuthorizedToCreateCanistersToSubnetsResponse {
253
+ 'data' : Array<[Principal, Array<Principal>]>,
254
+ }
255
+ export interface SetAuthorizedSubnetworkListArgs {
256
+ 'who' : [] | [Principal],
257
+ 'subnets' : Array<Principal>,
258
+ }
259
+ export type Subaccount = [] | [Uint8Array];
260
+ export interface SubnetFilter { 'subnet_type' : [] | [string] }
261
+ export interface SubnetListWithType {
262
+ 'subnets' : Array<Principal>,
263
+ 'subnet_type' : string,
264
+ }
265
+ export type SubnetSelection = {
266
+ /**
267
+ * / Choose a random subnet that fulfills the specified properties
268
+ */
269
+ 'Filter' : SubnetFilter
270
+ } |
271
+ {
272
+ /**
273
+ * / Choose a specific subnet
274
+ */
275
+ 'Subnet' : { 'subnet' : Principal }
276
+ };
277
+ export interface SubnetTypesToSubnetsResponse {
278
+ 'data' : Array<[string, Array<Principal>]>,
279
+ }
280
+ export type UpdateSubnetTypeArgs = { 'Add' : string } |
281
+ { 'Remove' : string };
282
+ export interface environment_variable { 'value' : string, 'name' : string }
283
+ export type log_visibility = { 'controllers' : null } |
284
+ { 'public' : null } |
285
+ { 'allowed_viewers' : Array<Principal> };
286
+ export interface _SERVICE {
287
+ 'change_subnet_type_assignment' : ActorMethod<
288
+ [ChangeSubnetTypeAssignmentArgs],
289
+ undefined
290
+ >,
291
+ /**
292
+ * Creates a canister using the cycles attached to the function call.
293
+ */
294
+ 'create_canister' : ActorMethod<[CreateCanisterArg], CreateCanisterResult>,
295
+ 'get_build_metadata' : ActorMethod<[], string>,
296
+ 'get_default_subnets' : ActorMethod<[], Array<Principal>>,
297
+ /**
298
+ * Returns the ICP/XDR conversion rate.
299
+ */
300
+ 'get_icp_xdr_conversion_rate' : ActorMethod<[], IcpXdrConversionRateResponse>,
301
+ /**
302
+ * Returns the mapping from principals to subnets in which they are authorized
303
+ * to create canisters.
304
+ */
305
+ 'get_principals_authorized_to_create_canisters_to_subnets' : ActorMethod<
306
+ [],
307
+ PrincipalsAuthorizedToCreateCanistersToSubnetsResponse
308
+ >,
309
+ /**
310
+ * Returns the current mapping of subnet types to subnets.
311
+ */
312
+ 'get_subnet_types_to_subnets' : ActorMethod<[], SubnetTypesToSubnetsResponse>,
313
+ /**
314
+ * Prompts the cycles minting canister to process a payment for canister creation.
315
+ */
316
+ 'notify_create_canister' : ActorMethod<
317
+ [NotifyCreateCanisterArg],
318
+ NotifyCreateCanisterResult
319
+ >,
320
+ /**
321
+ * Mints cycles and deposits them to the cycles ledger
322
+ */
323
+ 'notify_mint_cycles' : ActorMethod<
324
+ [NotifyMintCyclesArg],
325
+ NotifyMintCyclesResult
326
+ >,
327
+ /**
328
+ * Prompts the cycles minting canister to process a payment by converting ICP
329
+ * into cycles and sending the cycles the specified canister.
330
+ */
331
+ 'notify_top_up' : ActorMethod<[NotifyTopUpArg], NotifyTopUpResult>,
332
+ /**
333
+ * Below are methods that can only be called by other NNS canisters.
334
+ */
335
+ 'set_authorized_subnetwork_list' : ActorMethod<
336
+ [SetAuthorizedSubnetworkListArgs],
337
+ undefined
338
+ >,
339
+ 'update_subnet_type' : ActorMethod<[UpdateSubnetTypeArgs], undefined>,
340
+ }
341
+ export declare const idlService: IDL.ServiceClass;
342
+ export declare const idlInitArgs: IDL.Type[];
343
+ export declare const idlFactory: IDL.InterfaceFactory;
344
+ export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[];
@@ -0,0 +1,338 @@
1
+ /* eslint-disable */
2
+
3
+ // @ts-nocheck
4
+
5
+ // This file was automatically generated by @icp-sdk/bindgen@0.2.0.
6
+ // You should NOT make any changes in this file as it will be overwritten.
7
+ // Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
8
+
9
+ import {IDL} from '@icp-sdk/core/candid';
10
+
11
+ export const ExchangeRateCanister = IDL.Variant({
12
+ Set: IDL.Principal,
13
+ Unset: IDL.Null
14
+ });
15
+ export const AccountIdentifier = IDL.Text;
16
+ export const CyclesCanisterInitPayload = IDL.Record({
17
+ exchange_rate_canister: IDL.Opt(ExchangeRateCanister),
18
+ cycles_ledger_canister_id: IDL.Opt(IDL.Principal),
19
+ last_purged_notification: IDL.Opt(IDL.Nat64),
20
+ governance_canister_id: IDL.Opt(IDL.Principal),
21
+ minting_account_id: IDL.Opt(AccountIdentifier),
22
+ ledger_canister_id: IDL.Opt(IDL.Principal)
23
+ });
24
+ export const SubnetListWithType = IDL.Record({
25
+ subnets: IDL.Vec(IDL.Principal),
26
+ subnet_type: IDL.Text
27
+ });
28
+ export const ChangeSubnetTypeAssignmentArgs = IDL.Variant({
29
+ Add: SubnetListWithType,
30
+ Remove: SubnetListWithType
31
+ });
32
+ export const SubnetFilter = IDL.Record({subnet_type: IDL.Opt(IDL.Text)});
33
+ export const SubnetSelection = IDL.Variant({
34
+ Filter: SubnetFilter,
35
+ Subnet: IDL.Record({subnet: IDL.Principal})
36
+ });
37
+ export const environment_variable = IDL.Record({
38
+ value: IDL.Text,
39
+ name: IDL.Text
40
+ });
41
+ export const log_visibility = IDL.Variant({
42
+ controllers: IDL.Null,
43
+ public: IDL.Null,
44
+ allowed_viewers: IDL.Vec(IDL.Principal)
45
+ });
46
+ export const CanisterSettings = IDL.Record({
47
+ freezing_threshold: IDL.Opt(IDL.Nat),
48
+ wasm_memory_threshold: IDL.Opt(IDL.Nat),
49
+ environment_variables: IDL.Opt(IDL.Vec(environment_variable)),
50
+ controllers: IDL.Opt(IDL.Vec(IDL.Principal)),
51
+ reserved_cycles_limit: IDL.Opt(IDL.Nat),
52
+ log_visibility: IDL.Opt(log_visibility),
53
+ log_memory_limit: IDL.Opt(IDL.Nat),
54
+ wasm_memory_limit: IDL.Opt(IDL.Nat),
55
+ memory_allocation: IDL.Opt(IDL.Nat),
56
+ compute_allocation: IDL.Opt(IDL.Nat)
57
+ });
58
+ export const CreateCanisterArg = IDL.Record({
59
+ subnet_selection: IDL.Opt(SubnetSelection),
60
+ settings: IDL.Opt(CanisterSettings),
61
+ subnet_type: IDL.Opt(IDL.Text)
62
+ });
63
+ export const CreateCanisterError = IDL.Variant({
64
+ Refunded: IDL.Record({
65
+ create_error: IDL.Text,
66
+ refund_amount: IDL.Nat
67
+ })
68
+ });
69
+ export const CreateCanisterResult = IDL.Variant({
70
+ Ok: IDL.Principal,
71
+ Err: CreateCanisterError
72
+ });
73
+ export const IcpXdrConversionRate = IDL.Record({
74
+ xdr_permyriad_per_icp: IDL.Nat64,
75
+ timestamp_seconds: IDL.Nat64
76
+ });
77
+ export const IcpXdrConversionRateResponse = IDL.Record({
78
+ certificate: IDL.Vec(IDL.Nat8),
79
+ data: IcpXdrConversionRate,
80
+ hash_tree: IDL.Vec(IDL.Nat8)
81
+ });
82
+ export const PrincipalsAuthorizedToCreateCanistersToSubnetsResponse = IDL.Record({
83
+ data: IDL.Vec(IDL.Tuple(IDL.Principal, IDL.Vec(IDL.Principal)))
84
+ });
85
+ export const SubnetTypesToSubnetsResponse = IDL.Record({
86
+ data: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Vec(IDL.Principal)))
87
+ });
88
+ export const BlockIndex = IDL.Nat64;
89
+ export const NotifyCreateCanisterArg = IDL.Record({
90
+ controller: IDL.Principal,
91
+ block_index: BlockIndex,
92
+ subnet_selection: IDL.Opt(SubnetSelection),
93
+ settings: IDL.Opt(CanisterSettings),
94
+ subnet_type: IDL.Opt(IDL.Text)
95
+ });
96
+ export const NotifyError = IDL.Variant({
97
+ Refunded: IDL.Record({
98
+ block_index: IDL.Opt(BlockIndex),
99
+ reason: IDL.Text
100
+ }),
101
+ InvalidTransaction: IDL.Text,
102
+ Other: IDL.Record({
103
+ error_message: IDL.Text,
104
+ error_code: IDL.Nat64
105
+ }),
106
+ Processing: IDL.Null,
107
+ TransactionTooOld: BlockIndex
108
+ });
109
+ export const NotifyCreateCanisterResult = IDL.Variant({
110
+ Ok: IDL.Principal,
111
+ Err: NotifyError
112
+ });
113
+ export const Memo = IDL.Opt(IDL.Vec(IDL.Nat8));
114
+ export const Subaccount = IDL.Opt(IDL.Vec(IDL.Nat8));
115
+ export const NotifyMintCyclesArg = IDL.Record({
116
+ block_index: BlockIndex,
117
+ deposit_memo: Memo,
118
+ to_subaccount: Subaccount
119
+ });
120
+ export const NotifyMintCyclesSuccess = IDL.Record({
121
+ balance: IDL.Nat,
122
+ block_index: IDL.Nat,
123
+ minted: IDL.Nat
124
+ });
125
+ export const NotifyMintCyclesResult = IDL.Variant({
126
+ Ok: NotifyMintCyclesSuccess,
127
+ Err: NotifyError
128
+ });
129
+ export const NotifyTopUpArg = IDL.Record({
130
+ block_index: BlockIndex,
131
+ canister_id: IDL.Principal
132
+ });
133
+ export const Cycles = IDL.Nat;
134
+ export const NotifyTopUpResult = IDL.Variant({
135
+ Ok: Cycles,
136
+ Err: NotifyError
137
+ });
138
+ export const SetAuthorizedSubnetworkListArgs = IDL.Record({
139
+ who: IDL.Opt(IDL.Principal),
140
+ subnets: IDL.Vec(IDL.Principal)
141
+ });
142
+ export const UpdateSubnetTypeArgs = IDL.Variant({
143
+ Add: IDL.Text,
144
+ Remove: IDL.Text
145
+ });
146
+
147
+ export const idlService = IDL.Service({
148
+ change_subnet_type_assignment: IDL.Func([ChangeSubnetTypeAssignmentArgs], [], []),
149
+ create_canister: IDL.Func([CreateCanisterArg], [CreateCanisterResult], []),
150
+ get_build_metadata: IDL.Func([], [IDL.Text], ['query']),
151
+ get_default_subnets: IDL.Func([], [IDL.Vec(IDL.Principal)], ['query']),
152
+ get_icp_xdr_conversion_rate: IDL.Func([], [IcpXdrConversionRateResponse], ['query']),
153
+ get_principals_authorized_to_create_canisters_to_subnets: IDL.Func(
154
+ [],
155
+ [PrincipalsAuthorizedToCreateCanistersToSubnetsResponse],
156
+ ['query']
157
+ ),
158
+ get_subnet_types_to_subnets: IDL.Func([], [SubnetTypesToSubnetsResponse], ['query']),
159
+ notify_create_canister: IDL.Func([NotifyCreateCanisterArg], [NotifyCreateCanisterResult], []),
160
+ notify_mint_cycles: IDL.Func([NotifyMintCyclesArg], [NotifyMintCyclesResult], []),
161
+ notify_top_up: IDL.Func([NotifyTopUpArg], [NotifyTopUpResult], []),
162
+ set_authorized_subnetwork_list: IDL.Func([SetAuthorizedSubnetworkListArgs], [], []),
163
+ update_subnet_type: IDL.Func([UpdateSubnetTypeArgs], [], [])
164
+ });
165
+
166
+ export const idlInitArgs = [IDL.Opt(CyclesCanisterInitPayload)];
167
+
168
+ export const idlFactory = ({IDL}) => {
169
+ const ExchangeRateCanister = IDL.Variant({
170
+ Set: IDL.Principal,
171
+ Unset: IDL.Null
172
+ });
173
+ const AccountIdentifier = IDL.Text;
174
+ const CyclesCanisterInitPayload = IDL.Record({
175
+ exchange_rate_canister: IDL.Opt(ExchangeRateCanister),
176
+ cycles_ledger_canister_id: IDL.Opt(IDL.Principal),
177
+ last_purged_notification: IDL.Opt(IDL.Nat64),
178
+ governance_canister_id: IDL.Opt(IDL.Principal),
179
+ minting_account_id: IDL.Opt(AccountIdentifier),
180
+ ledger_canister_id: IDL.Opt(IDL.Principal)
181
+ });
182
+ const SubnetListWithType = IDL.Record({
183
+ subnets: IDL.Vec(IDL.Principal),
184
+ subnet_type: IDL.Text
185
+ });
186
+ const ChangeSubnetTypeAssignmentArgs = IDL.Variant({
187
+ Add: SubnetListWithType,
188
+ Remove: SubnetListWithType
189
+ });
190
+ const SubnetFilter = IDL.Record({subnet_type: IDL.Opt(IDL.Text)});
191
+ const SubnetSelection = IDL.Variant({
192
+ Filter: SubnetFilter,
193
+ Subnet: IDL.Record({subnet: IDL.Principal})
194
+ });
195
+ const environment_variable = IDL.Record({
196
+ value: IDL.Text,
197
+ name: IDL.Text
198
+ });
199
+ const log_visibility = IDL.Variant({
200
+ controllers: IDL.Null,
201
+ public: IDL.Null,
202
+ allowed_viewers: IDL.Vec(IDL.Principal)
203
+ });
204
+ const CanisterSettings = IDL.Record({
205
+ freezing_threshold: IDL.Opt(IDL.Nat),
206
+ wasm_memory_threshold: IDL.Opt(IDL.Nat),
207
+ environment_variables: IDL.Opt(IDL.Vec(environment_variable)),
208
+ controllers: IDL.Opt(IDL.Vec(IDL.Principal)),
209
+ reserved_cycles_limit: IDL.Opt(IDL.Nat),
210
+ log_visibility: IDL.Opt(log_visibility),
211
+ log_memory_limit: IDL.Opt(IDL.Nat),
212
+ wasm_memory_limit: IDL.Opt(IDL.Nat),
213
+ memory_allocation: IDL.Opt(IDL.Nat),
214
+ compute_allocation: IDL.Opt(IDL.Nat)
215
+ });
216
+ const CreateCanisterArg = IDL.Record({
217
+ subnet_selection: IDL.Opt(SubnetSelection),
218
+ settings: IDL.Opt(CanisterSettings),
219
+ subnet_type: IDL.Opt(IDL.Text)
220
+ });
221
+ const CreateCanisterError = IDL.Variant({
222
+ Refunded: IDL.Record({
223
+ create_error: IDL.Text,
224
+ refund_amount: IDL.Nat
225
+ })
226
+ });
227
+ const CreateCanisterResult = IDL.Variant({
228
+ Ok: IDL.Principal,
229
+ Err: CreateCanisterError
230
+ });
231
+ const IcpXdrConversionRate = IDL.Record({
232
+ xdr_permyriad_per_icp: IDL.Nat64,
233
+ timestamp_seconds: IDL.Nat64
234
+ });
235
+ const IcpXdrConversionRateResponse = IDL.Record({
236
+ certificate: IDL.Vec(IDL.Nat8),
237
+ data: IcpXdrConversionRate,
238
+ hash_tree: IDL.Vec(IDL.Nat8)
239
+ });
240
+ const PrincipalsAuthorizedToCreateCanistersToSubnetsResponse = IDL.Record({
241
+ data: IDL.Vec(IDL.Tuple(IDL.Principal, IDL.Vec(IDL.Principal)))
242
+ });
243
+ const SubnetTypesToSubnetsResponse = IDL.Record({
244
+ data: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Vec(IDL.Principal)))
245
+ });
246
+ const BlockIndex = IDL.Nat64;
247
+ const NotifyCreateCanisterArg = IDL.Record({
248
+ controller: IDL.Principal,
249
+ block_index: BlockIndex,
250
+ subnet_selection: IDL.Opt(SubnetSelection),
251
+ settings: IDL.Opt(CanisterSettings),
252
+ subnet_type: IDL.Opt(IDL.Text)
253
+ });
254
+ const NotifyError = IDL.Variant({
255
+ Refunded: IDL.Record({
256
+ block_index: IDL.Opt(BlockIndex),
257
+ reason: IDL.Text
258
+ }),
259
+ InvalidTransaction: IDL.Text,
260
+ Other: IDL.Record({
261
+ error_message: IDL.Text,
262
+ error_code: IDL.Nat64
263
+ }),
264
+ Processing: IDL.Null,
265
+ TransactionTooOld: BlockIndex
266
+ });
267
+ const NotifyCreateCanisterResult = IDL.Variant({
268
+ Ok: IDL.Principal,
269
+ Err: NotifyError
270
+ });
271
+ const Memo = IDL.Opt(IDL.Vec(IDL.Nat8));
272
+ const Subaccount = IDL.Opt(IDL.Vec(IDL.Nat8));
273
+ const NotifyMintCyclesArg = IDL.Record({
274
+ block_index: BlockIndex,
275
+ deposit_memo: Memo,
276
+ to_subaccount: Subaccount
277
+ });
278
+ const NotifyMintCyclesSuccess = IDL.Record({
279
+ balance: IDL.Nat,
280
+ block_index: IDL.Nat,
281
+ minted: IDL.Nat
282
+ });
283
+ const NotifyMintCyclesResult = IDL.Variant({
284
+ Ok: NotifyMintCyclesSuccess,
285
+ Err: NotifyError
286
+ });
287
+ const NotifyTopUpArg = IDL.Record({
288
+ block_index: BlockIndex,
289
+ canister_id: IDL.Principal
290
+ });
291
+ const Cycles = IDL.Nat;
292
+ const NotifyTopUpResult = IDL.Variant({Ok: Cycles, Err: NotifyError});
293
+ const SetAuthorizedSubnetworkListArgs = IDL.Record({
294
+ who: IDL.Opt(IDL.Principal),
295
+ subnets: IDL.Vec(IDL.Principal)
296
+ });
297
+ const UpdateSubnetTypeArgs = IDL.Variant({
298
+ Add: IDL.Text,
299
+ Remove: IDL.Text
300
+ });
301
+
302
+ return IDL.Service({
303
+ change_subnet_type_assignment: IDL.Func([ChangeSubnetTypeAssignmentArgs], [], []),
304
+ create_canister: IDL.Func([CreateCanisterArg], [CreateCanisterResult], []),
305
+ get_build_metadata: IDL.Func([], [IDL.Text], ['query']),
306
+ get_default_subnets: IDL.Func([], [IDL.Vec(IDL.Principal)], ['query']),
307
+ get_icp_xdr_conversion_rate: IDL.Func([], [IcpXdrConversionRateResponse], ['query']),
308
+ get_principals_authorized_to_create_canisters_to_subnets: IDL.Func(
309
+ [],
310
+ [PrincipalsAuthorizedToCreateCanistersToSubnetsResponse],
311
+ ['query']
312
+ ),
313
+ get_subnet_types_to_subnets: IDL.Func([], [SubnetTypesToSubnetsResponse], ['query']),
314
+ notify_create_canister: IDL.Func([NotifyCreateCanisterArg], [NotifyCreateCanisterResult], []),
315
+ notify_mint_cycles: IDL.Func([NotifyMintCyclesArg], [NotifyMintCyclesResult], []),
316
+ notify_top_up: IDL.Func([NotifyTopUpArg], [NotifyTopUpResult], []),
317
+ set_authorized_subnetwork_list: IDL.Func([SetAuthorizedSubnetworkListArgs], [], []),
318
+ update_subnet_type: IDL.Func([UpdateSubnetTypeArgs], [], [])
319
+ });
320
+ };
321
+
322
+ export const init = ({IDL}) => {
323
+ const ExchangeRateCanister = IDL.Variant({
324
+ Set: IDL.Principal,
325
+ Unset: IDL.Null
326
+ });
327
+ const AccountIdentifier = IDL.Text;
328
+ const CyclesCanisterInitPayload = IDL.Record({
329
+ exchange_rate_canister: IDL.Opt(ExchangeRateCanister),
330
+ cycles_ledger_canister_id: IDL.Opt(IDL.Principal),
331
+ last_purged_notification: IDL.Opt(IDL.Nat64),
332
+ governance_canister_id: IDL.Opt(IDL.Principal),
333
+ minting_account_id: IDL.Opt(AccountIdentifier),
334
+ ledger_canister_id: IDL.Opt(IDL.Principal)
335
+ });
336
+
337
+ return [IDL.Opt(CyclesCanisterInitPayload)];
338
+ };