@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.
- package/canisters/_canister.d.ts +17 -0
- package/canisters/_constants.d.ts +3 -0
- package/canisters/ckbtc/index.d.ts +1 -0
- package/canisters/ckbtc/index.js +2 -0
- package/canisters/cketh/index.d.ts +1 -0
- package/canisters/cketh/index.js +2 -0
- package/canisters/cketh/index.js.map +7 -0
- package/canisters/cmc/cmc.canister.d.ts +28 -0
- package/canisters/cmc/index.d.ts +2 -0
- package/canisters/cmc/index.js +2 -0
- package/canisters/cmc/index.js.map +7 -0
- package/canisters/declarations/_idl.d.ts +16 -0
- package/canisters/declarations/_types.d.ts +16 -0
- package/canisters/declarations/ckbtc/bitcoin.did.d.ts +134 -0
- package/canisters/declarations/ckbtc/bitcoin.did.idl.d.ts +40 -0
- package/canisters/declarations/ckbtc/minter.did.d.ts +831 -0
- package/canisters/declarations/ckbtc/minter.did.idl.d.ts +61 -0
- package/canisters/declarations/cketh/minter.did.d.ts +893 -0
- package/canisters/declarations/cketh/minter.did.idl.d.ts +58 -0
- package/canisters/declarations/cketh/orchestrator.did.d.ts +302 -0
- package/canisters/declarations/cketh/orchestrator.did.idl.d.ts +34 -0
- package/canisters/declarations/cmc/cmc.did.d.ts +344 -0
- package/canisters/declarations/cmc/cmc.did.idl.d.ts +53 -0
- package/canisters/declarations/ic-management/ic-management.did.d.ts +583 -0
- package/canisters/declarations/ic-management/ic-management.did.idl.d.ts +147 -0
- package/canisters/declarations/index.d.ts +2 -0
- package/canisters/declarations/ledger-icp/index.did.d.ts +119 -0
- package/canisters/declarations/ledger-icp/index.did.idl.d.ts +35 -0
- package/canisters/declarations/ledger-icp/ledger.did.d.ts +606 -0
- package/canisters/declarations/ledger-icp/ledger.did.idl.d.ts +106 -0
- package/canisters/declarations/ledger-icrc/icrc_index-ng.did.d.ts +148 -0
- package/canisters/declarations/ledger-icrc/icrc_index-ng.did.idl.d.ts +44 -0
- package/canisters/declarations/ledger-icrc/icrc_index.did.d.ts +102 -0
- package/canisters/declarations/ledger-icrc/icrc_index.did.idl.d.ts +28 -0
- package/canisters/declarations/ledger-icrc/icrc_ledger.did.d.ts +579 -0
- package/canisters/declarations/ledger-icrc/icrc_ledger.did.idl.d.ts +100 -0
- package/canisters/declarations/ledger-icrc/icrc_nft-ledger.did.d.ts +81 -0
- package/canisters/declarations/ledger-icrc/icrc_nft-ledger.did.idl.d.ts +39 -0
- package/canisters/declarations/nns/genesis_token.did.d.ts +49 -0
- package/canisters/declarations/nns/genesis_token.did.idl.d.ts +24 -0
- package/canisters/declarations/nns/governance.did.d.ts +1254 -0
- package/canisters/declarations/nns/governance.did.idl.d.ts +217 -0
- package/canisters/declarations/nns/governance_test.did.d.ts +1258 -0
- package/canisters/declarations/nns/governance_test.did.idl.d.ts +218 -0
- package/canisters/declarations/nns/sns_wasm.did.d.ts +286 -0
- package/canisters/declarations/nns/sns_wasm.did.idl.d.ts +80 -0
- package/canisters/declarations/sns/sns_governance.did.d.ts +834 -0
- package/canisters/declarations/sns/sns_governance.did.idl.d.ts +189 -0
- package/canisters/declarations/sns/sns_governance_test.did.d.ts +861 -0
- package/canisters/declarations/sns/sns_governance_test.did.idl.d.ts +199 -0
- package/canisters/declarations/sns/sns_root.did.d.ts +204 -0
- package/canisters/declarations/sns/sns_root.did.idl.d.ts +53 -0
- package/canisters/declarations/sns/sns_swap.did.d.ts +411 -0
- package/canisters/declarations/sns/sns_swap.did.idl.d.ts +108 -0
- package/canisters/ic-management/index.d.ts +1 -0
- package/canisters/ic-management/index.js +2 -0
- package/canisters/ic-management/index.js.map +7 -0
- package/canisters/index.d.ts +1 -0
- package/canisters/index.js +2 -0
- package/canisters/index.js.map +7 -0
- package/canisters/ledger/icp/index.d.ts +2 -0
- package/canisters/ledger/icp/index.js +2 -0
- package/canisters/ledger/icp/index.js.map +7 -0
- package/canisters/ledger/icp/ledger.canister.d.ts +24 -0
- package/canisters/ledger/icrc/index.d.ts +3 -0
- package/canisters/ledger/icrc/index.js +2 -0
- package/canisters/ledger/icrc/index.js.map +7 -0
- package/canisters/ledger/icrc/ledger.canister.d.ts +45 -0
- package/canisters/ledger/icrc/schemas.d.ts +11 -0
- package/canisters/nns/index.d.ts +1 -0
- package/canisters/nns/index.js +2 -0
- package/canisters/nns/index.js.map +7 -0
- package/canisters/schemas.d.ts +11 -0
- package/canisters/sns/index.d.ts +1 -0
- package/canisters/sns/index.js +2 -0
- package/canisters/sns/index.js.map +7 -0
- package/chunk-4C666HHU.js +2 -0
- package/chunk-4C666HHU.js.map +7 -0
- package/chunk-5NZMOUKF.js +2 -0
- package/chunk-5NZMOUKF.js.map +7 -0
- package/chunk-BXZ5PSUW.js +2 -0
- package/chunk-BXZ5PSUW.js.map +7 -0
- package/chunk-EMQQE34V.js +2 -0
- package/chunk-EMQQE34V.js.map +7 -0
- package/chunk-HANEPD6T.js +2 -0
- package/chunk-HANEPD6T.js.map +7 -0
- package/chunk-TZVF5LQY.js +2 -0
- package/chunk-TZVF5LQY.js.map +7 -0
- package/ic-cdk.js +1 -1
- package/ic-cdk.js.map +4 -4
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/package.json +39 -2
- package/sdk.js +1 -1
- package/sdk.js.map +1 -1
- package/src/canisters/declarations/ckbtc/bitcoin.did.d.ts +134 -0
- package/src/canisters/declarations/ckbtc/bitcoin.did.idl.js +302 -0
- package/src/canisters/declarations/ckbtc/minter.did.d.ts +831 -0
- package/src/canisters/declarations/ckbtc/minter.did.idl.js +893 -0
- package/src/canisters/declarations/cketh/minter.did.d.ts +893 -0
- package/src/canisters/declarations/cketh/minter.did.idl.js +878 -0
- package/src/canisters/declarations/cketh/orchestrator.did.d.ts +302 -0
- package/src/canisters/declarations/cketh/orchestrator.did.idl.js +343 -0
- package/src/canisters/declarations/cmc/cmc.did.d.ts +344 -0
- package/src/canisters/declarations/cmc/cmc.did.idl.js +338 -0
- package/src/canisters/declarations/ic-management/ic-management.did.d.ts +583 -0
- package/src/canisters/declarations/ic-management/ic-management.did.idl.js +1150 -0
- package/src/canisters/declarations/ledger-icp/index.did.d.ts +119 -0
- package/src/canisters/declarations/ledger-icp/index.did.idl.js +225 -0
- package/src/canisters/declarations/ledger-icp/ledger.did.d.ts +606 -0
- package/src/canisters/declarations/ledger-icp/ledger.did.idl.js +813 -0
- package/src/canisters/declarations/ledger-icrc/icrc_index-ng.did.d.ts +148 -0
- package/src/canisters/declarations/ledger-icrc/icrc_index-ng.did.idl.js +274 -0
- package/src/canisters/declarations/ledger-icrc/icrc_index.did.d.ts +102 -0
- package/src/canisters/declarations/ledger-icrc/icrc_index.did.idl.js +171 -0
- package/src/canisters/declarations/ledger-icrc/icrc_ledger.did.d.ts +579 -0
- package/src/canisters/declarations/ledger-icrc/icrc_ledger.did.idl.js +923 -0
- package/src/canisters/declarations/ledger-icrc/icrc_nft-ledger.did.d.ts +81 -0
- package/src/canisters/declarations/ledger-icrc/icrc_nft-ledger.did.idl.js +163 -0
- package/src/canisters/declarations/nns/genesis_token.did.d.ts +49 -0
- package/src/canisters/declarations/nns/genesis_token.did.idl.js +84 -0
- package/src/canisters/declarations/nns/governance.did.d.ts +1254 -0
- package/src/canisters/declarations/nns/governance.did.idl.js +2756 -0
- package/src/canisters/declarations/nns/governance_test.did.d.ts +1258 -0
- package/src/canisters/declarations/nns/governance_test.did.idl.js +2758 -0
- package/src/canisters/declarations/nns/sns_wasm.did.d.ts +286 -0
- package/src/canisters/declarations/nns/sns_wasm.did.idl.js +589 -0
- package/src/canisters/declarations/sns/sns_governance.did.d.ts +834 -0
- package/src/canisters/declarations/sns/sns_governance.did.idl.js +2235 -0
- package/src/canisters/declarations/sns/sns_governance_test.did.d.ts +861 -0
- package/src/canisters/declarations/sns/sns_governance_test.did.idl.js +2283 -0
- package/src/canisters/declarations/sns/sns_root.did.d.ts +204 -0
- package/src/canisters/declarations/sns/sns_root.did.idl.js +433 -0
- package/src/canisters/declarations/sns/sns_swap.did.d.ts +411 -0
- package/src/canisters/declarations/sns/sns_swap.did.idl.js +858 -0
- package/global.d.js +0 -1
- /package/{global.d.js.map → canisters/ckbtc/index.js.map} +0 -0
|
@@ -0,0 +1,302 @@
|
|
|
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 {IDL} from '@icp-sdk/core/candid';
|
|
10
|
+
|
|
11
|
+
export const flag = IDL.Variant({
|
|
12
|
+
disabled: IDL.Null,
|
|
13
|
+
enabled: IDL.Null
|
|
14
|
+
});
|
|
15
|
+
export const fees = IDL.Record({
|
|
16
|
+
get_current_fee_percentiles: IDL.Nat,
|
|
17
|
+
get_utxos_maximum: IDL.Nat,
|
|
18
|
+
get_block_headers_cycles_per_ten_instructions: IDL.Nat,
|
|
19
|
+
get_current_fee_percentiles_maximum: IDL.Nat,
|
|
20
|
+
send_transaction_per_byte: IDL.Nat,
|
|
21
|
+
get_balance: IDL.Nat,
|
|
22
|
+
get_utxos_cycles_per_ten_instructions: IDL.Nat,
|
|
23
|
+
get_block_headers_base: IDL.Nat,
|
|
24
|
+
get_utxos_base: IDL.Nat,
|
|
25
|
+
get_balance_maximum: IDL.Nat,
|
|
26
|
+
send_transaction_base: IDL.Nat,
|
|
27
|
+
get_block_headers_maximum: IDL.Nat
|
|
28
|
+
});
|
|
29
|
+
export const network = IDL.Variant({
|
|
30
|
+
mainnet: IDL.Null,
|
|
31
|
+
regtest: IDL.Null,
|
|
32
|
+
testnet: IDL.Null
|
|
33
|
+
});
|
|
34
|
+
export const init_config = IDL.Record({
|
|
35
|
+
api_access: IDL.Opt(flag),
|
|
36
|
+
lazily_evaluate_fee_percentiles: IDL.Opt(flag),
|
|
37
|
+
blocks_source: IDL.Opt(IDL.Principal),
|
|
38
|
+
fees: IDL.Opt(fees),
|
|
39
|
+
watchdog_canister: IDL.Opt(IDL.Opt(IDL.Principal)),
|
|
40
|
+
network: IDL.Opt(network),
|
|
41
|
+
stability_threshold: IDL.Opt(IDL.Nat),
|
|
42
|
+
syncing: IDL.Opt(flag),
|
|
43
|
+
burn_cycles: IDL.Opt(flag),
|
|
44
|
+
disable_api_if_not_fully_synced: IDL.Opt(flag)
|
|
45
|
+
});
|
|
46
|
+
export const address = IDL.Text;
|
|
47
|
+
export const get_balance_request = IDL.Record({
|
|
48
|
+
network: network,
|
|
49
|
+
address: address,
|
|
50
|
+
min_confirmations: IDL.Opt(IDL.Nat32)
|
|
51
|
+
});
|
|
52
|
+
export const satoshi = IDL.Nat64;
|
|
53
|
+
export const block_height = IDL.Nat32;
|
|
54
|
+
export const get_block_headers_request = IDL.Record({
|
|
55
|
+
start_height: block_height,
|
|
56
|
+
end_height: IDL.Opt(block_height),
|
|
57
|
+
network: network
|
|
58
|
+
});
|
|
59
|
+
export const block_header = IDL.Vec(IDL.Nat8);
|
|
60
|
+
export const get_block_headers_response = IDL.Record({
|
|
61
|
+
tip_height: block_height,
|
|
62
|
+
block_headers: IDL.Vec(block_header)
|
|
63
|
+
});
|
|
64
|
+
export const get_current_fee_percentiles_request = IDL.Record({
|
|
65
|
+
network: network
|
|
66
|
+
});
|
|
67
|
+
export const millisatoshi_per_byte = IDL.Nat64;
|
|
68
|
+
export const get_utxos_request = IDL.Record({
|
|
69
|
+
network: network,
|
|
70
|
+
filter: IDL.Opt(IDL.Variant({page: IDL.Vec(IDL.Nat8), min_confirmations: IDL.Nat32})),
|
|
71
|
+
address: address
|
|
72
|
+
});
|
|
73
|
+
export const block_hash = IDL.Vec(IDL.Nat8);
|
|
74
|
+
export const outpoint = IDL.Record({
|
|
75
|
+
txid: IDL.Vec(IDL.Nat8),
|
|
76
|
+
vout: IDL.Nat32
|
|
77
|
+
});
|
|
78
|
+
export const utxo = IDL.Record({
|
|
79
|
+
height: block_height,
|
|
80
|
+
value: satoshi,
|
|
81
|
+
outpoint: outpoint
|
|
82
|
+
});
|
|
83
|
+
export const get_utxos_response = IDL.Record({
|
|
84
|
+
next_page: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
85
|
+
tip_height: block_height,
|
|
86
|
+
tip_block_hash: block_hash,
|
|
87
|
+
utxos: IDL.Vec(utxo)
|
|
88
|
+
});
|
|
89
|
+
export const send_transaction_request = IDL.Record({
|
|
90
|
+
transaction: IDL.Vec(IDL.Nat8),
|
|
91
|
+
network: network
|
|
92
|
+
});
|
|
93
|
+
export const config = IDL.Record({
|
|
94
|
+
api_access: flag,
|
|
95
|
+
lazily_evaluate_fee_percentiles: flag,
|
|
96
|
+
blocks_source: IDL.Principal,
|
|
97
|
+
fees: fees,
|
|
98
|
+
watchdog_canister: IDL.Opt(IDL.Principal),
|
|
99
|
+
network: network,
|
|
100
|
+
stability_threshold: IDL.Nat,
|
|
101
|
+
syncing: flag,
|
|
102
|
+
burn_cycles: flag,
|
|
103
|
+
disable_api_if_not_fully_synced: flag
|
|
104
|
+
});
|
|
105
|
+
export const set_config_request = IDL.Record({
|
|
106
|
+
api_access: IDL.Opt(flag),
|
|
107
|
+
lazily_evaluate_fee_percentiles: IDL.Opt(flag),
|
|
108
|
+
fees: IDL.Opt(fees),
|
|
109
|
+
watchdog_canister: IDL.Opt(IDL.Opt(IDL.Principal)),
|
|
110
|
+
stability_threshold: IDL.Opt(IDL.Nat),
|
|
111
|
+
syncing: IDL.Opt(flag),
|
|
112
|
+
burn_cycles: IDL.Opt(flag),
|
|
113
|
+
disable_api_if_not_fully_synced: IDL.Opt(flag)
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
export const idlService = IDL.Service({
|
|
117
|
+
bitcoin_get_balance: IDL.Func([get_balance_request], [satoshi], []),
|
|
118
|
+
bitcoin_get_balance_query: IDL.Func([get_balance_request], [satoshi], ['query']),
|
|
119
|
+
bitcoin_get_block_headers: IDL.Func(
|
|
120
|
+
[get_block_headers_request],
|
|
121
|
+
[get_block_headers_response],
|
|
122
|
+
[]
|
|
123
|
+
),
|
|
124
|
+
bitcoin_get_current_fee_percentiles: IDL.Func(
|
|
125
|
+
[get_current_fee_percentiles_request],
|
|
126
|
+
[IDL.Vec(millisatoshi_per_byte)],
|
|
127
|
+
[]
|
|
128
|
+
),
|
|
129
|
+
bitcoin_get_utxos: IDL.Func([get_utxos_request], [get_utxos_response], []),
|
|
130
|
+
bitcoin_get_utxos_query: IDL.Func([get_utxos_request], [get_utxos_response], ['query']),
|
|
131
|
+
bitcoin_send_transaction: IDL.Func([send_transaction_request], [], []),
|
|
132
|
+
get_config: IDL.Func([], [config], ['query']),
|
|
133
|
+
set_config: IDL.Func([set_config_request], [], [])
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
export const idlInitArgs = [init_config];
|
|
137
|
+
|
|
138
|
+
export const idlFactory = ({IDL}) => {
|
|
139
|
+
const flag = IDL.Variant({disabled: IDL.Null, enabled: IDL.Null});
|
|
140
|
+
const fees = IDL.Record({
|
|
141
|
+
get_current_fee_percentiles: IDL.Nat,
|
|
142
|
+
get_utxos_maximum: IDL.Nat,
|
|
143
|
+
get_block_headers_cycles_per_ten_instructions: IDL.Nat,
|
|
144
|
+
get_current_fee_percentiles_maximum: IDL.Nat,
|
|
145
|
+
send_transaction_per_byte: IDL.Nat,
|
|
146
|
+
get_balance: IDL.Nat,
|
|
147
|
+
get_utxos_cycles_per_ten_instructions: IDL.Nat,
|
|
148
|
+
get_block_headers_base: IDL.Nat,
|
|
149
|
+
get_utxos_base: IDL.Nat,
|
|
150
|
+
get_balance_maximum: IDL.Nat,
|
|
151
|
+
send_transaction_base: IDL.Nat,
|
|
152
|
+
get_block_headers_maximum: IDL.Nat
|
|
153
|
+
});
|
|
154
|
+
const network = IDL.Variant({
|
|
155
|
+
mainnet: IDL.Null,
|
|
156
|
+
regtest: IDL.Null,
|
|
157
|
+
testnet: IDL.Null
|
|
158
|
+
});
|
|
159
|
+
const init_config = IDL.Record({
|
|
160
|
+
api_access: IDL.Opt(flag),
|
|
161
|
+
lazily_evaluate_fee_percentiles: IDL.Opt(flag),
|
|
162
|
+
blocks_source: IDL.Opt(IDL.Principal),
|
|
163
|
+
fees: IDL.Opt(fees),
|
|
164
|
+
watchdog_canister: IDL.Opt(IDL.Opt(IDL.Principal)),
|
|
165
|
+
network: IDL.Opt(network),
|
|
166
|
+
stability_threshold: IDL.Opt(IDL.Nat),
|
|
167
|
+
syncing: IDL.Opt(flag),
|
|
168
|
+
burn_cycles: IDL.Opt(flag),
|
|
169
|
+
disable_api_if_not_fully_synced: IDL.Opt(flag)
|
|
170
|
+
});
|
|
171
|
+
const address = IDL.Text;
|
|
172
|
+
const get_balance_request = IDL.Record({
|
|
173
|
+
network: network,
|
|
174
|
+
address: address,
|
|
175
|
+
min_confirmations: IDL.Opt(IDL.Nat32)
|
|
176
|
+
});
|
|
177
|
+
const satoshi = IDL.Nat64;
|
|
178
|
+
const block_height = IDL.Nat32;
|
|
179
|
+
const get_block_headers_request = IDL.Record({
|
|
180
|
+
start_height: block_height,
|
|
181
|
+
end_height: IDL.Opt(block_height),
|
|
182
|
+
network: network
|
|
183
|
+
});
|
|
184
|
+
const block_header = IDL.Vec(IDL.Nat8);
|
|
185
|
+
const get_block_headers_response = IDL.Record({
|
|
186
|
+
tip_height: block_height,
|
|
187
|
+
block_headers: IDL.Vec(block_header)
|
|
188
|
+
});
|
|
189
|
+
const get_current_fee_percentiles_request = IDL.Record({
|
|
190
|
+
network: network
|
|
191
|
+
});
|
|
192
|
+
const millisatoshi_per_byte = IDL.Nat64;
|
|
193
|
+
const get_utxos_request = IDL.Record({
|
|
194
|
+
network: network,
|
|
195
|
+
filter: IDL.Opt(
|
|
196
|
+
IDL.Variant({
|
|
197
|
+
page: IDL.Vec(IDL.Nat8),
|
|
198
|
+
min_confirmations: IDL.Nat32
|
|
199
|
+
})
|
|
200
|
+
),
|
|
201
|
+
address: address
|
|
202
|
+
});
|
|
203
|
+
const block_hash = IDL.Vec(IDL.Nat8);
|
|
204
|
+
const outpoint = IDL.Record({
|
|
205
|
+
txid: IDL.Vec(IDL.Nat8),
|
|
206
|
+
vout: IDL.Nat32
|
|
207
|
+
});
|
|
208
|
+
const utxo = IDL.Record({
|
|
209
|
+
height: block_height,
|
|
210
|
+
value: satoshi,
|
|
211
|
+
outpoint: outpoint
|
|
212
|
+
});
|
|
213
|
+
const get_utxos_response = IDL.Record({
|
|
214
|
+
next_page: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
215
|
+
tip_height: block_height,
|
|
216
|
+
tip_block_hash: block_hash,
|
|
217
|
+
utxos: IDL.Vec(utxo)
|
|
218
|
+
});
|
|
219
|
+
const send_transaction_request = IDL.Record({
|
|
220
|
+
transaction: IDL.Vec(IDL.Nat8),
|
|
221
|
+
network: network
|
|
222
|
+
});
|
|
223
|
+
const config = IDL.Record({
|
|
224
|
+
api_access: flag,
|
|
225
|
+
lazily_evaluate_fee_percentiles: flag,
|
|
226
|
+
blocks_source: IDL.Principal,
|
|
227
|
+
fees: fees,
|
|
228
|
+
watchdog_canister: IDL.Opt(IDL.Principal),
|
|
229
|
+
network: network,
|
|
230
|
+
stability_threshold: IDL.Nat,
|
|
231
|
+
syncing: flag,
|
|
232
|
+
burn_cycles: flag,
|
|
233
|
+
disable_api_if_not_fully_synced: flag
|
|
234
|
+
});
|
|
235
|
+
const set_config_request = IDL.Record({
|
|
236
|
+
api_access: IDL.Opt(flag),
|
|
237
|
+
lazily_evaluate_fee_percentiles: IDL.Opt(flag),
|
|
238
|
+
fees: IDL.Opt(fees),
|
|
239
|
+
watchdog_canister: IDL.Opt(IDL.Opt(IDL.Principal)),
|
|
240
|
+
stability_threshold: IDL.Opt(IDL.Nat),
|
|
241
|
+
syncing: IDL.Opt(flag),
|
|
242
|
+
burn_cycles: IDL.Opt(flag),
|
|
243
|
+
disable_api_if_not_fully_synced: IDL.Opt(flag)
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
return IDL.Service({
|
|
247
|
+
bitcoin_get_balance: IDL.Func([get_balance_request], [satoshi], []),
|
|
248
|
+
bitcoin_get_balance_query: IDL.Func([get_balance_request], [satoshi], ['query']),
|
|
249
|
+
bitcoin_get_block_headers: IDL.Func(
|
|
250
|
+
[get_block_headers_request],
|
|
251
|
+
[get_block_headers_response],
|
|
252
|
+
[]
|
|
253
|
+
),
|
|
254
|
+
bitcoin_get_current_fee_percentiles: IDL.Func(
|
|
255
|
+
[get_current_fee_percentiles_request],
|
|
256
|
+
[IDL.Vec(millisatoshi_per_byte)],
|
|
257
|
+
[]
|
|
258
|
+
),
|
|
259
|
+
bitcoin_get_utxos: IDL.Func([get_utxos_request], [get_utxos_response], []),
|
|
260
|
+
bitcoin_get_utxos_query: IDL.Func([get_utxos_request], [get_utxos_response], ['query']),
|
|
261
|
+
bitcoin_send_transaction: IDL.Func([send_transaction_request], [], []),
|
|
262
|
+
get_config: IDL.Func([], [config], ['query']),
|
|
263
|
+
set_config: IDL.Func([set_config_request], [], [])
|
|
264
|
+
});
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
export const init = ({IDL}) => {
|
|
268
|
+
const flag = IDL.Variant({disabled: IDL.Null, enabled: IDL.Null});
|
|
269
|
+
const fees = IDL.Record({
|
|
270
|
+
get_current_fee_percentiles: IDL.Nat,
|
|
271
|
+
get_utxos_maximum: IDL.Nat,
|
|
272
|
+
get_block_headers_cycles_per_ten_instructions: IDL.Nat,
|
|
273
|
+
get_current_fee_percentiles_maximum: IDL.Nat,
|
|
274
|
+
send_transaction_per_byte: IDL.Nat,
|
|
275
|
+
get_balance: IDL.Nat,
|
|
276
|
+
get_utxos_cycles_per_ten_instructions: IDL.Nat,
|
|
277
|
+
get_block_headers_base: IDL.Nat,
|
|
278
|
+
get_utxos_base: IDL.Nat,
|
|
279
|
+
get_balance_maximum: IDL.Nat,
|
|
280
|
+
send_transaction_base: IDL.Nat,
|
|
281
|
+
get_block_headers_maximum: IDL.Nat
|
|
282
|
+
});
|
|
283
|
+
const network = IDL.Variant({
|
|
284
|
+
mainnet: IDL.Null,
|
|
285
|
+
regtest: IDL.Null,
|
|
286
|
+
testnet: IDL.Null
|
|
287
|
+
});
|
|
288
|
+
const init_config = IDL.Record({
|
|
289
|
+
api_access: IDL.Opt(flag),
|
|
290
|
+
lazily_evaluate_fee_percentiles: IDL.Opt(flag),
|
|
291
|
+
blocks_source: IDL.Opt(IDL.Principal),
|
|
292
|
+
fees: IDL.Opt(fees),
|
|
293
|
+
watchdog_canister: IDL.Opt(IDL.Opt(IDL.Principal)),
|
|
294
|
+
network: IDL.Opt(network),
|
|
295
|
+
stability_threshold: IDL.Opt(IDL.Nat),
|
|
296
|
+
syncing: IDL.Opt(flag),
|
|
297
|
+
burn_cycles: IDL.Opt(flag),
|
|
298
|
+
disable_api_if_not_fully_synced: IDL.Opt(flag)
|
|
299
|
+
});
|
|
300
|
+
|
|
301
|
+
return [init_config];
|
|
302
|
+
};
|