@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
|
@@ -1,466 +1,474 @@
|
|
|
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
10
|
const Mode = IDL.Variant({
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
11
|
+
RestrictedTo: IDL.Vec(IDL.Principal),
|
|
12
|
+
DepositsRestrictedTo: IDL.Vec(IDL.Principal),
|
|
13
|
+
ReadOnly: IDL.Null,
|
|
14
|
+
GeneralAvailability: IDL.Null,
|
|
8
15
|
});
|
|
9
16
|
const UpgradeArgs = IDL.Record({
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
get_utxos_cache_expiration_seconds: IDL.Opt(IDL.Nat64),
|
|
18
|
+
kyt_principal: IDL.Opt(IDL.Principal),
|
|
19
|
+
mode: IDL.Opt(Mode),
|
|
20
|
+
retrieve_btc_min_amount: IDL.Opt(IDL.Nat64),
|
|
21
|
+
max_time_in_queue_nanos: IDL.Opt(IDL.Nat64),
|
|
22
|
+
check_fee: IDL.Opt(IDL.Nat64),
|
|
23
|
+
btc_checker_principal: IDL.Opt(IDL.Principal),
|
|
24
|
+
min_confirmations: IDL.Opt(IDL.Nat32),
|
|
25
|
+
kyt_fee: IDL.Opt(IDL.Nat64),
|
|
19
26
|
});
|
|
20
27
|
const BtcNetwork = IDL.Variant({
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
28
|
+
Mainnet: IDL.Null,
|
|
29
|
+
Regtest: IDL.Null,
|
|
30
|
+
Testnet: IDL.Null,
|
|
24
31
|
});
|
|
25
32
|
const InitArgs = IDL.Record({
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
get_utxos_cache_expiration_seconds: IDL.Opt(IDL.Nat64),
|
|
34
|
+
kyt_principal: IDL.Opt(IDL.Principal),
|
|
35
|
+
ecdsa_key_name: IDL.Text,
|
|
36
|
+
mode: Mode,
|
|
37
|
+
retrieve_btc_min_amount: IDL.Nat64,
|
|
38
|
+
ledger_id: IDL.Principal,
|
|
39
|
+
max_time_in_queue_nanos: IDL.Nat64,
|
|
40
|
+
btc_network: BtcNetwork,
|
|
41
|
+
check_fee: IDL.Opt(IDL.Nat64),
|
|
42
|
+
btc_checker_principal: IDL.Opt(IDL.Principal),
|
|
43
|
+
min_confirmations: IDL.Opt(IDL.Nat32),
|
|
44
|
+
kyt_fee: IDL.Opt(IDL.Nat64),
|
|
38
45
|
});
|
|
39
46
|
const MinterArg = IDL.Variant({
|
|
40
|
-
|
|
41
|
-
|
|
47
|
+
Upgrade: IDL.Opt(UpgradeArgs),
|
|
48
|
+
Init: InitArgs,
|
|
42
49
|
});
|
|
43
50
|
const MemoryMetrics = IDL.Record({
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
51
|
+
wasm_binary_size: IDL.Nat,
|
|
52
|
+
wasm_chunk_store_size: IDL.Nat,
|
|
53
|
+
canister_history_size: IDL.Nat,
|
|
54
|
+
stable_memory_size: IDL.Nat,
|
|
55
|
+
snapshots_size: IDL.Nat,
|
|
56
|
+
wasm_memory_size: IDL.Nat,
|
|
57
|
+
global_memory_size: IDL.Nat,
|
|
58
|
+
custom_sections_size: IDL.Nat,
|
|
52
59
|
});
|
|
53
60
|
const CanisterStatusType = IDL.Variant({
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
61
|
+
stopped: IDL.Null,
|
|
62
|
+
stopping: IDL.Null,
|
|
63
|
+
running: IDL.Null,
|
|
57
64
|
});
|
|
58
65
|
const LogVisibility = IDL.Variant({
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
66
|
+
controllers: IDL.Null,
|
|
67
|
+
public: IDL.Null,
|
|
68
|
+
allowed_viewers: IDL.Vec(IDL.Principal),
|
|
62
69
|
});
|
|
63
70
|
const DefiniteCanisterSettings = IDL.Record({
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
71
|
+
freezing_threshold: IDL.Nat,
|
|
72
|
+
wasm_memory_threshold: IDL.Nat,
|
|
73
|
+
controllers: IDL.Vec(IDL.Principal),
|
|
74
|
+
reserved_cycles_limit: IDL.Nat,
|
|
75
|
+
log_visibility: LogVisibility,
|
|
76
|
+
wasm_memory_limit: IDL.Nat,
|
|
77
|
+
memory_allocation: IDL.Nat,
|
|
78
|
+
compute_allocation: IDL.Nat,
|
|
72
79
|
});
|
|
73
80
|
const QueryStats = IDL.Record({
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
81
|
+
response_payload_bytes_total: IDL.Nat,
|
|
82
|
+
num_instructions_total: IDL.Nat,
|
|
83
|
+
num_calls_total: IDL.Nat,
|
|
84
|
+
request_payload_bytes_total: IDL.Nat,
|
|
78
85
|
});
|
|
79
86
|
const CanisterStatusResponse = IDL.Record({
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
memory_metrics: MemoryMetrics,
|
|
88
|
+
status: CanisterStatusType,
|
|
89
|
+
memory_size: IDL.Nat,
|
|
90
|
+
cycles: IDL.Nat,
|
|
91
|
+
settings: DefiniteCanisterSettings,
|
|
92
|
+
query_stats: QueryStats,
|
|
93
|
+
idle_cycles_burned_per_day: IDL.Nat,
|
|
94
|
+
module_hash: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
95
|
+
reserved_cycles: IDL.Nat,
|
|
89
96
|
});
|
|
90
97
|
const Account = IDL.Record({
|
|
91
|
-
|
|
92
|
-
|
|
98
|
+
owner: IDL.Principal,
|
|
99
|
+
subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
93
100
|
});
|
|
94
101
|
const Utxo = IDL.Record({
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
102
|
+
height: IDL.Nat32,
|
|
103
|
+
value: IDL.Nat64,
|
|
104
|
+
outpoint: IDL.Record({ txid: IDL.Vec(IDL.Nat8), vout: IDL.Nat32 }),
|
|
98
105
|
});
|
|
99
106
|
const ReimbursementReason = IDL.Variant({
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
107
|
+
CallFailed: IDL.Null,
|
|
108
|
+
TaintedDestination: IDL.Record({
|
|
109
|
+
kyt_fee: IDL.Nat64,
|
|
110
|
+
kyt_provider: IDL.Principal,
|
|
104
111
|
}),
|
|
105
112
|
});
|
|
106
113
|
const WithdrawalFee = IDL.Record({
|
|
107
|
-
|
|
108
|
-
|
|
114
|
+
minter_fee: IDL.Nat64,
|
|
115
|
+
bitcoin_fee: IDL.Nat64,
|
|
109
116
|
});
|
|
110
117
|
const SuspendedReason = IDL.Variant({
|
|
111
|
-
|
|
112
|
-
|
|
118
|
+
ValueTooSmall: IDL.Null,
|
|
119
|
+
Quarantined: IDL.Null,
|
|
113
120
|
});
|
|
114
121
|
const BitcoinAddress = IDL.Variant({
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
122
|
+
p2wsh_v0: IDL.Vec(IDL.Nat8),
|
|
123
|
+
p2tr_v1: IDL.Vec(IDL.Nat8),
|
|
124
|
+
p2sh: IDL.Vec(IDL.Nat8),
|
|
125
|
+
p2wpkh_v0: IDL.Vec(IDL.Nat8),
|
|
126
|
+
p2pkh: IDL.Vec(IDL.Nat8),
|
|
120
127
|
});
|
|
121
128
|
const InvalidTransactionError = IDL.Variant({
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
129
|
+
too_many_inputs: IDL.Record({
|
|
130
|
+
max_num_inputs: IDL.Nat64,
|
|
131
|
+
num_inputs: IDL.Nat64,
|
|
125
132
|
}),
|
|
126
133
|
});
|
|
127
134
|
const WithdrawalReimbursementReason = IDL.Variant({
|
|
128
|
-
|
|
135
|
+
invalid_transaction: InvalidTransactionError,
|
|
129
136
|
});
|
|
130
137
|
const ReplacedReason = IDL.Variant({
|
|
131
|
-
|
|
132
|
-
|
|
138
|
+
to_cancel: IDL.Record({ reason: WithdrawalReimbursementReason }),
|
|
139
|
+
to_retry: IDL.Null,
|
|
133
140
|
});
|
|
134
141
|
const EventType = IDL.Variant({
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
142
|
+
received_utxos: IDL.Record({
|
|
143
|
+
to_account: Account,
|
|
144
|
+
mint_txid: IDL.Opt(IDL.Nat64),
|
|
145
|
+
utxos: IDL.Vec(Utxo),
|
|
139
146
|
}),
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
147
|
+
schedule_deposit_reimbursement: IDL.Record({
|
|
148
|
+
burn_block_index: IDL.Nat64,
|
|
149
|
+
account: Account,
|
|
150
|
+
amount: IDL.Nat64,
|
|
151
|
+
reason: ReimbursementReason,
|
|
145
152
|
}),
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
),
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
'requests' : IDL.Vec(IDL.Nat64),
|
|
155
|
-
'submitted_at' : IDL.Nat64,
|
|
153
|
+
sent_transaction: IDL.Record({
|
|
154
|
+
fee: IDL.Opt(IDL.Nat64),
|
|
155
|
+
change_output: IDL.Opt(IDL.Record({ value: IDL.Nat64, vout: IDL.Nat32 })),
|
|
156
|
+
txid: IDL.Vec(IDL.Nat8),
|
|
157
|
+
withdrawal_fee: IDL.Opt(WithdrawalFee),
|
|
158
|
+
utxos: IDL.Vec(Utxo),
|
|
159
|
+
requests: IDL.Vec(IDL.Nat64),
|
|
160
|
+
submitted_at: IDL.Nat64,
|
|
156
161
|
}),
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
162
|
+
distributed_kyt_fee: IDL.Record({
|
|
163
|
+
block_index: IDL.Nat64,
|
|
164
|
+
amount: IDL.Nat64,
|
|
165
|
+
kyt_provider: IDL.Principal,
|
|
161
166
|
}),
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
167
|
+
init: InitArgs,
|
|
168
|
+
upgrade: UpgradeArgs,
|
|
169
|
+
retrieve_btc_kyt_failed: IDL.Record({
|
|
170
|
+
block_index: IDL.Nat64,
|
|
171
|
+
owner: IDL.Principal,
|
|
172
|
+
uuid: IDL.Text,
|
|
173
|
+
address: IDL.Text,
|
|
174
|
+
amount: IDL.Nat64,
|
|
175
|
+
kyt_provider: IDL.Principal,
|
|
171
176
|
}),
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
177
|
+
suspended_utxo: IDL.Record({
|
|
178
|
+
utxo: Utxo,
|
|
179
|
+
account: Account,
|
|
180
|
+
reason: SuspendedReason,
|
|
176
181
|
}),
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
182
|
+
accepted_retrieve_btc_request: IDL.Record({
|
|
183
|
+
received_at: IDL.Nat64,
|
|
184
|
+
block_index: IDL.Nat64,
|
|
185
|
+
address: BitcoinAddress,
|
|
186
|
+
reimbursement_account: IDL.Opt(Account),
|
|
187
|
+
amount: IDL.Nat64,
|
|
188
|
+
kyt_provider: IDL.Opt(IDL.Principal),
|
|
184
189
|
}),
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
+
checked_utxo: IDL.Record({
|
|
191
|
+
clean: IDL.Bool,
|
|
192
|
+
utxo: Utxo,
|
|
193
|
+
uuid: IDL.Text,
|
|
194
|
+
kyt_provider: IDL.Opt(IDL.Principal),
|
|
190
195
|
}),
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
+
schedule_withdrawal_reimbursement: IDL.Record({
|
|
197
|
+
burn_block_index: IDL.Nat64,
|
|
198
|
+
account: Account,
|
|
199
|
+
amount: IDL.Nat64,
|
|
200
|
+
reason: WithdrawalReimbursementReason,
|
|
196
201
|
}),
|
|
197
|
-
|
|
198
|
-
|
|
202
|
+
quarantined_withdrawal_reimbursement: IDL.Record({
|
|
203
|
+
burn_block_index: IDL.Nat64,
|
|
199
204
|
}),
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
205
|
+
removed_retrieve_btc_request: IDL.Record({ block_index: IDL.Nat64 }),
|
|
206
|
+
confirmed_transaction: IDL.Record({ txid: IDL.Vec(IDL.Nat8) }),
|
|
207
|
+
replaced_transaction: IDL.Record({
|
|
208
|
+
fee: IDL.Nat64,
|
|
209
|
+
change_output: IDL.Record({ value: IDL.Nat64, vout: IDL.Nat32 }),
|
|
210
|
+
new_utxos: IDL.Opt(IDL.Vec(Utxo)),
|
|
211
|
+
old_txid: IDL.Vec(IDL.Nat8),
|
|
212
|
+
withdrawal_fee: IDL.Opt(WithdrawalFee),
|
|
213
|
+
new_txid: IDL.Vec(IDL.Nat8),
|
|
214
|
+
submitted_at: IDL.Nat64,
|
|
215
|
+
reason: IDL.Opt(ReplacedReason),
|
|
211
216
|
}),
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
+
checked_utxo_v2: IDL.Record({ utxo: Utxo, account: Account }),
|
|
218
|
+
ignored_utxo: IDL.Record({ utxo: Utxo }),
|
|
219
|
+
checked_utxo_mint_unknown: IDL.Record({
|
|
220
|
+
utxo: Utxo,
|
|
221
|
+
account: Account,
|
|
217
222
|
}),
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
223
|
+
reimbursed_failed_deposit: IDL.Record({
|
|
224
|
+
burn_block_index: IDL.Nat64,
|
|
225
|
+
mint_block_index: IDL.Nat64,
|
|
221
226
|
}),
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
227
|
+
reimbursed_withdrawal: IDL.Record({
|
|
228
|
+
burn_block_index: IDL.Nat64,
|
|
229
|
+
mint_block_index: IDL.Nat64,
|
|
225
230
|
}),
|
|
226
231
|
});
|
|
227
232
|
const Event = IDL.Record({
|
|
228
|
-
|
|
229
|
-
|
|
233
|
+
timestamp: IDL.Opt(IDL.Nat64),
|
|
234
|
+
payload: EventType,
|
|
230
235
|
});
|
|
231
236
|
const MinterInfo = IDL.Record({
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
237
|
+
retrieve_btc_min_amount: IDL.Nat64,
|
|
238
|
+
min_confirmations: IDL.Nat32,
|
|
239
|
+
kyt_fee: IDL.Nat64,
|
|
235
240
|
});
|
|
236
241
|
const RetrieveBtcArgs = IDL.Record({
|
|
237
|
-
|
|
238
|
-
|
|
242
|
+
address: IDL.Text,
|
|
243
|
+
amount: IDL.Nat64,
|
|
239
244
|
});
|
|
240
|
-
const RetrieveBtcOk = IDL.Record({
|
|
245
|
+
const RetrieveBtcOk = IDL.Record({ block_index: IDL.Nat64 });
|
|
241
246
|
const RetrieveBtcError = IDL.Variant({
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
247
|
+
MalformedAddress: IDL.Text,
|
|
248
|
+
GenericError: IDL.Record({
|
|
249
|
+
error_message: IDL.Text,
|
|
250
|
+
error_code: IDL.Nat64,
|
|
246
251
|
}),
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
252
|
+
TemporarilyUnavailable: IDL.Text,
|
|
253
|
+
AlreadyProcessing: IDL.Null,
|
|
254
|
+
AmountTooLow: IDL.Nat64,
|
|
255
|
+
InsufficientFunds: IDL.Record({ balance: IDL.Nat64 }),
|
|
251
256
|
});
|
|
252
257
|
const RetrieveBtcStatus = IDL.Variant({
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
258
|
+
Signing: IDL.Null,
|
|
259
|
+
Confirmed: IDL.Record({ txid: IDL.Vec(IDL.Nat8) }),
|
|
260
|
+
Sending: IDL.Record({ txid: IDL.Vec(IDL.Nat8) }),
|
|
261
|
+
AmountTooLow: IDL.Null,
|
|
262
|
+
Unknown: IDL.Null,
|
|
263
|
+
Submitted: IDL.Record({ txid: IDL.Vec(IDL.Nat8) }),
|
|
264
|
+
Pending: IDL.Null,
|
|
260
265
|
});
|
|
261
266
|
const ReimbursementRequest = IDL.Record({
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
267
|
+
account: Account,
|
|
268
|
+
amount: IDL.Nat64,
|
|
269
|
+
reason: ReimbursementReason,
|
|
265
270
|
});
|
|
266
271
|
const ReimbursedDeposit = IDL.Record({
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
272
|
+
account: Account,
|
|
273
|
+
mint_block_index: IDL.Nat64,
|
|
274
|
+
amount: IDL.Nat64,
|
|
275
|
+
reason: ReimbursementReason,
|
|
271
276
|
});
|
|
272
277
|
const RetrieveBtcStatusV2 = IDL.Variant({
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
278
|
+
Signing: IDL.Null,
|
|
279
|
+
Confirmed: IDL.Record({ txid: IDL.Vec(IDL.Nat8) }),
|
|
280
|
+
Sending: IDL.Record({ txid: IDL.Vec(IDL.Nat8) }),
|
|
281
|
+
AmountTooLow: IDL.Null,
|
|
282
|
+
WillReimburse: ReimbursementRequest,
|
|
283
|
+
Unknown: IDL.Null,
|
|
284
|
+
Submitted: IDL.Record({ txid: IDL.Vec(IDL.Nat8) }),
|
|
285
|
+
Reimbursed: ReimbursedDeposit,
|
|
286
|
+
Pending: IDL.Null,
|
|
282
287
|
});
|
|
283
288
|
const RetrieveBtcWithApprovalArgs = IDL.Record({
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
289
|
+
from_subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
290
|
+
address: IDL.Text,
|
|
291
|
+
amount: IDL.Nat64,
|
|
287
292
|
});
|
|
288
293
|
const RetrieveBtcWithApprovalError = IDL.Variant({
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
294
|
+
MalformedAddress: IDL.Text,
|
|
295
|
+
GenericError: IDL.Record({
|
|
296
|
+
error_message: IDL.Text,
|
|
297
|
+
error_code: IDL.Nat64,
|
|
293
298
|
}),
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
+
TemporarilyUnavailable: IDL.Text,
|
|
300
|
+
InsufficientAllowance: IDL.Record({ allowance: IDL.Nat64 }),
|
|
301
|
+
AlreadyProcessing: IDL.Null,
|
|
302
|
+
AmountTooLow: IDL.Nat64,
|
|
303
|
+
InsufficientFunds: IDL.Record({ balance: IDL.Nat64 }),
|
|
299
304
|
});
|
|
300
305
|
const UtxoStatus = IDL.Variant({
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
306
|
+
ValueTooSmall: Utxo,
|
|
307
|
+
Tainted: Utxo,
|
|
308
|
+
Minted: IDL.Record({
|
|
309
|
+
minted_amount: IDL.Nat64,
|
|
310
|
+
block_index: IDL.Nat64,
|
|
311
|
+
utxo: Utxo,
|
|
307
312
|
}),
|
|
308
|
-
|
|
313
|
+
Checked: Utxo,
|
|
309
314
|
});
|
|
310
315
|
const Timestamp = IDL.Nat64;
|
|
311
316
|
const SuspendedUtxo = IDL.Record({
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
317
|
+
utxo: Utxo,
|
|
318
|
+
earliest_retry: Timestamp,
|
|
319
|
+
reason: SuspendedReason,
|
|
315
320
|
});
|
|
316
321
|
const PendingUtxo = IDL.Record({
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
322
|
+
confirmations: IDL.Nat32,
|
|
323
|
+
value: IDL.Nat64,
|
|
324
|
+
outpoint: IDL.Record({ txid: IDL.Vec(IDL.Nat8), vout: IDL.Nat32 }),
|
|
320
325
|
});
|
|
321
326
|
const UpdateBalanceError = IDL.Variant({
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
327
|
+
GenericError: IDL.Record({
|
|
328
|
+
error_message: IDL.Text,
|
|
329
|
+
error_code: IDL.Nat64,
|
|
325
330
|
}),
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
331
|
+
TemporarilyUnavailable: IDL.Text,
|
|
332
|
+
AlreadyProcessing: IDL.Null,
|
|
333
|
+
NoNewUtxos: IDL.Record({
|
|
334
|
+
suspended_utxos: IDL.Opt(IDL.Vec(SuspendedUtxo)),
|
|
335
|
+
required_confirmations: IDL.Nat32,
|
|
336
|
+
pending_utxos: IDL.Opt(IDL.Vec(PendingUtxo)),
|
|
337
|
+
current_confirmations: IDL.Opt(IDL.Nat32),
|
|
333
338
|
}),
|
|
334
339
|
});
|
|
340
|
+
|
|
335
341
|
return IDL.Service({
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
342
|
+
estimate_withdrawal_fee: IDL.Func(
|
|
343
|
+
[IDL.Record({ amount: IDL.Opt(IDL.Nat64) })],
|
|
344
|
+
[IDL.Record({ minter_fee: IDL.Nat64, bitcoin_fee: IDL.Nat64 })],
|
|
345
|
+
["query"],
|
|
346
|
+
),
|
|
347
|
+
get_btc_address: IDL.Func(
|
|
348
|
+
[
|
|
349
|
+
IDL.Record({
|
|
350
|
+
owner: IDL.Opt(IDL.Principal),
|
|
351
|
+
subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
352
|
+
}),
|
|
353
|
+
],
|
|
354
|
+
[IDL.Text],
|
|
355
|
+
[],
|
|
356
|
+
),
|
|
357
|
+
get_canister_status: IDL.Func([], [CanisterStatusResponse], []),
|
|
358
|
+
get_deposit_fee: IDL.Func([], [IDL.Nat64], ["query"]),
|
|
359
|
+
get_events: IDL.Func(
|
|
360
|
+
[IDL.Record({ start: IDL.Nat64, length: IDL.Nat64 })],
|
|
361
|
+
[IDL.Vec(Event)],
|
|
362
|
+
["query"],
|
|
363
|
+
),
|
|
364
|
+
get_known_utxos: IDL.Func(
|
|
365
|
+
[
|
|
366
|
+
IDL.Record({
|
|
367
|
+
owner: IDL.Opt(IDL.Principal),
|
|
368
|
+
subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
369
|
+
}),
|
|
370
|
+
],
|
|
371
|
+
[IDL.Vec(Utxo)],
|
|
372
|
+
["query"],
|
|
373
|
+
),
|
|
374
|
+
get_minter_info: IDL.Func([], [MinterInfo], ["query"]),
|
|
375
|
+
get_withdrawal_account: IDL.Func([], [Account], []),
|
|
376
|
+
retrieve_btc: IDL.Func(
|
|
377
|
+
[RetrieveBtcArgs],
|
|
378
|
+
[IDL.Variant({ Ok: RetrieveBtcOk, Err: RetrieveBtcError })],
|
|
379
|
+
[],
|
|
380
|
+
),
|
|
381
|
+
retrieve_btc_status: IDL.Func(
|
|
382
|
+
[IDL.Record({ block_index: IDL.Nat64 })],
|
|
383
|
+
[RetrieveBtcStatus],
|
|
384
|
+
["query"],
|
|
385
|
+
),
|
|
386
|
+
retrieve_btc_status_v2: IDL.Func(
|
|
387
|
+
[IDL.Record({ block_index: IDL.Nat64 })],
|
|
388
|
+
[RetrieveBtcStatusV2],
|
|
389
|
+
["query"],
|
|
390
|
+
),
|
|
391
|
+
retrieve_btc_status_v2_by_account: IDL.Func(
|
|
392
|
+
[IDL.Opt(Account)],
|
|
393
|
+
[
|
|
394
|
+
IDL.Vec(
|
|
343
395
|
IDL.Record({
|
|
344
|
-
|
|
345
|
-
|
|
396
|
+
block_index: IDL.Nat64,
|
|
397
|
+
status_v2: IDL.Opt(RetrieveBtcStatusV2),
|
|
346
398
|
}),
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
[IDL.Record({ 'block_index' : IDL.Nat64 })],
|
|
377
|
-
[RetrieveBtcStatus],
|
|
378
|
-
['query'],
|
|
379
|
-
),
|
|
380
|
-
'retrieve_btc_status_v2' : IDL.Func(
|
|
381
|
-
[IDL.Record({ 'block_index' : IDL.Nat64 })],
|
|
382
|
-
[RetrieveBtcStatusV2],
|
|
383
|
-
['query'],
|
|
384
|
-
),
|
|
385
|
-
'retrieve_btc_status_v2_by_account' : IDL.Func(
|
|
386
|
-
[IDL.Opt(Account)],
|
|
387
|
-
[
|
|
388
|
-
IDL.Vec(
|
|
389
|
-
IDL.Record({
|
|
390
|
-
'block_index' : IDL.Nat64,
|
|
391
|
-
'status_v2' : IDL.Opt(RetrieveBtcStatusV2),
|
|
392
|
-
})
|
|
393
|
-
),
|
|
394
|
-
],
|
|
395
|
-
['query'],
|
|
396
|
-
),
|
|
397
|
-
'retrieve_btc_with_approval' : IDL.Func(
|
|
398
|
-
[RetrieveBtcWithApprovalArgs],
|
|
399
|
-
[
|
|
400
|
-
IDL.Variant({
|
|
401
|
-
'Ok' : RetrieveBtcOk,
|
|
402
|
-
'Err' : RetrieveBtcWithApprovalError,
|
|
403
|
-
}),
|
|
404
|
-
],
|
|
405
|
-
[],
|
|
406
|
-
),
|
|
407
|
-
'update_balance' : IDL.Func(
|
|
408
|
-
[
|
|
409
|
-
IDL.Record({
|
|
410
|
-
'owner' : IDL.Opt(IDL.Principal),
|
|
411
|
-
'subaccount' : IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
412
|
-
}),
|
|
413
|
-
],
|
|
414
|
-
[
|
|
415
|
-
IDL.Variant({
|
|
416
|
-
'Ok' : IDL.Vec(UtxoStatus),
|
|
417
|
-
'Err' : UpdateBalanceError,
|
|
418
|
-
}),
|
|
419
|
-
],
|
|
420
|
-
[],
|
|
421
|
-
),
|
|
399
|
+
),
|
|
400
|
+
],
|
|
401
|
+
["query"],
|
|
402
|
+
),
|
|
403
|
+
retrieve_btc_with_approval: IDL.Func(
|
|
404
|
+
[RetrieveBtcWithApprovalArgs],
|
|
405
|
+
[
|
|
406
|
+
IDL.Variant({
|
|
407
|
+
Ok: RetrieveBtcOk,
|
|
408
|
+
Err: RetrieveBtcWithApprovalError,
|
|
409
|
+
}),
|
|
410
|
+
],
|
|
411
|
+
[],
|
|
412
|
+
),
|
|
413
|
+
update_balance: IDL.Func(
|
|
414
|
+
[
|
|
415
|
+
IDL.Record({
|
|
416
|
+
owner: IDL.Opt(IDL.Principal),
|
|
417
|
+
subaccount: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
418
|
+
}),
|
|
419
|
+
],
|
|
420
|
+
[
|
|
421
|
+
IDL.Variant({
|
|
422
|
+
Ok: IDL.Vec(UtxoStatus),
|
|
423
|
+
Err: UpdateBalanceError,
|
|
424
|
+
}),
|
|
425
|
+
],
|
|
426
|
+
[],
|
|
427
|
+
),
|
|
422
428
|
});
|
|
423
429
|
};
|
|
430
|
+
|
|
424
431
|
export const init = ({ IDL }) => {
|
|
425
432
|
const Mode = IDL.Variant({
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
433
|
+
RestrictedTo: IDL.Vec(IDL.Principal),
|
|
434
|
+
DepositsRestrictedTo: IDL.Vec(IDL.Principal),
|
|
435
|
+
ReadOnly: IDL.Null,
|
|
436
|
+
GeneralAvailability: IDL.Null,
|
|
430
437
|
});
|
|
431
438
|
const UpgradeArgs = IDL.Record({
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
439
|
+
get_utxos_cache_expiration_seconds: IDL.Opt(IDL.Nat64),
|
|
440
|
+
kyt_principal: IDL.Opt(IDL.Principal),
|
|
441
|
+
mode: IDL.Opt(Mode),
|
|
442
|
+
retrieve_btc_min_amount: IDL.Opt(IDL.Nat64),
|
|
443
|
+
max_time_in_queue_nanos: IDL.Opt(IDL.Nat64),
|
|
444
|
+
check_fee: IDL.Opt(IDL.Nat64),
|
|
445
|
+
btc_checker_principal: IDL.Opt(IDL.Principal),
|
|
446
|
+
min_confirmations: IDL.Opt(IDL.Nat32),
|
|
447
|
+
kyt_fee: IDL.Opt(IDL.Nat64),
|
|
441
448
|
});
|
|
442
449
|
const BtcNetwork = IDL.Variant({
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
450
|
+
Mainnet: IDL.Null,
|
|
451
|
+
Regtest: IDL.Null,
|
|
452
|
+
Testnet: IDL.Null,
|
|
446
453
|
});
|
|
447
454
|
const InitArgs = IDL.Record({
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
455
|
+
get_utxos_cache_expiration_seconds: IDL.Opt(IDL.Nat64),
|
|
456
|
+
kyt_principal: IDL.Opt(IDL.Principal),
|
|
457
|
+
ecdsa_key_name: IDL.Text,
|
|
458
|
+
mode: Mode,
|
|
459
|
+
retrieve_btc_min_amount: IDL.Nat64,
|
|
460
|
+
ledger_id: IDL.Principal,
|
|
461
|
+
max_time_in_queue_nanos: IDL.Nat64,
|
|
462
|
+
btc_network: BtcNetwork,
|
|
463
|
+
check_fee: IDL.Opt(IDL.Nat64),
|
|
464
|
+
btc_checker_principal: IDL.Opt(IDL.Principal),
|
|
465
|
+
min_confirmations: IDL.Opt(IDL.Nat32),
|
|
466
|
+
kyt_fee: IDL.Opt(IDL.Nat64),
|
|
460
467
|
});
|
|
461
468
|
const MinterArg = IDL.Variant({
|
|
462
|
-
|
|
463
|
-
|
|
469
|
+
Upgrade: IDL.Opt(UpgradeArgs),
|
|
470
|
+
Init: InitArgs,
|
|
464
471
|
});
|
|
472
|
+
|
|
465
473
|
return [MinterArg];
|
|
466
474
|
};
|