@dfinity/ckbtc 4.0.6 → 5.0.0-next-2025-10-20

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 (43) hide show
  1. package/README.md +1 -1
  2. package/dist/{types/bitcoin.canister.d.ts → bitcoin.canister.d.ts} +1 -1
  3. package/dist/candid/bitcoin.certified.idl.d.ts +1 -1
  4. package/dist/candid/bitcoin.certified.idl.js +130 -128
  5. package/dist/candid/bitcoin.d.ts +11 -3
  6. package/dist/candid/bitcoin.idl.d.ts +1 -1
  7. package/dist/candid/bitcoin.idl.js +134 -128
  8. package/dist/candid/minter.certified.idl.d.ts +1 -1
  9. package/dist/candid/minter.certified.idl.js +363 -355
  10. package/dist/candid/minter.d.ts +11 -3
  11. package/dist/candid/minter.idl.d.ts +1 -1
  12. package/dist/candid/minter.idl.js +363 -355
  13. package/dist/{types/errors → errors}/minter.errors.d.ts +1 -1
  14. package/dist/{types/index.d.ts → index.d.ts} +2 -2
  15. package/dist/index.js +7 -1
  16. package/dist/index.js.map +7 -0
  17. package/dist/index.mjs +9 -0
  18. package/dist/index.mjs.map +7 -0
  19. package/dist/{types/minter.canister.d.ts → minter.canister.d.ts} +1 -1
  20. package/dist/types/{types/bitcoin.params.d.ts → bitcoin.params.d.ts} +1 -1
  21. package/dist/types/{types/canister.options.d.ts → canister.options.d.ts} +1 -1
  22. package/dist/types/{types/minter.params.d.ts → minter.params.d.ts} +2 -2
  23. package/dist/types/{types/minter.responses.d.ts → minter.responses.d.ts} +1 -1
  24. package/package.json +22 -11
  25. package/dist/cjs/index.cjs.js +0 -7
  26. package/dist/cjs/index.cjs.js.map +0 -7
  27. package/dist/esm/bitcoin.canister.js +0 -2
  28. package/dist/esm/bitcoin.canister.js.map +0 -7
  29. package/dist/esm/chunk-7W3XZWUY.js +0 -2
  30. package/dist/esm/chunk-7W3XZWUY.js.map +0 -7
  31. package/dist/esm/chunk-ABDCS67G.js +0 -2
  32. package/dist/esm/chunk-ABDCS67G.js.map +0 -7
  33. package/dist/esm/chunk-FW4363Y4.js +0 -2
  34. package/dist/esm/chunk-FW4363Y4.js.map +0 -7
  35. package/dist/esm/index.js +0 -7
  36. package/dist/esm/index.js.map +0 -7
  37. package/dist/esm/minter.canister.js +0 -2
  38. package/dist/esm/minter.canister.js.map +0 -7
  39. package/dist/index.cjs.js +0 -1
  40. /package/dist/{types/enums → enums}/btc.enums.d.ts +0 -0
  41. /package/dist/{types/errors → errors}/btc.errors.d.ts +0 -0
  42. /package/dist/types/{types/btc.d.ts → btc.d.ts} +0 -0
  43. /package/dist/{types/utils → utils}/btc.utils.d.ts +0 -0
package/README.md CHANGED
@@ -21,7 +21,7 @@ npm i @dfinity/ckbtc
21
21
  The bundle needs peer dependencies, be sure that following resources are available in your project as well.
22
22
 
23
23
  ```bash
24
- npm i @dfinity/agent @dfinity/candid @dfinity/principal @dfinity/utils
24
+ npm i @icp-sdk/core @dfinity/utils
25
25
  ```
26
26
 
27
27
  ## Usage
@@ -1,5 +1,5 @@
1
1
  import { Canister } from "@dfinity/utils";
2
- import type { _SERVICE as BitcoinService, get_utxos_response, satoshi } from "../candid/bitcoin";
2
+ import type { _SERVICE as BitcoinService, get_utxos_response, satoshi } from "./candid/bitcoin";
3
3
  import { type GetBalanceParams, type GetUtxosParams } from "./types/bitcoin.params";
