@junobuild/functions 0.4.1 → 0.5.0

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 +39 -2
  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,831 @@
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
+ /**
14
+ * Represents an account on the ckBTC ledger.
15
+ */
16
+ export interface Account {
17
+ 'owner' : Principal,
18
+ 'subaccount' : [] | [Uint8Array],
19
+ }
20
+ export type BitcoinAddress = { 'p2wsh_v0' : Uint8Array } |
21
+ { 'p2tr_v1' : Uint8Array } |
22
+ { 'p2sh' : Uint8Array } |
23
+ { 'p2wpkh_v0' : Uint8Array } |
24
+ { 'p2pkh' : Uint8Array };
25
+ export type BtcNetwork = {
26
+ /**
27
+ * The public Bitcoin mainnet.
28
+ */
29
+ 'Mainnet' : null
30
+ } |
31
+ {
32
+ /**
33
+ * A local Bitcoin regtest installation.
34
+ */
35
+ 'Regtest' : null
36
+ } |
37
+ {
38
+ /**
39
+ * The public Bitcoin testnet.
40
+ */
41
+ 'Testnet' : null
42
+ };
43
+ export interface CanisterStatusResponse {
44
+ 'memory_metrics' : MemoryMetrics,
45
+ 'status' : CanisterStatusType,
46
+ 'memory_size' : bigint,
47
+ 'cycles' : bigint,
48
+ 'settings' : DefiniteCanisterSettings,
49
+ 'query_stats' : QueryStats,
50
+ 'idle_cycles_burned_per_day' : bigint,
51
+ 'module_hash' : [] | [Uint8Array],
52
+ 'reserved_cycles' : bigint,
53
+ }
54
+ export type CanisterStatusType = { 'stopped' : null } |
55
+ { 'stopping' : null } |
56
+ { 'running' : null };
57
+ export interface DefiniteCanisterSettings {
58
+ 'freezing_threshold' : bigint,
59
+ 'wasm_memory_threshold' : bigint,
60
+ 'controllers' : Array<Principal>,
61
+ 'reserved_cycles_limit' : bigint,
62
+ 'log_visibility' : LogVisibility,
63
+ 'wasm_memory_limit' : bigint,
64
+ 'memory_allocation' : bigint,
65
+ 'compute_allocation' : bigint,
66
+ }
67
+ export interface Event { 'timestamp' : [] | [bigint], 'payload' : EventType }
68
+ export type EventType = {
69
+ 'received_utxos' : {
70
+ 'to_account' : Account,
71
+ 'mint_txid' : [] | [bigint],
72
+ 'utxos' : Array<Utxo>,
73
+ }
74
+ } |
75
+ {
76
+ 'schedule_deposit_reimbursement' : {
77
+ 'burn_block_index' : bigint,
78
+ 'account' : Account,
79
+ 'amount' : bigint,
80
+ 'reason' : ReimbursementReason,
81
+ }
82
+ } |
83
+ {
84
+ 'sent_transaction' : {
85
+ 'fee' : [] | [bigint],
86
+ 'change_output' : [] | [{ 'value' : bigint, 'vout' : number }],
87
+ 'txid' : Uint8Array,
88
+ 'withdrawal_fee' : [] | [WithdrawalFee],
89
+ 'utxos' : Array<Utxo>,
90
+ 'requests' : BigUint64Array,
91
+ 'submitted_at' : bigint,
92
+ }
93
+ } |
94
+ {
95
+ 'distributed_kyt_fee' : {
96
+ 'block_index' : bigint,
97
+ 'amount' : bigint,
98
+ 'kyt_provider' : Principal,
99
+ }
100
+ } |
101
+ { 'init' : InitArgs } |
102
+ { 'upgrade' : UpgradeArgs } |
103
+ {
104
+ 'retrieve_btc_kyt_failed' : {
105
+ 'block_index' : bigint,
106
+ 'owner' : Principal,
107
+ 'uuid' : string,
108
+ 'address' : string,
109
+ 'amount' : bigint,
110
+ 'kyt_provider' : Principal,
111
+ }
112
+ } |
113
+ {
114
+ 'suspended_utxo' : {
115
+ 'utxo' : Utxo,
116
+ 'account' : Account,
117
+ 'reason' : SuspendedReason,
118
+ }
119
+ } |
120
+ {
121
+ 'accepted_retrieve_btc_request' : {
122
+ 'received_at' : bigint,
123
+ 'block_index' : bigint,
124
+ 'address' : BitcoinAddress,
125
+ 'reimbursement_account' : [] | [Account],
126
+ 'amount' : bigint,
127
+ 'kyt_provider' : [] | [Principal],
128
+ }
129
+ } |
130
+ {
131
+ 'checked_utxo' : {
132
+ 'clean' : boolean,
133
+ 'utxo' : Utxo,
134
+ 'uuid' : string,
135
+ 'kyt_provider' : [] | [Principal],
136
+ }
137
+ } |
138
+ {
139
+ 'schedule_withdrawal_reimbursement' : {
140
+ 'burn_block_index' : bigint,
141
+ 'account' : Account,
142
+ 'amount' : bigint,
143
+ 'reason' : WithdrawalReimbursementReason,
144
+ }
145
+ } |
146
+ { 'quarantined_withdrawal_reimbursement' : { 'burn_block_index' : bigint } } |
147
+ { 'removed_retrieve_btc_request' : { 'block_index' : bigint } } |
148
+ { 'confirmed_transaction' : { 'txid' : Uint8Array } } |
149
+ {
150
+ 'replaced_transaction' : {
151
+ 'fee' : bigint,
152
+ 'change_output' : { 'value' : bigint, 'vout' : number },
153
+ 'new_utxos' : [] | [Array<Utxo>],
154
+ 'old_txid' : Uint8Array,
155
+ 'withdrawal_fee' : [] | [WithdrawalFee],
156
+ 'new_txid' : Uint8Array,
157
+ 'submitted_at' : bigint,
158
+ 'reason' : [] | [ReplacedReason],
159
+ }
160
+ } |
161
+ { 'checked_utxo_v2' : { 'utxo' : Utxo, 'account' : Account } } |
162
+ { 'ignored_utxo' : { 'utxo' : Utxo } } |
163
+ { 'checked_utxo_mint_unknown' : { 'utxo' : Utxo, 'account' : Account } } |
164
+ {
165
+ 'reimbursed_failed_deposit' : {
166
+ 'burn_block_index' : bigint,
167
+ 'mint_block_index' : bigint,
168
+ }
169
+ } |
170
+ {
171
+ 'reimbursed_withdrawal' : {
172
+ 'burn_block_index' : bigint,
173
+ 'mint_block_index' : bigint,
174
+ }
175
+ };
176
+ /**
177
+ * The initialization parameters of the minter canister.
178
+ */
179
+ export interface InitArgs {
180
+ /**
181
+ * / The expiration duration (in seconds) for cached entries in the get_utxos cache.
182
+ */
183
+ 'get_utxos_cache_expiration_seconds' : [] | [bigint],
184
+ /**
185
+ * / The canister id of the KYT canister (deprecated, use btc_checker_principal instead).
186
+ */
187
+ 'kyt_principal' : [] | [Principal],
188
+ /**
189
+ * The name of the ECDSA key to use.
190
+ * E.g., "dfx_test_key" on the local replica.
191
+ */
192
+ 'ecdsa_key_name' : string,
193
+ /**
194
+ * / The minter's operation mode.
195
+ */
196
+ 'mode' : Mode,
197
+ /**
198
+ * The minimal amount of ckBTC that can be converted to BTC.
199
+ */
200
+ 'retrieve_btc_min_amount' : bigint,
201
+ /**
202
+ * The principal of the ledger that handles ckBTC transfers.
203
+ * The default account of the ckBTC minter must be configured as
204
+ * the minting account of the ledger.
205
+ */
206
+ 'ledger_id' : Principal,
207
+ /**
208
+ * / Maximum time in nanoseconds that a transaction should spend in the queue
209
+ * / before being sent.
210
+ */
211
+ 'max_time_in_queue_nanos' : bigint,
212
+ /**
213
+ * The minter will interact with this Bitcoin network.
214
+ */
215
+ 'btc_network' : BtcNetwork,
216
+ /**
217
+ * / The fee paid per Bitcoin check.
218
+ */
219
+ 'check_fee' : [] | [bigint],
220
+ /**
221
+ * / The canister id of the Bitcoin checker canister.
222
+ */
223
+ 'btc_checker_principal' : [] | [Principal],
224
+ /**
225
+ * / The minimum number of confirmations required for the minter to
226
+ * / accept a Bitcoin transaction.
227
+ */
228
+ 'min_confirmations' : [] | [number],
229
+ /**
230
+ * / The fee paid per check by the KYT canister (deprecated, use check_fee instead).
231
+ */
232
+ 'kyt_fee' : [] | [bigint],
233
+ }
234
+ export type InvalidTransactionError = {
235
+ 'too_many_inputs' : { 'max_num_inputs' : bigint, 'num_inputs' : bigint }
236
+ };
237
+ export type LogVisibility = { 'controllers' : null } |
238
+ { 'public' : null } |
239
+ { 'allowed_viewers' : Array<Principal> };
240
+ export interface MemoryMetrics {
241
+ 'wasm_binary_size' : bigint,
242
+ 'wasm_chunk_store_size' : bigint,
243
+ 'canister_history_size' : bigint,
244
+ 'stable_memory_size' : bigint,
245
+ 'snapshots_size' : bigint,
246
+ 'wasm_memory_size' : bigint,
247
+ 'global_memory_size' : bigint,
248
+ 'custom_sections_size' : bigint,
249
+ }
250
+ export type MinterArg = { 'Upgrade' : [] | [UpgradeArgs] } |
251
+ { 'Init' : InitArgs };
252
+ export interface MinterInfo {
253
+ /**
254
+ * This amount is based on the `retrieve_btc_min_amount` setting during canister
255
+ * initialization or upgrades, but may vary according to current network fees.
256
+ */
257
+ 'retrieve_btc_min_amount' : bigint,
258
+ 'min_confirmations' : number,
259
+ /**
260
+ * The same as `check_fee`, but the old name is kept here to be backward compatible.
261
+ */
262
+ 'kyt_fee' : bigint,
263
+ }
264
+ export type Mode = {
265
+ /**
266
+ * Only specified principals can modify minter's state.
267
+ */
268
+ 'RestrictedTo' : Array<Principal>
269
+ } |
270
+ {
271
+ /**
272
+ * Only specified principals can convert BTC to ckBTC.
273
+ */
274
+ 'DepositsRestrictedTo' : Array<Principal>
275
+ } |
276
+ {
277
+ /**
278
+ * The minter does not allow any state modifications.
279
+ */
280
+ 'ReadOnly' : null
281
+ } |
282
+ {
283
+ /**
284
+ * Anyone can interact with the minter.
285
+ */
286
+ 'GeneralAvailability' : null
287
+ };
288
+ /**
289
+ * Utxos that don't have enough confirmations to be processed.
290
+ */
291
+ export interface PendingUtxo {
292
+ 'confirmations' : number,
293
+ 'value' : bigint,
294
+ 'outpoint' : { 'txid' : Uint8Array, 'vout' : number },
295
+ }
296
+ export interface QueryStats {
297
+ 'response_payload_bytes_total' : bigint,
298
+ 'num_instructions_total' : bigint,
299
+ 'num_calls_total' : bigint,
300
+ 'request_payload_bytes_total' : bigint,
301
+ }
302
+ export interface ReimbursedDeposit {
303
+ 'account' : Account,
304
+ 'mint_block_index' : bigint,
305
+ 'amount' : bigint,
306
+ 'reason' : ReimbursementReason,
307
+ }
308
+ export type ReimbursementReason = { 'CallFailed' : null } |
309
+ { 'TaintedDestination' : { 'kyt_fee' : bigint, 'kyt_provider' : Principal } };
310
+ export interface ReimbursementRequest {
311
+ 'account' : Account,
312
+ 'amount' : bigint,
313
+ 'reason' : ReimbursementReason,
314
+ }
315
+ export type ReplacedReason = {
316
+ 'to_cancel' : { 'reason' : WithdrawalReimbursementReason }
317
+ } |
318
+ { 'to_retry' : null };
319
+ export interface RetrieveBtcArgs {
320
+ /**
321
+ * The address to which the ckBTC minter should deposit BTC.
322
+ */
323
+ 'address' : string,
324
+ /**
325
+ * The amount of ckBTC in Satoshis that the client wants to withdraw.
326
+ */
327
+ 'amount' : bigint,
328
+ }
329
+ export type RetrieveBtcError = {
330
+ /**
331
+ * The minter failed to parse the destination address.
332
+ */
333
+ 'MalformedAddress' : string
334
+ } |
335
+ {
336
+ /**
337
+ * A generic error reserved for future extensions.
338
+ */
339
+ 'GenericError' : { 'error_message' : string, 'error_code' : bigint }
340
+ } |
341
+ {
342
+ /**
343
+ * The minter is overloaded, retry the request.
344
+ * The payload contains a human-readable message explaining what caused the unavailability.
345
+ */
346
+ 'TemporarilyUnavailable' : string
347
+ } |
348
+ {
349
+ /**
350
+ * The minter is already processing another retrieval request for the same
351
+ * principal.
352
+ */
353
+ 'AlreadyProcessing' : null
354
+ } |
355
+ {
356
+ /**
357
+ * The withdrawal amount is too low.
358
+ * The payload contains the minimal withdrawal amount.
359
+ */
360
+ 'AmountTooLow' : bigint
361
+ } |
362
+ {
363
+ /**
364
+ * The ckBTC balance of the withdrawal account is too low.
365
+ */
366
+ 'InsufficientFunds' : { 'balance' : bigint }
367
+ };
368
+ export interface RetrieveBtcOk {
369
+ /**
370
+ * Returns the burn transaction index corresponding to the withdrawal.
371
+ * You can use this index to query the withdrawal status.
372
+ */
373
+ 'block_index' : bigint,
374
+ }
375
+ export type RetrieveBtcStatus = {
376
+ /**
377
+ * The minter is obtaining all required ECDSA signatures on the
378
+ * Bitcoin transaction for this request.
379
+ */
380
+ 'Signing' : null
381
+ } |
382
+ {
383
+ /**
384
+ * The minter received enough confirmations for the Bitcoin
385
+ * transaction for this request. The payload contains the
386
+ * identifier of the transaction on the Bitcoin network.
387
+ */
388
+ 'Confirmed' : { 'txid' : Uint8Array }
389
+ } |
390
+ {
391
+ /**
392
+ * The minter signed the transaction and is waiting for a reply
393
+ * from the Bitcoin canister.
394
+ */
395
+ 'Sending' : { 'txid' : Uint8Array }
396
+ } |
397
+ {
398
+ /**
399
+ * The amount was too low to cover the transaction fees.
400
+ */
401
+ 'AmountTooLow' : null
402
+ } |
403
+ {
404
+ /**
405
+ * The minter does not have any information on the specified
406
+ * retrieval request. It can be that nobody submitted the
407
+ * request or the minter pruned the relevant information from the
408
+ * history to save space.
409
+ */
410
+ 'Unknown' : null
411
+ } |
412
+ {
413
+ /**
414
+ * The minter sent a transaction for the retrieve request.
415
+ * The payload contains the identifier of the transaction on the Bitcoin network.
416
+ */
417
+ 'Submitted' : { 'txid' : Uint8Array }
418
+ } |
419
+ {
420
+ /**
421
+ * The minter did not send a Bitcoin transaction for this request yet.
422
+ */
423
+ 'Pending' : null
424
+ };
425
+ export type RetrieveBtcStatusV2 = {
426
+ /**
427
+ * The minter is obtaining all required ECDSA signatures on the
428
+ * Bitcoin transaction for this request.
429
+ */
430
+ 'Signing' : null
431
+ } |
432
+ {
433
+ /**
434
+ * The minter received enough confirmations for the Bitcoin
435
+ * transaction for this request. The payload contains the
436
+ * identifier of the transaction on the Bitcoin network.
437
+ */
438
+ 'Confirmed' : { 'txid' : Uint8Array }
439
+ } |
440
+ {
441
+ /**
442
+ * The minter signed the transaction and is waiting for a reply
443
+ * from the Bitcoin canister.
444
+ */
445
+ 'Sending' : { 'txid' : Uint8Array }
446
+ } |
447
+ {
448
+ /**
449
+ * The amount was too low to cover the transaction fees.
450
+ */
451
+ 'AmountTooLow' : null
452
+ } |
453
+ {
454
+ /**
455
+ * / The minter will try to reimburse this transaction.
456
+ */
457
+ 'WillReimburse' : ReimbursementRequest
458
+ } |
459
+ {
460
+ /**
461
+ * The minter does not have any information on the specified
462
+ * retrieval request. It can be that nobody submitted the
463
+ * request or the minter pruned the relevant information from the
464
+ * history to save space.
465
+ */
466
+ 'Unknown' : null
467
+ } |
468
+ {
469
+ /**
470
+ * The minter sent a transaction for the retrieve request.
471
+ * The payload contains the identifier of the transaction on the Bitcoin network.
472
+ */
473
+ 'Submitted' : { 'txid' : Uint8Array }
474
+ } |
475
+ {
476
+ /**
477
+ * / The retrieve Bitcoin request has been reimbursed.
478
+ */
479
+ 'Reimbursed' : ReimbursedDeposit
480
+ } |
481
+ {
482
+ /**
483
+ * The minter did not send a Bitcoin transaction for this request yet.
484
+ */
485
+ 'Pending' : null
486
+ };
487
+ export interface RetrieveBtcWithApprovalArgs {
488
+ /**
489
+ * The subaccount to burn ckBTC from.
490
+ */
491
+ 'from_subaccount' : [] | [Uint8Array],
492
+ /**
493
+ * The address to which the ckBTC minter should deposit BTC.
494
+ */
495
+ 'address' : string,
496
+ /**
497
+ * The amount of ckBTC in Satoshis that the client wants to withdraw.
498
+ */
499
+ 'amount' : bigint,
500
+ }
501
+ export type RetrieveBtcWithApprovalError = {
502
+ /**
503
+ * The minter failed to parse the destination address.
504
+ */
505
+ 'MalformedAddress' : string
506
+ } |
507
+ {
508
+ /**
509
+ * A generic error reserved for future extensions.
510
+ */
511
+ 'GenericError' : { 'error_message' : string, 'error_code' : bigint }
512
+ } |
513
+ {
514
+ /**
515
+ * The minter is overloaded, retry the request.
516
+ * The payload contains a human-readable message explaining what caused the unavailability.
517
+ */
518
+ 'TemporarilyUnavailable' : string
519
+ } |
520
+ {
521
+ /**
522
+ * The allowance given to the minter is too low.
523
+ */
524
+ 'InsufficientAllowance' : { 'allowance' : bigint }
525
+ } |
526
+ {
527
+ /**
528
+ * The minter is already processing another retrieval request for the same
529
+ * principal.
530
+ */
531
+ 'AlreadyProcessing' : null
532
+ } |
533
+ {
534
+ /**
535
+ * The withdrawal amount is too low.
536
+ * The payload contains the minimal withdrawal amount.
537
+ */
538
+ 'AmountTooLow' : bigint
539
+ } |
540
+ {
541
+ /**
542
+ * The ckBTC balance of the withdrawal account is too low.
543
+ */
544
+ 'InsufficientFunds' : { 'balance' : bigint }
545
+ };
546
+ export type SuspendedReason = {
547
+ /**
548
+ * The minter ignored this UTXO because UTXO's value is too small to pay
549
+ * the check fees.
550
+ */
551
+ 'ValueTooSmall' : null
552
+ } |
553
+ {
554
+ /**
555
+ * The Bitcoin checker considered this UTXO to be tainted.
556
+ */
557
+ 'Quarantined' : null
558
+ };
559
+ export interface SuspendedUtxo {
560
+ 'utxo' : Utxo,
561
+ 'earliest_retry' : Timestamp,
562
+ 'reason' : SuspendedReason,
563
+ }
564
+ /**
565
+ * Number of nanoseconds since the Unix Epoch
566
+ */
567
+ export type Timestamp = bigint;
568
+ export type UpdateBalanceError = {
569
+ /**
570
+ * A generic error reserved for future extensions.
571
+ */
572
+ 'GenericError' : { 'error_message' : string, 'error_code' : bigint }
573
+ } |
574
+ {
575
+ /**
576
+ * The minter is overloaded, retry the request.
577
+ * The payload contains a human-readable message explaining what caused the unavailability.
578
+ */
579
+ 'TemporarilyUnavailable' : string
580
+ } |
581
+ {
582
+ /**
583
+ * The minter is already processing another update balance request for the caller.
584
+ */
585
+ 'AlreadyProcessing' : null
586
+ } |
587
+ {
588
+ /**
589
+ * There are no new UTXOs to process.
590
+ */
591
+ 'NoNewUtxos' : {
592
+ 'suspended_utxos' : [] | [Array<SuspendedUtxo>],
593
+ 'required_confirmations' : number,
594
+ 'pending_utxos' : [] | [Array<PendingUtxo>],
595
+ 'current_confirmations' : [] | [number],
596
+ }
597
+ };
598
+ /**
599
+ * The upgrade parameters of the minter canister.
600
+ */
601
+ export interface UpgradeArgs {
602
+ /**
603
+ * / The expiration duration (in seconds) for cached entries in the get_utxos cache.
604
+ */
605
+ 'get_utxos_cache_expiration_seconds' : [] | [bigint],
606
+ /**
607
+ * / The canister id of the KYT canister (deprecated, use btc_checker_principal instead).
608
+ */
609
+ 'kyt_principal' : [] | [Principal],
610
+ /**
611
+ * / If set, overrides the current minter's operation mode.
612
+ */
613
+ 'mode' : [] | [Mode],
614
+ /**
615
+ * The minimal amount of ckBTC that the minter converts to BTC.
616
+ */
617
+ 'retrieve_btc_min_amount' : [] | [bigint],
618
+ /**
619
+ * / Maximum time in nanoseconds that a transaction should spend in the queue
620
+ * / before being sent.
621
+ */
622
+ 'max_time_in_queue_nanos' : [] | [bigint],
623
+ /**
624
+ * / The fee per Bitcoin check.
625
+ */
626
+ 'check_fee' : [] | [bigint],
627
+ /**
628
+ * / The principal of the Bitcoin checker canister.
629
+ */
630
+ 'btc_checker_principal' : [] | [Principal],
631
+ /**
632
+ * / The minimum number of confirmations required for the minter to
633
+ * / accept a Bitcoin transaction.
634
+ */
635
+ 'min_confirmations' : [] | [number],
636
+ /**
637
+ * / The fee paid per check by the KYT canister (deprecated, use check_fee instead).
638
+ */
639
+ 'kyt_fee' : [] | [bigint],
640
+ }
641
+ export interface Utxo {
642
+ 'height' : number,
643
+ 'value' : bigint,
644
+ 'outpoint' : { 'txid' : Uint8Array, 'vout' : number },
645
+ }
646
+ /**
647
+ * The result of an [update_balance] call.
648
+ */
649
+ export type UtxoStatus = {
650
+ /**
651
+ * The minter ignored this UTXO because UTXO's value is too small to pay
652
+ * the check fees.
653
+ */
654
+ 'ValueTooSmall' : Utxo
655
+ } |
656
+ {
657
+ /**
658
+ * The Bitcoin checker considered this UTXO to be tainted.
659
+ */
660
+ 'Tainted' : Utxo
661
+ } |
662
+ {
663
+ /**
664
+ * The UTXO passed the Bitcoin check, and ckBTC has been minted.
665
+ */
666
+ 'Minted' : {
667
+ 'minted_amount' : bigint,
668
+ 'block_index' : bigint,
669
+ 'utxo' : Utxo,
670
+ }
671
+ } |
672
+ {
673
+ /**
674
+ * The UTXO passed the Bitcoin check, but the minter failed to mint ckBTC
675
+ * because the Ledger was unavailable. Retrying the [update_balance] call
676
+ * should eventually advance the UTXO to the [Minted] state.
677
+ */
678
+ 'Checked' : Utxo
679
+ };
680
+ export interface WithdrawalFee { 'minter_fee' : bigint, 'bitcoin_fee' : bigint }
681
+ export type WithdrawalReimbursementReason = {
682
+ 'invalid_transaction' : InvalidTransactionError
683
+ };
684
+ export interface _SERVICE {
685
+ /**
686
+ * / Returns an estimate of the user's fee (in Satoshi) for a
687
+ * / retrieve_btc request based on the current status of the Bitcoin network.
688
+ */
689
+ 'estimate_withdrawal_fee' : ActorMethod<
690
+ [{ 'amount' : [] | [bigint] }],
691
+ { 'minter_fee' : bigint, 'bitcoin_fee' : bigint }
692
+ >,
693
+ /**
694
+ * Returns the Bitcoin address to which the owner should send BTC
695
+ * before converting the amount to ckBTC using the [update_balance]
696
+ * endpoint.
697
+ *
698
+ * If the owner is not set, it defaults to the caller's principal.
699
+ * The resolved owner must be a non-anonymous principal.
700
+ */
701
+ 'get_btc_address' : ActorMethod<
702
+ [{ 'owner' : [] | [Principal], 'subaccount' : [] | [Uint8Array] }],
703
+ string
704
+ >,
705
+ 'get_canister_status' : ActorMethod<[], CanisterStatusResponse>,
706
+ /**
707
+ * / Returns the fee that the minter will charge for a bitcoin deposit.
708
+ */
709
+ 'get_deposit_fee' : ActorMethod<[], bigint>,
710
+ /**
711
+ * The minter keeps track of all state modifications in an internal event log.
712
+ *
713
+ * This method returns a list of events in the specified range.
714
+ * The minter can return fewer events than requested. The result is
715
+ * an empty vector if the start position is greater than the total
716
+ * number of events.
717
+ *
718
+ * NOTE: this method exists for debugging purposes.
719
+ * The ckBTC minter authors do not guarantee backward compatibility for this method.
720
+ */
721
+ 'get_events' : ActorMethod<
722
+ [{ 'start' : bigint, 'length' : bigint }],
723
+ Array<Event>
724
+ >,
725
+ /**
726
+ * Returns UTXOs of the given account known by the minter (with no
727
+ * guarantee in the ordering of the returned values).
728
+ *
729
+ * If the owner is not set, it defaults to the caller's principal.
730
+ */
731
+ 'get_known_utxos' : ActorMethod<
732
+ [{ 'owner' : [] | [Principal], 'subaccount' : [] | [Uint8Array] }],
733
+ Array<Utxo>
734
+ >,
735
+ /**
736
+ * Section "Minter Information" {{{
737
+ * Returns internal minter parameters.
738
+ */
739
+ 'get_minter_info' : ActorMethod<[], MinterInfo>,
740
+ /**
741
+ * Returns the account to which the caller should deposit ckBTC
742
+ * before withdrawing BTC using the [retrieve_btc] endpoint.
743
+ */
744
+ 'get_withdrawal_account' : ActorMethod<[], Account>,
745
+ /**
746
+ * Submits a request to convert ckBTC to BTC.
747
+ *
748
+ * # Note
749
+ *
750
+ * The BTC retrieval process is slow. Instead of
751
+ * synchronously waiting for a BTC transaction to settle, this
752
+ * method returns a request ([block_index]) that the caller can use
753
+ * to query the request status.
754
+ *
755
+ * # Preconditions
756
+ *
757
+ * * The caller deposited the requested amount in ckBTC to the account
758
+ * that the [get_withdrawal_account] endpoint returns.
759
+ */
760
+ 'retrieve_btc' : ActorMethod<
761
+ [RetrieveBtcArgs],
762
+ { 'Ok' : RetrieveBtcOk } |
763
+ { 'Err' : RetrieveBtcError }
764
+ >,
765
+ /**
766
+ * / [deprecated] Returns the status of a withdrawal request.
767
+ * / You should use retrieve_btc_status_v2 to retrieve the status of your withdrawal request.
768
+ */
769
+ 'retrieve_btc_status' : ActorMethod<
770
+ [{ 'block_index' : bigint }],
771
+ RetrieveBtcStatus
772
+ >,
773
+ /**
774
+ * / Returns the status of a withdrawal request request using the RetrieveBtcStatusV2 type.
775
+ */
776
+ 'retrieve_btc_status_v2' : ActorMethod<
777
+ [{ 'block_index' : bigint }],
778
+ RetrieveBtcStatusV2
779
+ >,
780
+ /**
781
+ * Returns the withdrawal statues by account.
782
+ *
783
+ * # Note
784
+ * The _v2_ part indicates that you get a response in line with the retrieve_btc_status_v2 endpoint,
785
+ * i.e., you get a vector of RetrieveBtcStatusV2 and not RetrieveBtcStatus.
786
+ *
787
+ */
788
+ 'retrieve_btc_status_v2_by_account' : ActorMethod<
789
+ [[] | [Account]],
790
+ Array<{ 'block_index' : bigint, 'status_v2' : [] | [RetrieveBtcStatusV2] }>
791
+ >,
792
+ /**
793
+ * Submits a request to convert ckBTC to BTC.
794
+ *
795
+ * # Note
796
+ *
797
+ * The BTC retrieval process is slow. Instead of
798
+ * synchronously waiting for a BTC transaction to settle, this
799
+ * method returns a request ([block_index]) that the caller can use
800
+ * to query the request status.
801
+ *
802
+ * # Preconditions
803
+ *
804
+ * * The caller allowed the minter's principal to spend its funds
805
+ * using [icrc2_approve] on the ckBTC ledger.
806
+ */
807
+ 'retrieve_btc_with_approval' : ActorMethod<
808
+ [RetrieveBtcWithApprovalArgs],
809
+ { 'Ok' : RetrieveBtcOk } |
810
+ { 'Err' : RetrieveBtcWithApprovalError }
811
+ >,
812
+ /**
813
+ * Mints ckBTC for newly deposited UTXOs.
814
+ *
815
+ * If the owner is not set, it defaults to the caller's principal.
816
+ *
817
+ * # Preconditions
818
+ *
819
+ * * The owner deposited some BTC to the address that the
820
+ * [get_btc_address] endpoint returns.
821
+ */
822
+ 'update_balance' : ActorMethod<
823
+ [{ 'owner' : [] | [Principal], 'subaccount' : [] | [Uint8Array] }],
824
+ { 'Ok' : Array<UtxoStatus> } |
825
+ { 'Err' : UpdateBalanceError }
826
+ >,
827
+ }
828
+ export declare const idlService: IDL.ServiceClass;
829
+ export declare const idlInitArgs: IDL.Type[];
830
+ export declare const idlFactory: IDL.InterfaceFactory;
831
+ export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[];