@dfinity/ckbtc 6.0.1-next-2025-12-03.2 → 6.0.1-next-2025-12-08

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.
@@ -1,610 +0,0 @@
1
- // Generated from IC repo commit 724ae41 (2025-11-27 tags: release-2025-11-28_03-22-base) 'rs/bitcoin/ckbtc/minter/ckbtc_minter.did' by import-candid
2
-
3
- // Represents an account on the ckBTC ledger.
4
- type Account = record { owner : principal; subaccount : opt blob };
5
-
6
- type environment_variable = record {
7
- name: text;
8
- value: text;
9
- };
10
-
11
- type CanisterStatusResponse = record {
12
- status : CanisterStatusType;
13
- ready_for_migration : bool;
14
- version : nat64;
15
- memory_size : nat;
16
- cycles : nat;
17
- settings : DefiniteCanisterSettings;
18
- idle_cycles_burned_per_day : nat;
19
- module_hash : opt vec nat8;
20
- query_stats : QueryStats;
21
- reserved_cycles : nat;
22
- memory_metrics : MemoryMetrics;
23
- };
24
-
25
- type QueryStats = record {
26
- response_payload_bytes_total : nat;
27
- num_instructions_total : nat;
28
- num_calls_total : nat;
29
- request_payload_bytes_total : nat;
30
- };
31
-
32
- type MemoryMetrics = record {
33
- wasm_memory_size : nat;
34
- stable_memory_size : nat;
35
- global_memory_size : nat;
36
- wasm_binary_size : nat;
37
- custom_sections_size : nat;
38
- canister_history_size : nat;
39
- wasm_chunk_store_size : nat;
40
- snapshots_size : nat;
41
- };
42
-
43
- type CanisterStatusType = variant { stopped; stopping; running };
44
-
45
- type DefiniteCanisterSettings = record {
46
- freezing_threshold : nat;
47
- controllers : vec principal;
48
- memory_allocation : nat;
49
- compute_allocation : nat;
50
- reserved_cycles_limit : nat;
51
- log_visibility: LogVisibility;
52
- wasm_memory_limit : nat;
53
- wasm_memory_threshold : nat;
54
- environment_variables : vec environment_variable;
55
- };
56
-
57
- type LogVisibility = variant {
58
- controllers;
59
- public;
60
- allowed_viewers : vec principal;
61
- };
62
-
63
- type RetrieveBtcArgs = record {
64
- // The address to which the ckBTC minter should deposit BTC.
65
- address : text;
66
- // The amount of ckBTC in Satoshis that the client wants to withdraw.
67
- amount : nat64;
68
- };
69
-
70
- type RetrieveBtcWithApprovalArgs = record {
71
- // The address to which the ckBTC minter should deposit BTC.
72
- address : text;
73
- // The amount of ckBTC in Satoshis that the client wants to withdraw.
74
- amount : nat64;
75
- // The subaccount to burn ckBTC from.
76
- from_subaccount : opt blob;
77
- };
78
-
79
- type RetrieveBtcError = variant {
80
- // The minter failed to parse the destination address.
81
- MalformedAddress : text;
82
- // The minter is already processing another retrieval request for the same
83
- // principal.
84
- AlreadyProcessing;
85
- // The withdrawal amount is too low.
86
- // The payload contains the minimal withdrawal amount.
87
- AmountTooLow : nat64;
88
- // The ckBTC balance of the withdrawal account is too low.
89
- InsufficientFunds : record { balance : nat64 };
90
- // The minter is overloaded, retry the request.
91
- // The payload contains a human-readable message explaining what caused the unavailability.
92
- TemporarilyUnavailable : text;
93
- // A generic error reserved for future extensions.
94
- GenericError : record { error_message : text; error_code : nat64 };
95
- };
96
-
97
- type RetrieveBtcWithApprovalError = variant {
98
- // The minter failed to parse the destination address.
99
- MalformedAddress : text;
100
- // The minter is already processing another retrieval request for the same
101
- // principal.
102
- AlreadyProcessing;
103
- // The withdrawal amount is too low.
104
- // The payload contains the minimal withdrawal amount.
105
- AmountTooLow : nat64;
106
- // The ckBTC balance of the withdrawal account is too low.
107
- InsufficientFunds : record { balance : nat64 };
108
- // The allowance given to the minter is too low.
109
- InsufficientAllowance : record { allowance : nat64 };
110
- // The minter is overloaded, retry the request.
111
- // The payload contains a human-readable message explaining what caused the unavailability.
112
- TemporarilyUnavailable : text;
113
- // A generic error reserved for future extensions.
114
- GenericError : record { error_message : text; error_code : nat64 };
115
- };
116
-
117
- type RetrieveBtcOk = record {
118
- // Returns the burn transaction index corresponding to the withdrawal.
119
- // You can use this index to query the withdrawal status.
120
- block_index : nat64
121
- };
122
-
123
- // The result of an [update_balance] call.
124
- type UtxoStatus = variant {
125
- // The minter ignored this UTXO because UTXO's value is too small to pay
126
- // the check fees.
127
- ValueTooSmall : Utxo;
128
- // The Bitcoin checker considered this UTXO to be tainted.
129
- Tainted : Utxo;
130
- // The UTXO passed the Bitcoin check, but the minter failed to mint ckBTC
131
- // because the Ledger was unavailable. Retrying the [update_balance] call
132
- // should eventually advance the UTXO to the [Minted] state.
133
- Checked : Utxo;
134
- // The UTXO passed the Bitcoin check, and ckBTC has been minted.
135
- Minted : record {
136
- block_index : nat64;
137
- minted_amount : nat64;
138
- utxo : Utxo;
139
- };
140
- };
141
-
142
- // Utxos that don't have enough confirmations to be processed.
143
- type PendingUtxo = record {
144
- outpoint : record { txid : vec nat8; vout : nat32 };
145
- value : nat64;
146
- confirmations: nat32;
147
- };
148
-
149
- // Number of nanoseconds since the Unix Epoch
150
- type Timestamp = nat64;
151
-
152
- type SuspendedUtxo = record {
153
- utxo : Utxo;
154
- reason : SuspendedReason;
155
- earliest_retry: Timestamp;
156
- };
157
-
158
- type UpdateBalanceError = variant {
159
- // There are no new UTXOs to process.
160
- NoNewUtxos : record {
161
- current_confirmations: opt nat32;
162
- required_confirmations: nat32;
163
- pending_utxos: opt vec PendingUtxo;
164
- suspended_utxos: opt vec SuspendedUtxo;
165
- };
166
- // The minter is already processing another update balance request for the caller.
167
- AlreadyProcessing;
168
- // The minter is overloaded, retry the request.
169
- // The payload contains a human-readable message explaining what caused the unavailability.
170
- TemporarilyUnavailable : text;
171
- // A generic error reserved for future extensions.
172
- GenericError : record { error_message : text; error_code : nat64 };
173
- };
174
-
175
- type BtcNetwork = variant {
176
- // The public Bitcoin mainnet.
177
- Mainnet;
178
- // The public Bitcoin testnet.
179
- Testnet;
180
- // A local Bitcoin regtest installation.
181
- Regtest;
182
- };
183
-
184
- type Mode = variant {
185
- // The minter does not allow any state modifications.
186
- ReadOnly;
187
- // Only specified principals can modify minter's state.
188
- RestrictedTo : vec principal;
189
- // Only specified principals can convert BTC to ckBTC.
190
- DepositsRestrictedTo : vec principal;
191
- // Anyone can interact with the minter.
192
- GeneralAvailability;
193
- };
194
-
195
- // The initialization parameters of the minter canister.
196
- type InitArgs = record {
197
- // The minter will interact with this Bitcoin network.
198
- btc_network : BtcNetwork;
199
-
200
- // The principal of the ledger that handles ckBTC transfers.
201
- // The default account of the ckBTC minter must be configured as
202
- // the minting account of the ledger.
203
- ledger_id : principal;
204
-
205
- // The name of the ECDSA key to use.
206
- // E.g., "dfx_test_key" on the local replica.
207
- ecdsa_key_name : text;
208
-
209
- // The minimal amount of ckBTC that can be converted to BTC.
210
- retrieve_btc_min_amount : nat64;
211
-
212
- /// Maximum time in nanoseconds that a transaction should spend in the queue
213
- /// before being sent.
214
- max_time_in_queue_nanos : nat64;
215
-
216
- /// The minimum number of confirmations required for the minter to
217
- /// accept a Bitcoin transaction.
218
- min_confirmations : opt nat32;
219
-
220
- /// The minter's operation mode.
221
- mode : Mode;
222
-
223
- /// The fee paid per Bitcoin check.
224
- check_fee : opt nat64;
225
-
226
- /// The fee paid per check by the KYT canister (deprecated, use check_fee instead).
227
- kyt_fee : opt nat64;
228
-
229
- /// The canister id of the Bitcoin checker canister.
230
- btc_checker_principal: opt principal;
231
-
232
- /// The canister id of the KYT canister (deprecated, use btc_checker_principal instead).
233
- kyt_principal: opt principal;
234
-
235
- /// The expiration duration (in seconds) for cached entries in the get_utxos cache.
236
- get_utxos_cache_expiration_seconds: opt nat64;
237
- };
238
-
239
- // The upgrade parameters of the minter canister.
240
- type UpgradeArgs = record {
241
- // The minimal amount of ckBTC that the minter converts to BTC.
242
- retrieve_btc_min_amount : opt nat64;
243
-
244
- /// Maximum time in nanoseconds that a transaction should spend in the queue
245
- /// before being sent.
246
- max_time_in_queue_nanos : opt nat64;
247
-
248
- /// The minimum number of confirmations required for the minter to
249
- /// accept a Bitcoin transaction.
250
- min_confirmations : opt nat32;
251
-
252
- /// If set, overrides the current minter's operation mode.
253
- mode : opt Mode;
254
-
255
- /// The fee per Bitcoin check.
256
- check_fee : opt nat64;
257
-
258
- /// The fee paid per check by the KYT canister (deprecated, use check_fee instead).
259
- kyt_fee : opt nat64;
260
-
261
- /// The principal of the Bitcoin checker canister.
262
- btc_checker_principal : opt principal;
263
-
264
- /// The canister id of the KYT canister (deprecated, use btc_checker_principal instead).
265
- kyt_principal: opt principal;
266
-
267
- /// The expiration duration (in seconds) for cached entries in the get_utxos cache.
268
- get_utxos_cache_expiration_seconds: opt nat64;
269
- };
270
-
271
- type RetrieveBtcStatus = variant {
272
- // The minter does not have any information on the specified
273
- // retrieval request. It can be that nobody submitted the
274
- // request or the minter pruned the relevant information from the
275
- // history to save space.
276
- Unknown;
277
-
278
- // The minter did not send a Bitcoin transaction for this request yet.
279
- Pending;
280
-
281
- // The minter is obtaining all required ECDSA signatures on the
282
- // Bitcoin transaction for this request.
283
- Signing;
284
-
285
- // The minter signed the transaction and is waiting for a reply
286
- // from the Bitcoin canister.
287
- Sending : record { txid : blob };
288
-
289
- // The minter sent a transaction for the retrieve request.
290
- // The payload contains the identifier of the transaction on the Bitcoin network.
291
- Submitted : record { txid : blob };
292
-
293
- // The amount was too low to cover the transaction fees.
294
- AmountTooLow;
295
-
296
- // The minter received enough confirmations for the Bitcoin
297
- // transaction for this request. The payload contains the
298
- // identifier of the transaction on the Bitcoin network.
299
- Confirmed : record { txid : blob };
300
- };
301
-
302
- type ReimbursementRequest = record {
303
- account : Account;
304
- amount : nat64;
305
- reason : ReimbursementReason;
306
- };
307
-
308
- type ReimbursedDeposit = record {
309
- account : Account;
310
- mint_block_index : nat64;
311
- amount : nat64;
312
- reason : ReimbursementReason;
313
- };
314
-
315
- type RetrieveBtcStatusV2 = variant {
316
- // The minter does not have any information on the specified
317
- // retrieval request. It can be that nobody submitted the
318
- // request or the minter pruned the relevant information from the
319
- // history to save space.
320
- Unknown;
321
- // The minter did not send a Bitcoin transaction for this request yet.
322
- Pending;
323
- // The minter is obtaining all required ECDSA signatures on the
324
- // Bitcoin transaction for this request.
325
- Signing;
326
- // The minter signed the transaction and is waiting for a reply
327
- // from the Bitcoin canister.
328
- Sending : record { txid : blob };
329
- // The minter sent a transaction for the retrieve request.
330
- // The payload contains the identifier of the transaction on the Bitcoin network.
331
- Submitted : record { txid : blob };
332
- // The amount was too low to cover the transaction fees.
333
- AmountTooLow;
334
- // The minter received enough confirmations for the Bitcoin
335
- // transaction for this request. The payload contains the
336
- // identifier of the transaction on the Bitcoin network.
337
- Confirmed : record { txid : blob };
338
- /// The retrieve Bitcoin request has been reimbursed.
339
- Reimbursed : ReimbursedDeposit;
340
- /// The minter will try to reimburse this transaction.
341
- WillReimburse : ReimbursementRequest;
342
- };
343
-
344
- type Utxo = record {
345
- outpoint : record { txid : vec nat8; vout : nat32 };
346
- value : nat64;
347
- height : nat32;
348
- };
349
-
350
- type BitcoinAddress = variant {
351
- p2wpkh_v0 : blob;
352
- p2wsh_v0 : blob;
353
- p2tr_v1 : blob;
354
- p2pkh : blob;
355
- p2sh : blob;
356
- };
357
-
358
- type MinterInfo = record {
359
- min_confirmations : nat32;
360
- // This amount is based on the `retrieve_btc_min_amount` setting during canister
361
- // initialization or upgrades, but may vary according to current network fees.
362
- retrieve_btc_min_amount : nat64;
363
- // The same as `check_fee`, but the old name is kept here to be backward compatible.
364
- kyt_fee : nat64;
365
- };
366
-
367
- type ReimbursementReason = variant {
368
- CallFailed;
369
- TaintedDestination : record {
370
- kyt_fee : nat64;
371
- kyt_provider: principal;
372
- };
373
- };
374
-
375
- type ReplacedReason = variant {
376
- to_retry;
377
- to_cancel : record {
378
- reason : WithdrawalReimbursementReason;
379
- };
380
- };
381
-
382
- type WithdrawalReimbursementReason = variant {
383
- invalid_transaction : InvalidTransactionError;
384
- };
385
-
386
- type InvalidTransactionError = variant {
387
- too_many_inputs : record {
388
- num_inputs : nat64;
389
- max_num_inputs : nat64;
390
- };
391
- };
392
-
393
- type SuspendedReason = variant {
394
- // The minter ignored this UTXO because UTXO's value is too small to pay
395
- // the check fees.
396
- ValueTooSmall;
397
- // The Bitcoin checker considered this UTXO to be tainted.
398
- Quarantined;
399
- };
400
-
401
- type WithdrawalFee = record {
402
- minter_fee : nat64;
403
- bitcoin_fee : nat64;
404
- };
405
-
406
- type Event = record {
407
- timestamp : opt nat64;
408
- payload : EventType;
409
- };
410
-
411
- type EventType = variant {
412
- init : InitArgs;
413
- upgrade : UpgradeArgs;
414
- received_utxos : record { to_account : Account; mint_txid : opt nat64; utxos : vec Utxo };
415
- accepted_retrieve_btc_request : record {
416
- amount : nat64;
417
- address : BitcoinAddress;
418
- block_index : nat64;
419
- received_at : nat64;
420
- kyt_provider : opt principal;
421
- reimbursement_account : opt Account;
422
- };
423
- distributed_kyt_fee : record {
424
- kyt_provider : principal;
425
- amount : nat64;
426
- block_index: nat64;
427
- };
428
- removed_retrieve_btc_request : record { block_index : nat64 };
429
- sent_transaction : record {
430
- requests : vec nat64;
431
- txid : blob;
432
- utxos : vec Utxo;
433
- change_output : opt record { vout : nat32; value : nat64 };
434
- submitted_at : nat64;
435
- fee: opt nat64;
436
- withdrawal_fee : opt WithdrawalFee;
437
- };
438
- replaced_transaction : record {
439
- new_txid : blob;
440
- old_txid : blob;
441
- change_output : record { vout : nat32; value : nat64 };
442
- submitted_at : nat64;
443
- fee : nat64;
444
- withdrawal_fee : opt WithdrawalFee;
445
- reason : opt ReplacedReason;
446
- new_utxos : opt vec Utxo;
447
- };
448
- confirmed_transaction : record { txid : blob };
449
- checked_utxo : record {
450
- utxo : Utxo;
451
- uuid : text;
452
- clean : bool;
453
- kyt_provider : opt principal;
454
- };
455
- checked_utxo_v2 : record {
456
- utxo : Utxo;
457
- account : Account;
458
- };
459
- checked_utxo_mint_unknown : record {
460
- utxo : Utxo;
461
- account : Account;
462
- };
463
- ignored_utxo : record { utxo: Utxo; };
464
- suspended_utxo : record { utxo: Utxo; account: Account; reason: SuspendedReason };
465
- retrieve_btc_kyt_failed : record {
466
- address : text;
467
- amount : nat64;
468
- owner : principal;
469
- kyt_provider : principal;
470
- uuid : text;
471
- block_index : nat64;
472
- };
473
- schedule_deposit_reimbursement : record {
474
- account : Account;
475
- burn_block_index : nat64;
476
- amount : nat64;
477
- reason : ReimbursementReason;
478
- };
479
- reimbursed_failed_deposit : record { burn_block_index : nat64; mint_block_index : nat64 };
480
- schedule_withdrawal_reimbursement : record {
481
- account : Account;
482
- burn_block_index : nat64;
483
- amount : nat64;
484
- reason : WithdrawalReimbursementReason;
485
- };
486
- quarantined_withdrawal_reimbursement : record {
487
- burn_block_index : nat64;
488
- };
489
- reimbursed_withdrawal : record {
490
- burn_block_index : nat64;
491
- mint_block_index : nat64;
492
- };
493
- };
494
-
495
- type MinterArg = variant {
496
- Init : InitArgs;
497
- Upgrade : opt UpgradeArgs;
498
- };
499
-
500
- service : (minter_arg : MinterArg) -> {
501
- // Section "Convert BTC to ckBTC" {{{
502
-
503
- // Returns the Bitcoin address to which the owner should send BTC
504
- // before converting the amount to ckBTC using the [update_balance]
505
- // endpoint.
506
- //
507
- // If the owner is not set, it defaults to the caller's principal.
508
- // The resolved owner must be a non-anonymous principal.
509
- get_btc_address : (record { owner: opt principal; subaccount : opt blob }) -> (text);
510
-
511
- // Returns UTXOs of the given account known by the minter (with no
512
- // guarantee in the ordering of the returned values).
513
- //
514
- // If the owner is not set, it defaults to the caller's principal.
515
- get_known_utxos: (record { owner: opt principal; subaccount : opt blob }) -> (vec Utxo) query;
516
-
517
- // Mints ckBTC for newly deposited UTXOs.
518
- //
519
- // If the owner is not set, it defaults to the caller's principal.
520
- //
521
- // # Preconditions
522
- //
523
- // * The owner deposited some BTC to the address that the
524
- // [get_btc_address] endpoint returns.
525
- update_balance : (record { owner: opt principal; subaccount : opt blob }) -> (variant { Ok : vec UtxoStatus; Err : UpdateBalanceError });
526
-
527
- // }}} Section "Convert BTC to ckBTC"
528
-
529
- // Section "Convert ckBTC to BTC" {{{
530
-
531
- /// Returns an estimate of the user's fee (in Satoshi) for a
532
- /// retrieve_btc request based on the current status of the Bitcoin network.
533
- estimate_withdrawal_fee : (record { amount : opt nat64 }) -> (record { bitcoin_fee : nat64; minter_fee : nat64 }) query;
534
-
535
- /// Returns the fee that the minter will charge for a bitcoin deposit.
536
- get_deposit_fee: () -> (nat64) query;
537
-
538
- // Returns the account to which the caller should deposit ckBTC
539
- // before withdrawing BTC using the [retrieve_btc] endpoint.
540
- get_withdrawal_account : () -> (Account);
541
-
542
-
543
- // Submits a request to convert ckBTC to BTC.
544
- //
545
- // # Note
546
- //
547
- // The BTC retrieval process is slow. Instead of
548
- // synchronously waiting for a BTC transaction to settle, this
549
- // method returns a request ([block_index]) that the caller can use
550
- // to query the request status.
551
- //
552
- // # Preconditions
553
- //
554
- // * The caller deposited the requested amount in ckBTC to the account
555
- // that the [get_withdrawal_account] endpoint returns.
556
- retrieve_btc : (RetrieveBtcArgs) -> (variant { Ok : RetrieveBtcOk; Err : RetrieveBtcError });
557
-
558
- // Submits a request to convert ckBTC to BTC.
559
- //
560
- // # Note
561
- //
562
- // The BTC retrieval process is slow. Instead of
563
- // synchronously waiting for a BTC transaction to settle, this
564
- // method returns a request ([block_index]) that the caller can use
565
- // to query the request status.
566
- //
567
- // # Preconditions
568
- //
569
- // * The caller allowed the minter's principal to spend its funds
570
- // using [icrc2_approve] on the ckBTC ledger.
571
- retrieve_btc_with_approval : (RetrieveBtcWithApprovalArgs) -> (variant { Ok : RetrieveBtcOk; Err : RetrieveBtcWithApprovalError });
572
-
573
- /// [deprecated] Returns the status of a withdrawal request.
574
- /// You should use retrieve_btc_status_v2 to retrieve the status of your withdrawal request.
575
- retrieve_btc_status : (record { block_index : nat64 }) -> (RetrieveBtcStatus) query;
576
-
577
- /// Returns the status of a withdrawal request request using the RetrieveBtcStatusV2 type.
578
- retrieve_btc_status_v2 : (record { block_index : nat64 }) -> (RetrieveBtcStatusV2) query;
579
-
580
- // Returns the withdrawal statues by account.
581
- //
582
- // # Note
583
- // The _v2_ part indicates that you get a response in line with the retrieve_btc_status_v2 endpoint,
584
- // i.e., you get a vector of RetrieveBtcStatusV2 and not RetrieveBtcStatus.
585
- //
586
- retrieve_btc_status_v2_by_account : (opt Account) -> (vec record { block_index: nat64; status_v2: opt RetrieveBtcStatusV2; }) query;
587
-
588
- // }}} Section "Convert ckBTC to BTC"
589
-
590
- // Section "Minter Information" {{{
591
- // Returns internal minter parameters.
592
- get_minter_info : () -> (MinterInfo) query;
593
-
594
- get_canister_status : () -> (CanisterStatusResponse);
595
- // }}}
596
-
597
- // Section "Event log" {{{
598
-
599
- // The minter keeps track of all state modifications in an internal event log.
600
- //
601
- // This method returns a list of events in the specified range.
602
- // The minter can return fewer events than requested. The result is
603
- // an empty vector if the start position is greater than the total
604
- // number of events.
605
- //
606
- // NOTE: this method exists for debugging purposes.
607
- // The ckBTC minter authors do not guarantee backward compatibility for this method.
608
- get_events : (record { start: nat64; length : nat64 }) -> (vec Event) query;
609
- // }}} Section "Event log"
610
- }
@@ -1,2 +0,0 @@
1
- import type { IDL } from "@icp-sdk/core/candid";
2
- export const idlFactory: IDL.InterfaceFactory;