@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.
- package/README.md +1 -1
- package/dist/{types/bitcoin.canister.d.ts → bitcoin.canister.d.ts} +1 -1
- package/dist/candid/bitcoin.certified.idl.d.ts +1 -1
- package/dist/candid/bitcoin.certified.idl.js +130 -128
- package/dist/candid/bitcoin.d.ts +11 -3
- package/dist/candid/bitcoin.idl.d.ts +1 -1
- package/dist/candid/bitcoin.idl.js +134 -128
- package/dist/candid/minter.certified.idl.d.ts +1 -1
- package/dist/candid/minter.certified.idl.js +363 -355
- package/dist/candid/minter.d.ts +11 -3
- package/dist/candid/minter.idl.d.ts +1 -1
- package/dist/candid/minter.idl.js +363 -355
- package/dist/{types/errors → errors}/minter.errors.d.ts +1 -1
- package/dist/{types/index.d.ts → index.d.ts} +2 -2
- package/dist/index.js +7 -1
- package/dist/index.js.map +7 -0
- package/dist/index.mjs +9 -0
- package/dist/index.mjs.map +7 -0
- package/dist/{types/minter.canister.d.ts → minter.canister.d.ts} +1 -1
- package/dist/types/{types/bitcoin.params.d.ts → bitcoin.params.d.ts} +1 -1
- package/dist/types/{types/canister.options.d.ts → canister.options.d.ts} +1 -1
- package/dist/types/{types/minter.params.d.ts → minter.params.d.ts} +2 -2
- package/dist/types/{types/minter.responses.d.ts → minter.responses.d.ts} +1 -1
- package/package.json +22 -11
- package/dist/cjs/index.cjs.js +0 -7
- package/dist/cjs/index.cjs.js.map +0 -7
- package/dist/esm/bitcoin.canister.js +0 -2
- package/dist/esm/bitcoin.canister.js.map +0 -7
- package/dist/esm/chunk-7W3XZWUY.js +0 -2
- package/dist/esm/chunk-7W3XZWUY.js.map +0 -7
- package/dist/esm/chunk-ABDCS67G.js +0 -2
- package/dist/esm/chunk-ABDCS67G.js.map +0 -7
- package/dist/esm/chunk-FW4363Y4.js +0 -2
- package/dist/esm/chunk-FW4363Y4.js.map +0 -7
- package/dist/esm/index.js +0 -7
- package/dist/esm/index.js.map +0 -7
- package/dist/esm/minter.canister.js +0 -2
- package/dist/esm/minter.canister.js.map +0 -7
- package/dist/index.cjs.js +0 -1
- /package/dist/{types/enums → enums}/btc.enums.d.ts +0 -0
- /package/dist/{types/errors → errors}/btc.errors.d.ts +0 -0
- /package/dist/types/{types/btc.d.ts → btc.d.ts} +0 -0
- /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 @
|
|
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 "
|
|
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 "@
|
|
1
|
+
import type { IDL } from "@icp-sdk/core/candid";
|
|
2
2
|
export const idlFactory: IDL.InterfaceFactory;
|
|
@@ -1,175 +1,177 @@
|
|
|
1
|
-
/*
|
|
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({
|
|
10
|
+
const flag = IDL.Variant({ disabled: IDL.Null, enabled: IDL.Null });
|
|
4
11
|
const fees = IDL.Record({
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
|
|
20
|
-
|
|
21
|
-
|
|
26
|
+
mainnet: IDL.Null,
|
|
27
|
+
regtest: IDL.Null,
|
|
28
|
+
testnet: IDL.Null,
|
|
22
29
|
});
|
|
23
30
|
const init_config = IDL.Record({
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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
|
-
|
|
51
|
-
|
|
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
|
-
|
|
61
|
+
network: network,
|
|
55
62
|
});
|
|
56
63
|
const millisatoshi_per_byte = IDL.Nat64;
|
|
57
64
|
const get_utxos_request = IDL.Record({
|
|
58
|
-
|
|
59
|
-
|
|
65
|
+
network: network,
|
|
66
|
+
filter: IDL.Opt(
|
|
60
67
|
IDL.Variant({
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
})
|
|
68
|
+
page: IDL.Vec(IDL.Nat8),
|
|
69
|
+
min_confirmations: IDL.Nat32,
|
|
70
|
+
}),
|
|
64
71
|
),
|
|
65
|
-
|
|
72
|
+
address: address,
|
|
66
73
|
});
|
|
67
74
|
const block_hash = IDL.Vec(IDL.Nat8);
|
|
68
75
|
const outpoint = IDL.Record({
|
|
69
|
-
|
|
70
|
-
|
|
76
|
+
txid: IDL.Vec(IDL.Nat8),
|
|
77
|
+
vout: IDL.Nat32,
|
|
71
78
|
});
|
|
72
79
|
const utxo = IDL.Record({
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
80
|
+
height: block_height,
|
|
81
|
+
value: satoshi,
|
|
82
|
+
outpoint: outpoint,
|
|
76
83
|
});
|
|
77
84
|
const get_utxos_response = IDL.Record({
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
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
|
-
|
|
85
|
-
|
|
91
|
+
transaction: IDL.Vec(IDL.Nat8),
|
|
92
|
+
network: network,
|
|
86
93
|
});
|
|
87
94
|
const config = IDL.Record({
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
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
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
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
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
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({
|
|
143
|
+
const flag = IDL.Variant({ disabled: IDL.Null, enabled: IDL.Null });
|
|
143
144
|
const fees = IDL.Record({
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
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
|
-
|
|
159
|
-
|
|
160
|
-
|
|
159
|
+
mainnet: IDL.Null,
|
|
160
|
+
regtest: IDL.Null,
|
|
161
|
+
testnet: IDL.Null,
|
|
161
162
|
});
|
|
162
163
|
const init_config = IDL.Record({
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
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
|
};
|
package/dist/candid/bitcoin.d.ts
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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 "@
|
|
1
|
+
import type { IDL } from "@icp-sdk/core/candid";
|
|
2
2
|
export const idlFactory: IDL.InterfaceFactory;
|