@dfinity/ckbtc 6.0.1 → 7.0.0-beta-2025-12-11
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 +3 -3
- package/dist/index.d.ts +25 -13
- package/dist/index.js +1 -6
- package/dist/index.js.map +4 -4
- package/dist/index.mjs +1 -6
- package/dist/index.mjs.map +4 -4
- package/package.json +4 -10
- package/dist/bitcoin.canister.d.ts +0 -35
- package/dist/candid/bitcoin.certified.idl.d.ts +0 -2
- package/dist/candid/bitcoin.certified.idl.js +0 -177
- package/dist/candid/bitcoin.d.ts +0 -128
- package/dist/candid/bitcoin.did +0 -149
- package/dist/candid/bitcoin.idl.d.ts +0 -2
- package/dist/candid/bitcoin.idl.js +0 -181
- package/dist/candid/minter.certified.idl.d.ts +0 -2
- package/dist/candid/minter.certified.idl.js +0 -474
- package/dist/candid/minter.d.ts +0 -843
- package/dist/candid/minter.did +0 -602
- package/dist/candid/minter.idl.d.ts +0 -2
- package/dist/candid/minter.idl.js +0 -474
- package/dist/enums/btc.enums.d.ts +0 -12
- package/dist/errors/btc.errors.d.ts +0 -18
- package/dist/errors/minter.errors.d.ts +0 -30
- package/dist/minter.canister.d.ts +0 -120
- package/dist/types/bitcoin.params.d.ts +0 -17
- package/dist/types/btc.d.ts +0 -9
- package/dist/types/canister.options.d.ts +0 -5
- package/dist/types/minter.params.d.ts +0 -36
- package/dist/types/minter.responses.d.ts +0 -25
- package/dist/utils/btc.utils.d.ts +0 -13
|
@@ -1,177 +0,0 @@
|
|
|
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
|
-
export const idlFactory = ({ IDL }) => {
|
|
10
|
-
const flag = IDL.Variant({ disabled: IDL.Null, enabled: IDL.Null });
|
|
11
|
-
const fees = IDL.Record({
|
|
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,
|
|
24
|
-
});
|
|
25
|
-
const network = IDL.Variant({
|
|
26
|
-
mainnet: IDL.Null,
|
|
27
|
-
regtest: IDL.Null,
|
|
28
|
-
testnet: IDL.Null,
|
|
29
|
-
});
|
|
30
|
-
const init_config = IDL.Record({
|
|
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),
|
|
41
|
-
});
|
|
42
|
-
const address = IDL.Text;
|
|
43
|
-
const get_balance_request = IDL.Record({
|
|
44
|
-
network: network,
|
|
45
|
-
address: address,
|
|
46
|
-
min_confirmations: IDL.Opt(IDL.Nat32),
|
|
47
|
-
});
|
|
48
|
-
const satoshi = IDL.Nat64;
|
|
49
|
-
const block_height = IDL.Nat32;
|
|
50
|
-
const get_block_headers_request = IDL.Record({
|
|
51
|
-
start_height: block_height,
|
|
52
|
-
end_height: IDL.Opt(block_height),
|
|
53
|
-
network: network,
|
|
54
|
-
});
|
|
55
|
-
const block_header = IDL.Vec(IDL.Nat8);
|
|
56
|
-
const get_block_headers_response = IDL.Record({
|
|
57
|
-
tip_height: block_height,
|
|
58
|
-
block_headers: IDL.Vec(block_header),
|
|
59
|
-
});
|
|
60
|
-
const get_current_fee_percentiles_request = IDL.Record({
|
|
61
|
-
network: network,
|
|
62
|
-
});
|
|
63
|
-
const millisatoshi_per_byte = IDL.Nat64;
|
|
64
|
-
const get_utxos_request = IDL.Record({
|
|
65
|
-
network: network,
|
|
66
|
-
filter: IDL.Opt(
|
|
67
|
-
IDL.Variant({
|
|
68
|
-
page: IDL.Vec(IDL.Nat8),
|
|
69
|
-
min_confirmations: IDL.Nat32,
|
|
70
|
-
}),
|
|
71
|
-
),
|
|
72
|
-
address: address,
|
|
73
|
-
});
|
|
74
|
-
const block_hash = IDL.Vec(IDL.Nat8);
|
|
75
|
-
const outpoint = IDL.Record({
|
|
76
|
-
txid: IDL.Vec(IDL.Nat8),
|
|
77
|
-
vout: IDL.Nat32,
|
|
78
|
-
});
|
|
79
|
-
const utxo = IDL.Record({
|
|
80
|
-
height: block_height,
|
|
81
|
-
value: satoshi,
|
|
82
|
-
outpoint: outpoint,
|
|
83
|
-
});
|
|
84
|
-
const get_utxos_response = IDL.Record({
|
|
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),
|
|
89
|
-
});
|
|
90
|
-
const send_transaction_request = IDL.Record({
|
|
91
|
-
transaction: IDL.Vec(IDL.Nat8),
|
|
92
|
-
network: network,
|
|
93
|
-
});
|
|
94
|
-
const config = IDL.Record({
|
|
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,
|
|
105
|
-
});
|
|
106
|
-
const set_config_request = IDL.Record({
|
|
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
|
-
|
|
117
|
-
return IDL.Service({
|
|
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
|
-
});
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
export const init = ({ IDL }) => {
|
|
143
|
-
const flag = IDL.Variant({ disabled: IDL.Null, enabled: IDL.Null });
|
|
144
|
-
const fees = IDL.Record({
|
|
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,
|
|
157
|
-
});
|
|
158
|
-
const network = IDL.Variant({
|
|
159
|
-
mainnet: IDL.Null,
|
|
160
|
-
regtest: IDL.Null,
|
|
161
|
-
testnet: IDL.Null,
|
|
162
|
-
});
|
|
163
|
-
const init_config = IDL.Record({
|
|
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
|
-
|
|
176
|
-
return [init_config];
|
|
177
|
-
};
|
package/dist/candid/bitcoin.d.ts
DELETED
|
@@ -1,128 +0,0 @@
|
|
|
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 address = string;
|
|
14
|
-
export type block_hash = Uint8Array;
|
|
15
|
-
export type block_header = Uint8Array;
|
|
16
|
-
export type block_height = number;
|
|
17
|
-
export interface config {
|
|
18
|
-
api_access: flag;
|
|
19
|
-
lazily_evaluate_fee_percentiles: flag;
|
|
20
|
-
blocks_source: Principal;
|
|
21
|
-
fees: fees;
|
|
22
|
-
watchdog_canister: [] | [Principal];
|
|
23
|
-
network: network;
|
|
24
|
-
stability_threshold: bigint;
|
|
25
|
-
syncing: flag;
|
|
26
|
-
burn_cycles: flag;
|
|
27
|
-
disable_api_if_not_fully_synced: flag;
|
|
28
|
-
}
|
|
29
|
-
export interface fees {
|
|
30
|
-
get_current_fee_percentiles: bigint;
|
|
31
|
-
get_utxos_maximum: bigint;
|
|
32
|
-
get_block_headers_cycles_per_ten_instructions: bigint;
|
|
33
|
-
get_current_fee_percentiles_maximum: bigint;
|
|
34
|
-
send_transaction_per_byte: bigint;
|
|
35
|
-
get_balance: bigint;
|
|
36
|
-
get_utxos_cycles_per_ten_instructions: bigint;
|
|
37
|
-
get_block_headers_base: bigint;
|
|
38
|
-
get_utxos_base: bigint;
|
|
39
|
-
get_balance_maximum: bigint;
|
|
40
|
-
send_transaction_base: bigint;
|
|
41
|
-
get_block_headers_maximum: bigint;
|
|
42
|
-
}
|
|
43
|
-
export type flag = { disabled: null } | { enabled: null };
|
|
44
|
-
export interface get_balance_request {
|
|
45
|
-
network: network;
|
|
46
|
-
address: address;
|
|
47
|
-
min_confirmations: [] | [number];
|
|
48
|
-
}
|
|
49
|
-
export interface get_block_headers_request {
|
|
50
|
-
start_height: block_height;
|
|
51
|
-
end_height: [] | [block_height];
|
|
52
|
-
network: network;
|
|
53
|
-
}
|
|
54
|
-
export interface get_block_headers_response {
|
|
55
|
-
tip_height: block_height;
|
|
56
|
-
block_headers: Array<block_header>;
|
|
57
|
-
}
|
|
58
|
-
export interface get_current_fee_percentiles_request {
|
|
59
|
-
network: network;
|
|
60
|
-
}
|
|
61
|
-
export interface get_utxos_request {
|
|
62
|
-
network: network;
|
|
63
|
-
filter: [] | [{ page: Uint8Array } | { min_confirmations: number }];
|
|
64
|
-
address: address;
|
|
65
|
-
}
|
|
66
|
-
export interface get_utxos_response {
|
|
67
|
-
next_page: [] | [Uint8Array];
|
|
68
|
-
tip_height: block_height;
|
|
69
|
-
tip_block_hash: block_hash;
|
|
70
|
-
utxos: Array<utxo>;
|
|
71
|
-
}
|
|
72
|
-
export interface init_config {
|
|
73
|
-
api_access: [] | [flag];
|
|
74
|
-
lazily_evaluate_fee_percentiles: [] | [flag];
|
|
75
|
-
blocks_source: [] | [Principal];
|
|
76
|
-
fees: [] | [fees];
|
|
77
|
-
watchdog_canister: [] | [[] | [Principal]];
|
|
78
|
-
network: [] | [network];
|
|
79
|
-
stability_threshold: [] | [bigint];
|
|
80
|
-
syncing: [] | [flag];
|
|
81
|
-
burn_cycles: [] | [flag];
|
|
82
|
-
disable_api_if_not_fully_synced: [] | [flag];
|
|
83
|
-
}
|
|
84
|
-
export type millisatoshi_per_byte = bigint;
|
|
85
|
-
export type network = { mainnet: null } | { regtest: null } | { testnet: null };
|
|
86
|
-
export interface outpoint {
|
|
87
|
-
txid: Uint8Array;
|
|
88
|
-
vout: number;
|
|
89
|
-
}
|
|
90
|
-
export type satoshi = bigint;
|
|
91
|
-
export interface send_transaction_request {
|
|
92
|
-
transaction: Uint8Array;
|
|
93
|
-
network: network;
|
|
94
|
-
}
|
|
95
|
-
export interface set_config_request {
|
|
96
|
-
api_access: [] | [flag];
|
|
97
|
-
lazily_evaluate_fee_percentiles: [] | [flag];
|
|
98
|
-
fees: [] | [fees];
|
|
99
|
-
watchdog_canister: [] | [[] | [Principal]];
|
|
100
|
-
stability_threshold: [] | [bigint];
|
|
101
|
-
syncing: [] | [flag];
|
|
102
|
-
burn_cycles: [] | [flag];
|
|
103
|
-
disable_api_if_not_fully_synced: [] | [flag];
|
|
104
|
-
}
|
|
105
|
-
export interface utxo {
|
|
106
|
-
height: block_height;
|
|
107
|
-
value: satoshi;
|
|
108
|
-
outpoint: outpoint;
|
|
109
|
-
}
|
|
110
|
-
export interface _SERVICE {
|
|
111
|
-
bitcoin_get_balance: ActorMethod<[get_balance_request], satoshi>;
|
|
112
|
-
bitcoin_get_balance_query: ActorMethod<[get_balance_request], satoshi>;
|
|
113
|
-
bitcoin_get_block_headers: ActorMethod<
|
|
114
|
-
[get_block_headers_request],
|
|
115
|
-
get_block_headers_response
|
|
116
|
-
>;
|
|
117
|
-
bitcoin_get_current_fee_percentiles: ActorMethod<
|
|
118
|
-
[get_current_fee_percentiles_request],
|
|
119
|
-
BigUint64Array
|
|
120
|
-
>;
|
|
121
|
-
bitcoin_get_utxos: ActorMethod<[get_utxos_request], get_utxos_response>;
|
|
122
|
-
bitcoin_get_utxos_query: ActorMethod<[get_utxos_request], get_utxos_response>;
|
|
123
|
-
bitcoin_send_transaction: ActorMethod<[send_transaction_request], undefined>;
|
|
124
|
-
get_config: ActorMethod<[], config>;
|
|
125
|
-
set_config: ActorMethod<[set_config_request], undefined>;
|
|
126
|
-
}
|
|
127
|
-
export declare const idlFactory: IDL.InterfaceFactory;
|
|
128
|
-
export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[];
|
package/dist/candid/bitcoin.did
DELETED
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
// Generated from dfinity/bitcoin-canister commit 47c5d1f14eff39282245ea6aec6e9f821571b024 for file 'canister/candid.did'
|
|
2
|
-
|
|
3
|
-
type network = variant {
|
|
4
|
-
mainnet;
|
|
5
|
-
testnet; // Bitcoin testnet4.
|
|
6
|
-
regtest;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
type satoshi = nat64;
|
|
10
|
-
|
|
11
|
-
type address = text;
|
|
12
|
-
|
|
13
|
-
type block_hash = blob;
|
|
14
|
-
|
|
15
|
-
type block_header = blob;
|
|
16
|
-
|
|
17
|
-
type block_height = nat32;
|
|
18
|
-
|
|
19
|
-
type outpoint = record {
|
|
20
|
-
txid : blob;
|
|
21
|
-
vout : nat32;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
type utxo = record {
|
|
25
|
-
outpoint : outpoint;
|
|
26
|
-
value : satoshi;
|
|
27
|
-
height : block_height;
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
type flag = variant {
|
|
31
|
-
enabled;
|
|
32
|
-
disabled;
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
type init_config = record {
|
|
36
|
-
stability_threshold : opt nat;
|
|
37
|
-
network : opt network;
|
|
38
|
-
blocks_source : opt principal;
|
|
39
|
-
syncing : opt flag;
|
|
40
|
-
fees : opt fees;
|
|
41
|
-
api_access : opt flag;
|
|
42
|
-
disable_api_if_not_fully_synced : opt flag;
|
|
43
|
-
watchdog_canister : opt opt principal;
|
|
44
|
-
burn_cycles : opt flag;
|
|
45
|
-
lazily_evaluate_fee_percentiles : opt flag;
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
type config = record {
|
|
49
|
-
stability_threshold : nat;
|
|
50
|
-
network : network;
|
|
51
|
-
blocks_source : principal;
|
|
52
|
-
syncing : flag;
|
|
53
|
-
fees : fees;
|
|
54
|
-
api_access : flag;
|
|
55
|
-
disable_api_if_not_fully_synced : flag;
|
|
56
|
-
watchdog_canister : opt principal;
|
|
57
|
-
burn_cycles : flag;
|
|
58
|
-
lazily_evaluate_fee_percentiles : flag;
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
type fees = record {
|
|
62
|
-
get_utxos_base : nat;
|
|
63
|
-
get_utxos_cycles_per_ten_instructions : nat;
|
|
64
|
-
get_utxos_maximum : nat;
|
|
65
|
-
get_balance : nat;
|
|
66
|
-
get_balance_maximum : nat;
|
|
67
|
-
get_current_fee_percentiles : nat;
|
|
68
|
-
get_current_fee_percentiles_maximum : nat;
|
|
69
|
-
send_transaction_base : nat;
|
|
70
|
-
send_transaction_per_byte : nat;
|
|
71
|
-
get_block_headers_base : nat;
|
|
72
|
-
get_block_headers_cycles_per_ten_instructions : nat;
|
|
73
|
-
get_block_headers_maximum : nat;
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
type get_balance_request = record {
|
|
77
|
-
network : network;
|
|
78
|
-
address : address;
|
|
79
|
-
min_confirmations : opt nat32;
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
type get_utxos_request = record {
|
|
83
|
-
network : network;
|
|
84
|
-
address : address;
|
|
85
|
-
filter : opt variant {
|
|
86
|
-
min_confirmations : nat32;
|
|
87
|
-
page : blob;
|
|
88
|
-
};
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
type get_utxos_response = record {
|
|
92
|
-
utxos : vec utxo;
|
|
93
|
-
tip_block_hash : block_hash;
|
|
94
|
-
tip_height : block_height;
|
|
95
|
-
next_page : opt blob;
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
type get_current_fee_percentiles_request = record {
|
|
99
|
-
network : network;
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
type send_transaction_request = record {
|
|
103
|
-
network : network;
|
|
104
|
-
transaction : blob;
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
type millisatoshi_per_byte = nat64;
|
|
108
|
-
|
|
109
|
-
type set_config_request = record {
|
|
110
|
-
stability_threshold : opt nat;
|
|
111
|
-
syncing : opt flag;
|
|
112
|
-
fees : opt fees;
|
|
113
|
-
api_access : opt flag;
|
|
114
|
-
disable_api_if_not_fully_synced : opt flag;
|
|
115
|
-
watchdog_canister : opt opt principal;
|
|
116
|
-
burn_cycles : opt flag;
|
|
117
|
-
lazily_evaluate_fee_percentiles : opt flag;
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
type get_block_headers_request = record {
|
|
121
|
-
start_height : block_height;
|
|
122
|
-
end_height : opt block_height;
|
|
123
|
-
network : network;
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
type get_block_headers_response = record {
|
|
127
|
-
tip_height : block_height;
|
|
128
|
-
block_headers : vec block_header;
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
service bitcoin : (init_config) -> {
|
|
132
|
-
bitcoin_get_balance : (get_balance_request) -> (satoshi);
|
|
133
|
-
|
|
134
|
-
bitcoin_get_balance_query : (get_balance_request) -> (satoshi) query;
|
|
135
|
-
|
|
136
|
-
bitcoin_get_utxos : (get_utxos_request) -> (get_utxos_response);
|
|
137
|
-
|
|
138
|
-
bitcoin_get_utxos_query : (get_utxos_request) -> (get_utxos_response) query;
|
|
139
|
-
|
|
140
|
-
bitcoin_get_current_fee_percentiles : (get_current_fee_percentiles_request) -> (vec millisatoshi_per_byte);
|
|
141
|
-
|
|
142
|
-
bitcoin_get_block_headers : (get_block_headers_request) -> (get_block_headers_response);
|
|
143
|
-
|
|
144
|
-
bitcoin_send_transaction : (send_transaction_request) -> ();
|
|
145
|
-
|
|
146
|
-
get_config : () -> (config) query;
|
|
147
|
-
|
|
148
|
-
set_config : (set_config_request) -> ();
|
|
149
|
-
};
|
|
@@ -1,181 +0,0 @@
|
|
|
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
|
-
export const idlFactory = ({ IDL }) => {
|
|
10
|
-
const flag = IDL.Variant({ disabled: IDL.Null, enabled: IDL.Null });
|
|
11
|
-
const fees = IDL.Record({
|
|
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,
|
|
24
|
-
});
|
|
25
|
-
const network = IDL.Variant({
|
|
26
|
-
mainnet: IDL.Null,
|
|
27
|
-
regtest: IDL.Null,
|
|
28
|
-
testnet: IDL.Null,
|
|
29
|
-
});
|
|
30
|
-
const init_config = IDL.Record({
|
|
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),
|
|
41
|
-
});
|
|
42
|
-
const address = IDL.Text;
|
|
43
|
-
const get_balance_request = IDL.Record({
|
|
44
|
-
network: network,
|
|
45
|
-
address: address,
|
|
46
|
-
min_confirmations: IDL.Opt(IDL.Nat32),
|
|
47
|
-
});
|
|
48
|
-
const satoshi = IDL.Nat64;
|
|
49
|
-
const block_height = IDL.Nat32;
|
|
50
|
-
const get_block_headers_request = IDL.Record({
|
|
51
|
-
start_height: block_height,
|
|
52
|
-
end_height: IDL.Opt(block_height),
|
|
53
|
-
network: network,
|
|
54
|
-
});
|
|
55
|
-
const block_header = IDL.Vec(IDL.Nat8);
|
|
56
|
-
const get_block_headers_response = IDL.Record({
|
|
57
|
-
tip_height: block_height,
|
|
58
|
-
block_headers: IDL.Vec(block_header),
|
|
59
|
-
});
|
|
60
|
-
const get_current_fee_percentiles_request = IDL.Record({
|
|
61
|
-
network: network,
|
|
62
|
-
});
|
|
63
|
-
const millisatoshi_per_byte = IDL.Nat64;
|
|
64
|
-
const get_utxos_request = IDL.Record({
|
|
65
|
-
network: network,
|
|
66
|
-
filter: IDL.Opt(
|
|
67
|
-
IDL.Variant({
|
|
68
|
-
page: IDL.Vec(IDL.Nat8),
|
|
69
|
-
min_confirmations: IDL.Nat32,
|
|
70
|
-
}),
|
|
71
|
-
),
|
|
72
|
-
address: address,
|
|
73
|
-
});
|
|
74
|
-
const block_hash = IDL.Vec(IDL.Nat8);
|
|
75
|
-
const outpoint = IDL.Record({
|
|
76
|
-
txid: IDL.Vec(IDL.Nat8),
|
|
77
|
-
vout: IDL.Nat32,
|
|
78
|
-
});
|
|
79
|
-
const utxo = IDL.Record({
|
|
80
|
-
height: block_height,
|
|
81
|
-
value: satoshi,
|
|
82
|
-
outpoint: outpoint,
|
|
83
|
-
});
|
|
84
|
-
const get_utxos_response = IDL.Record({
|
|
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),
|
|
89
|
-
});
|
|
90
|
-
const send_transaction_request = IDL.Record({
|
|
91
|
-
transaction: IDL.Vec(IDL.Nat8),
|
|
92
|
-
network: network,
|
|
93
|
-
});
|
|
94
|
-
const config = IDL.Record({
|
|
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,
|
|
105
|
-
});
|
|
106
|
-
const set_config_request = IDL.Record({
|
|
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
|
-
|
|
117
|
-
return IDL.Service({
|
|
118
|
-
bitcoin_get_balance: IDL.Func([get_balance_request], [satoshi], []),
|
|
119
|
-
bitcoin_get_balance_query: IDL.Func(
|
|
120
|
-
[get_balance_request],
|
|
121
|
-
[satoshi],
|
|
122
|
-
["query"],
|
|
123
|
-
),
|
|
124
|
-
bitcoin_get_block_headers: IDL.Func(
|
|
125
|
-
[get_block_headers_request],
|
|
126
|
-
[get_block_headers_response],
|
|
127
|
-
[],
|
|
128
|
-
),
|
|
129
|
-
bitcoin_get_current_fee_percentiles: IDL.Func(
|
|
130
|
-
[get_current_fee_percentiles_request],
|
|
131
|
-
[IDL.Vec(millisatoshi_per_byte)],
|
|
132
|
-
[],
|
|
133
|
-
),
|
|
134
|
-
bitcoin_get_utxos: IDL.Func([get_utxos_request], [get_utxos_response], []),
|
|
135
|
-
bitcoin_get_utxos_query: IDL.Func(
|
|
136
|
-
[get_utxos_request],
|
|
137
|
-
[get_utxos_response],
|
|
138
|
-
["query"],
|
|
139
|
-
),
|
|
140
|
-
bitcoin_send_transaction: IDL.Func([send_transaction_request], [], []),
|
|
141
|
-
get_config: IDL.Func([], [config], ["query"]),
|
|
142
|
-
set_config: IDL.Func([set_config_request], [], []),
|
|
143
|
-
});
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
export const init = ({ IDL }) => {
|
|
147
|
-
const flag = IDL.Variant({ disabled: IDL.Null, enabled: IDL.Null });
|
|
148
|
-
const fees = IDL.Record({
|
|
149
|
-
get_current_fee_percentiles: IDL.Nat,
|
|
150
|
-
get_utxos_maximum: IDL.Nat,
|
|
151
|
-
get_block_headers_cycles_per_ten_instructions: IDL.Nat,
|
|
152
|
-
get_current_fee_percentiles_maximum: IDL.Nat,
|
|
153
|
-
send_transaction_per_byte: IDL.Nat,
|
|
154
|
-
get_balance: IDL.Nat,
|
|
155
|
-
get_utxos_cycles_per_ten_instructions: IDL.Nat,
|
|
156
|
-
get_block_headers_base: IDL.Nat,
|
|
157
|
-
get_utxos_base: IDL.Nat,
|
|
158
|
-
get_balance_maximum: IDL.Nat,
|
|
159
|
-
send_transaction_base: IDL.Nat,
|
|
160
|
-
get_block_headers_maximum: IDL.Nat,
|
|
161
|
-
});
|
|
162
|
-
const network = IDL.Variant({
|
|
163
|
-
mainnet: IDL.Null,
|
|
164
|
-
regtest: IDL.Null,
|
|
165
|
-
testnet: IDL.Null,
|
|
166
|
-
});
|
|
167
|
-
const init_config = IDL.Record({
|
|
168
|
-
api_access: IDL.Opt(flag),
|
|
169
|
-
lazily_evaluate_fee_percentiles: IDL.Opt(flag),
|
|
170
|
-
blocks_source: IDL.Opt(IDL.Principal),
|
|
171
|
-
fees: IDL.Opt(fees),
|
|
172
|
-
watchdog_canister: IDL.Opt(IDL.Opt(IDL.Principal)),
|
|
173
|
-
network: IDL.Opt(network),
|
|
174
|
-
stability_threshold: IDL.Opt(IDL.Nat),
|
|
175
|
-
syncing: IDL.Opt(flag),
|
|
176
|
-
burn_cycles: IDL.Opt(flag),
|
|
177
|
-
disable_api_if_not_fully_synced: IDL.Opt(flag),
|
|
178
|
-
});
|
|
179
|
-
|
|
180
|
-
return [init_config];
|
|
181
|
-
};
|