4
4
  import type { CkBTCCanisterOptions } from "./types/canister.options";
5
5
  export declare class BitcoinCanister extends Canister<BitcoinService> {
@@ -1,2 +1,2 @@
1
- import type { IDL } from "@dfinity/candid";
1
+ import type { IDL } from "@icp-sdk/core/candid";
2
2
  export const idlFactory: IDL.InterfaceFactory;
@@ -1,175 +1,177 @@
1
- /* Do not edit. Compiled with ./scripts/compile-idl-js from packages/ckbtc/candid/bitcoin.did */
1
+ /* eslint-disable */
2
+
3
+ // @ts-nocheck
4
+
5
+ // This file was automatically generated by @icp-sdk/bindgen@0.2.0-patch-typed-arrays.
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
+
2
9
  export const idlFactory = ({ IDL }) => {
3
- const flag = IDL.Variant({ 'disabled' : IDL.Null, 'enabled' : IDL.Null });
10
+ const flag = IDL.Variant({ disabled: IDL.Null, enabled: IDL.Null });
4
11
  const fees = IDL.Record({
5
- 'get_current_fee_percentiles' : IDL.Nat,
6
- 'get_utxos_maximum' : IDL.Nat,
7
- 'get_block_headers_cycles_per_ten_instructions' : IDL.Nat,
8
- 'get_current_fee_percentiles_maximum' : IDL.Nat,
9
- 'send_transaction_per_byte' : IDL.Nat,
10
- 'get_balance' : IDL.Nat,
11
- 'get_utxos_cycles_per_ten_instructions' : IDL.Nat,
12
- 'get_block_headers_base' : IDL.Nat,
13
- 'get_utxos_base' : IDL.Nat,
14
- 'get_balance_maximum' : IDL.Nat,
15
- 'send_transaction_base' : IDL.Nat,
16
- 'get_block_headers_maximum' : IDL.Nat,
12
+ get_current_fee_percentiles: IDL.Nat,
13
+ get_utxos_maximum: IDL.Nat,
14
+ get_block_headers_cycles_per_ten_instructions: IDL.Nat,
15
+ get_current_fee_percentiles_maximum: IDL.Nat,
16
+ send_transaction_per_byte: IDL.Nat,
17
+ get_balance: IDL.Nat,
18
+ get_utxos_cycles_per_ten_instructions: IDL.Nat,
19
+ get_block_headers_base: IDL.Nat,
20
+ get_utxos_base: IDL.Nat,
21
+ get_balance_maximum: IDL.Nat,
22
+ send_transaction_base: IDL.Nat,
23
+ get_block_headers_maximum: IDL.Nat,
17
24
  });
18
25
  const network = IDL.Variant({
19
- 'mainnet' : IDL.Null,
20
- 'regtest' : IDL.Null,
21
- 'testnet' : IDL.Null,
26
+ mainnet: IDL.Null,
27
+ regtest: IDL.Null,
28
+ testnet: IDL.Null,
22
29
  });
23
30
  const init_config = IDL.Record({
24
- 'api_access' : IDL.Opt(flag),
25
- 'lazily_evaluate_fee_percentiles' : IDL.Opt(flag),
26
- 'blocks_source' : IDL.Opt(IDL.Principal),
27
- 'fees' : IDL.Opt(fees),
28
- 'watchdog_canister' : IDL.Opt(IDL.Opt(IDL.Principal)),
29
- 'network' : IDL.Opt(network),
30
- 'stability_threshold' : IDL.Opt(IDL.Nat),
31
- 'syncing' : IDL.Opt(flag),
32
- 'burn_cycles' : IDL.Opt(flag),
33
- 'disable_api_if_not_fully_synced' : IDL.Opt(flag),
31
+ api_access: IDL.Opt(flag),
32
+ lazily_evaluate_fee_percentiles: IDL.Opt(flag),
33
+ blocks_source: IDL.Opt(IDL.Principal),
34
+ fees: IDL.Opt(fees),
35
+ watchdog_canister: IDL.Opt(IDL.Opt(IDL.Principal)),
36
+ network: IDL.Opt(network),
37
+ stability_threshold: IDL.Opt(IDL.Nat),
38
+ syncing: IDL.Opt(flag),
39
+ burn_cycles: IDL.Opt(flag),
40
+ disable_api_if_not_fully_synced: IDL.Opt(flag),
34
41
  });
35
42
  const address = IDL.Text;
36
43
  const get_balance_request = IDL.Record({
37
- 'network' : network,
38
- 'address' : address,
39
- 'min_confirmations' : IDL.Opt(IDL.Nat32),
44
+ network: network,
45
+ address: address,
46
+ min_confirmations: IDL.Opt(IDL.Nat32),
40
47
  });
41
48
  const satoshi = IDL.Nat64;
42
49
  const block_height = IDL.Nat32;
43
50
  const get_block_headers_request = IDL.Record({
44
- 'start_height' : block_height,
45
- 'end_height' : IDL.Opt(block_height),
46
- 'network' : network,
51
+ start_height: block_height,
52
+ end_height: IDL.Opt(block_height),
53
+ network: network,
47
54
  });
48
55
  const block_header = IDL.Vec(IDL.Nat8);
49
56
  const get_block_headers_response = IDL.Record({
50
- 'tip_height' : block_height,
51
- 'block_headers' : IDL.Vec(block_header),
57
+ tip_height: block_height,
58
+ block_headers: IDL.Vec(block_header),
52
59
  });
53
60
  const get_current_fee_percentiles_request = IDL.Record({
54
- 'network' : network,
61
+ network: network,
55
62
  });
56
63
  const millisatoshi_per_byte = IDL.Nat64;
57
64
  const get_utxos_request = IDL.Record({
58
- 'network' : network,
59
- 'filter' : IDL.Opt(
65
+ network: network,
66
+ filter: IDL.Opt(
60
67
  IDL.Variant({
61
- 'page' : IDL.Vec(IDL.Nat8),
62
- 'min_confirmations' : IDL.Nat32,
63
- })
68
+ page: IDL.Vec(IDL.Nat8),
69
+ min_confirmations: IDL.Nat32,
70
+ }),
64
71
  ),
65
- 'address' : address,
72
+ address: address,
66
73
  });
67
74
  const block_hash = IDL.Vec(IDL.Nat8);
68
75
  const outpoint = IDL.Record({
69
- 'txid' : IDL.Vec(IDL.Nat8),
70
- 'vout' : IDL.Nat32,
76
+ txid: IDL.Vec(IDL.Nat8),
77
+ vout: IDL.Nat32,
71
78
  });
72
79
  const utxo = IDL.Record({
73
- 'height' : block_height,
74
- 'value' : satoshi,
75
- 'outpoint' : outpoint,
80
+ height: block_height,
81
+ value: satoshi,
82
+ outpoint: outpoint,
76
83
  });
77
84
  const get_utxos_response = IDL.Record({
78
- 'next_page' : IDL.Opt(IDL.Vec(IDL.Nat8)),
79
- 'tip_height' : block_height,
80
- 'tip_block_hash' : block_hash,
81
- 'utxos' : IDL.Vec(utxo),
85
+ next_page: IDL.Opt(IDL.Vec(IDL.Nat8)),
86
+ tip_height: block_height,
87
+ tip_block_hash: block_hash,
88
+ utxos: IDL.Vec(utxo),
82
89
  });
83
90
  const send_transaction_request = IDL.Record({
84
- 'transaction' : IDL.Vec(IDL.Nat8),
85
- 'network' : network,
91
+ transaction: IDL.Vec(IDL.Nat8),
92
+ network: network,
86
93
  });
87
94
  const config = IDL.Record({
88
- 'api_access' : flag,
89
- 'lazily_evaluate_fee_percentiles' : flag,
90
- 'blocks_source' : IDL.Principal,
91
- 'fees' : fees,
92
- 'watchdog_canister' : IDL.Opt(IDL.Principal),
93
- 'network' : network,
94
- 'stability_threshold' : IDL.Nat,
95
- 'syncing' : flag,
96
- 'burn_cycles' : flag,
97
- 'disable_api_if_not_fully_synced' : flag,
95
+ api_access: flag,
96
+ lazily_evaluate_fee_percentiles: flag,
97
+ blocks_source: IDL.Principal,
98
+ fees: fees,
99
+ watchdog_canister: IDL.Opt(IDL.Principal),
100
+ network: network,
101
+ stability_threshold: IDL.Nat,
102
+ syncing: flag,
103
+ burn_cycles: flag,
104
+ disable_api_if_not_fully_synced: flag,
98
105
  });
99
106
  const set_config_request = IDL.Record({
100
- 'api_access' : IDL.Opt(flag),
101
- 'lazily_evaluate_fee_percentiles' : IDL.Opt(flag),
102
- 'fees' : IDL.Opt(fees),
103
- 'watchdog_canister' : IDL.Opt(IDL.Opt(IDL.Principal)),
104
- 'stability_threshold' : IDL.Opt(IDL.Nat),
105
- 'syncing' : IDL.Opt(flag),
106
- 'burn_cycles' : IDL.Opt(flag),
107
- 'disable_api_if_not_fully_synced' : IDL.Opt(flag),
108
- });
107
+ api_access: IDL.Opt(flag),
108
+ lazily_evaluate_fee_percentiles: IDL.Opt(flag),
109
+ fees: IDL.Opt(fees),
110
+ watchdog_canister: IDL.Opt(IDL.Opt(IDL.Principal)),
111
+ stability_threshold: IDL.Opt(IDL.Nat),
112
+ syncing: IDL.Opt(flag),
113
+ burn_cycles: IDL.Opt(flag),
114
+ disable_api_if_not_fully_synced: IDL.Opt(flag),
115
+ });
116
+
109
117
  return IDL.Service({
110
- 'bitcoin_get_balance' : IDL.Func([get_balance_request], [satoshi], []),
111
- 'bitcoin_get_balance_query' : IDL.Func(
112
- [get_balance_request],
113
- [satoshi],
114
- [],
115
- ),
116
- 'bitcoin_get_block_headers' : IDL.Func(
117
- [get_block_headers_request],
118
- [get_block_headers_response],
119
- [],
120
- ),
121
- 'bitcoin_get_current_fee_percentiles' : IDL.Func(
122
- [get_current_fee_percentiles_request],
123
- [IDL.Vec(millisatoshi_per_byte)],
124
- [],
125
- ),
126
- 'bitcoin_get_utxos' : IDL.Func(
127
- [get_utxos_request],
128
- [get_utxos_response],
129
- [],
130
- ),
131
- 'bitcoin_get_utxos_query' : IDL.Func(
132
- [get_utxos_request],
133
- [get_utxos_response],
134
- [],
135
- ),
136
- 'bitcoin_send_transaction' : IDL.Func([send_transaction_request], [], []),
137
- 'get_config' : IDL.Func([], [config], []),
138
- 'set_config' : IDL.Func([set_config_request], [], []),
118
+ bitcoin_get_balance: IDL.Func([get_balance_request], [satoshi], []),
119
+ bitcoin_get_balance_query: IDL.Func([get_balance_request], [satoshi], []),
120
+ bitcoin_get_block_headers: IDL.Func(
121
+ [get_block_headers_request],
122
+ [get_block_headers_response],
123
+ [],
124
+ ),
125
+ bitcoin_get_current_fee_percentiles: IDL.Func(
126
+ [get_current_fee_percentiles_request],
127
+ [IDL.Vec(millisatoshi_per_byte)],
128
+ [],
129
+ ),
130
+ bitcoin_get_utxos: IDL.Func([get_utxos_request], [get_utxos_response], []),
131
+ bitcoin_get_utxos_query: IDL.Func(
132
+ [get_utxos_request],
133
+ [get_utxos_response],
134
+ [],
135
+ ),
136
+ bitcoin_send_transaction: IDL.Func([send_transaction_request], [], []),
137
+ get_config: IDL.Func([], [config], []),
138
+ set_config: IDL.Func([set_config_request], [], []),
139
139
  });
140
140
  };
141
+
141
142
  export const init = ({ IDL }) => {
142
- const flag = IDL.Variant({ 'disabled' : IDL.Null, 'enabled' : IDL.Null });
143
+ const flag = IDL.Variant({ disabled: IDL.Null, enabled: IDL.Null });
143
144
  const fees = IDL.Record({
144
- 'get_current_fee_percentiles' : IDL.Nat,
145
- 'get_utxos_maximum' : IDL.Nat,
146
- 'get_block_headers_cycles_per_ten_instructions' : IDL.Nat,
147
- 'get_current_fee_percentiles_maximum' : IDL.Nat,
148
- 'send_transaction_per_byte' : IDL.Nat,
149
- 'get_balance' : IDL.Nat,
150
- 'get_utxos_cycles_per_ten_instructions' : IDL.Nat,
151
- 'get_block_headers_base' : IDL.Nat,
152
- 'get_utxos_base' : IDL.Nat,
153
- 'get_balance_maximum' : IDL.Nat,
154
- 'send_transaction_base' : IDL.Nat,
155
- 'get_block_headers_maximum' : IDL.Nat,
145
+ get_current_fee_percentiles: IDL.Nat,
146
+ get_utxos_maximum: IDL.Nat,
147
+ get_block_headers_cycles_per_ten_instructions: IDL.Nat,
148
+ get_current_fee_percentiles_maximum: IDL.Nat,
149
+ send_transaction_per_byte: IDL.Nat,
150
+ get_balance: IDL.Nat,
151
+ get_utxos_cycles_per_ten_instructions: IDL.Nat,
152
+ get_block_headers_base: IDL.Nat,
153
+ get_utxos_base: IDL.Nat,
154
+ get_balance_maximum: IDL.Nat,
155
+ send_transaction_base: IDL.Nat,
156
+ get_block_headers_maximum: IDL.Nat,
156
157
  });
157
158
  const network = IDL.Variant({
158
- 'mainnet' : IDL.Null,
159
- 'regtest' : IDL.Null,
160
- 'testnet' : IDL.Null,
159
+ mainnet: IDL.Null,
160
+ regtest: IDL.Null,
161
+ testnet: IDL.Null,
161
162
  });
162
163
  const init_config = IDL.Record({
163
- 'api_access' : IDL.Opt(flag),
164
- 'lazily_evaluate_fee_percentiles' : IDL.Opt(flag),
165
- 'blocks_source' : IDL.Opt(IDL.Principal),
166
- 'fees' : IDL.Opt(fees),
167
- 'watchdog_canister' : IDL.Opt(IDL.Opt(IDL.Principal)),
168
- 'network' : IDL.Opt(network),
169
- 'stability_threshold' : IDL.Opt(IDL.Nat),
170
- 'syncing' : IDL.Opt(flag),
171
- 'burn_cycles' : IDL.Opt(flag),
172
- 'disable_api_if_not_fully_synced' : IDL.Opt(flag),
173
- });
164
+ api_access: IDL.Opt(flag),
165
+ lazily_evaluate_fee_percentiles: IDL.Opt(flag),
166
+ blocks_source: IDL.Opt(IDL.Principal),
167
+ fees: IDL.Opt(fees),
168
+ watchdog_canister: IDL.Opt(IDL.Opt(IDL.Principal)),
169
+ network: IDL.Opt(network),
170
+ stability_threshold: IDL.Opt(IDL.Nat),
171
+ syncing: IDL.Opt(flag),
172
+ burn_cycles: IDL.Opt(flag),
173
+ disable_api_if_not_fully_synced: IDL.Opt(flag),
174
+ });
175
+
174
176
  return [init_config];
175
177
  };
@@ -1,6 +1,14 @@
1
- import type { ActorMethod } from "@dfinity/agent";
2
- import type { IDL } from "@dfinity/candid";
3
- import type { Principal } from "@dfinity/principal";
1
+ /* eslint-disable */
2
+
3
+ // @ts-nocheck
4
+
5
+ // This file was automatically generated by @icp-sdk/bindgen@0.2.0-patch-typed-arrays.
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";
4
12
 
5
13
  export type address = string;
6
14
  export type block_hash = Uint8Array | number[];
@@ -1,2 +1,2 @@
1
- import type { IDL } from "@dfinity/candid";
1
+ import type { IDL } from "@icp-sdk/core/candid";
2
2
  export const idlFactory: IDL.InterfaceFactory;