@junobuild/functions 0.8.4 → 0.9.0-next-2026-04-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/canisters/ckbtc/index.js +1 -1
- package/canisters/cketh/index.js +1 -1
- package/canisters/cmc/cmc.canister.d.ts +6 -6
- package/canisters/cmc/index.d.ts +1 -0
- package/canisters/cmc/index.js +1 -1
- package/canisters/cmc/index.js.map +4 -4
- package/canisters/cmc/schema.d.ts +92 -0
- package/canisters/declarations/_idl.d.ts +2 -1
- package/canisters/declarations/_types.d.ts +2 -1
- package/canisters/declarations/ckbtc/bitcoin.did.d.ts +8 -0
- package/canisters/declarations/ckbtc/bitcoin.did.idl.d.ts +2 -0
- package/canisters/declarations/ckbtc/minter.did.d.ts +190 -0
- package/canisters/declarations/ckbtc/minter.did.idl.d.ts +9 -0
- package/canisters/declarations/cketh/minter.did.d.ts +140 -0
- package/canisters/declarations/cketh/minter.did.idl.d.ts +8 -0
- package/canisters/declarations/cycles-ledger/cycles-ledger.did.d.ts +413 -0
- package/canisters/declarations/cycles-ledger/cycles-ledger.did.idl.d.ts +82 -0
- package/canisters/declarations/ic-management/ic-management.did.d.ts +18 -4
- package/canisters/declarations/ledger-icp/index.did.d.ts +20 -1
- package/canisters/declarations/ledger-icp/index.did.idl.d.ts +5 -1
- package/canisters/declarations/ledger-icrc/icrc_index.did.d.ts +1 -0
- package/canisters/declarations/ledger-icrc/icrc_ledger.did.d.ts +1 -0
- package/canisters/declarations/nns/governance.did.d.ts +100 -0
- package/canisters/declarations/nns/governance.did.idl.d.ts +11 -0
- package/canisters/declarations/nns/governance_test.did.d.ts +100 -0
- package/canisters/declarations/nns/governance_test.did.idl.d.ts +11 -0
- package/canisters/declarations/nns/sns_wasm.did.d.ts +4 -0
- package/canisters/declarations/nns/sns_wasm.did.idl.d.ts +1 -0
- package/canisters/declarations/sns/governance.did.d.ts +4 -0
- package/canisters/declarations/sns/governance.did.idl.d.ts +1 -0
- package/canisters/declarations/sns/governance_test.did.d.ts +4 -0
- package/canisters/declarations/sns/governance_test.did.idl.d.ts +1 -0
- package/canisters/ic-management/index.js +1 -1
- package/canisters/index.d.ts +1 -1
- package/canisters/index.js +1 -1
- package/canisters/ledger/cycles/index.d.ts +1 -0
- package/canisters/ledger/cycles/index.js +2 -0
- package/canisters/ledger/cycles/index.js.map +7 -0
- package/canisters/ledger/icp/index.d.ts +1 -0
- package/canisters/ledger/icp/index.js +1 -1
- package/canisters/ledger/icp/index.js.map +4 -4
- package/canisters/ledger/icp/ledger.canister.d.ts +6 -6
- package/canisters/ledger/icp/schema.d.ts +152 -0
- package/canisters/ledger/icrc/index.d.ts +1 -1
- package/canisters/ledger/icrc/index.js +1 -1
- package/canisters/ledger/icrc/index.js.map +4 -4
- package/canisters/ledger/icrc/ledger.canister.d.ts +22 -14
- package/canisters/ledger/icrc/schema.d.ts +507 -0
- package/canisters/nns/index.js +1 -1
- package/canisters/sns/index.js +1 -1
- package/chunk-I3WMKZTG.js +2 -0
- package/chunk-I3WMKZTG.js.map +7 -0
- package/{chunk-X3EF7OU6.js → chunk-JI3RCRR6.js} +1 -1
- package/{chunk-X3EF7OU6.js.map → chunk-JI3RCRR6.js.map} +1 -1
- package/package.json +10 -6
- package/src/canisters/declarations/ckbtc/bitcoin.did.d.ts +8 -0
- package/src/canisters/declarations/ckbtc/bitcoin.did.idl.js +16 -0
- package/src/canisters/declarations/ckbtc/minter.did.d.ts +190 -0
- package/src/canisters/declarations/ckbtc/minter.did.idl.js +118 -0
- package/src/canisters/declarations/cketh/minter.did.d.ts +140 -0
- package/src/canisters/declarations/cketh/minter.did.idl.js +78 -0
- package/src/canisters/declarations/cycles-ledger/cycles-ledger.did.d.ts +413 -0
- package/src/canisters/declarations/cycles-ledger/cycles-ledger.did.idl.js +806 -0
- package/src/canisters/declarations/ic-management/ic-management.did.d.ts +18 -4
- package/src/canisters/declarations/ic-management/ic-management.did.idl.js +32 -8
- package/src/canisters/declarations/ledger-icp/index.did.d.ts +20 -1
- package/src/canisters/declarations/ledger-icp/index.did.idl.js +32 -5
- package/src/canisters/declarations/ledger-icrc/icrc_index.did.d.ts +1 -0
- package/src/canisters/declarations/ledger-icrc/icrc_index.did.idl.js +2 -0
- package/src/canisters/declarations/ledger-icrc/icrc_ledger.did.d.ts +1 -0
- package/src/canisters/declarations/ledger-icrc/icrc_ledger.did.idl.js +2 -0
- package/src/canisters/declarations/nns/governance.did.d.ts +100 -0
- package/src/canisters/declarations/nns/governance.did.idl.js +132 -0
- package/src/canisters/declarations/nns/governance_test.did.d.ts +100 -0
- package/src/canisters/declarations/nns/governance_test.did.idl.js +132 -0
- package/src/canisters/declarations/nns/sns_wasm.did.d.ts +4 -0
- package/src/canisters/declarations/nns/sns_wasm.did.idl.js +8 -0
- package/src/canisters/declarations/sns/governance.did.d.ts +4 -0
- package/src/canisters/declarations/sns/governance.did.idl.js +12 -0
- package/src/canisters/declarations/sns/governance_test.did.d.ts +4 -0
- package/src/canisters/declarations/sns/governance_test.did.idl.js +12 -0
- package/canisters/ledger/icrc/schemas.d.ts +0 -11
- package/chunk-I4MVAQHI.js +0 -2
- package/chunk-I4MVAQHI.js.map +0 -7
- /package/canisters/{schemas.d.ts → schema.d.ts} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{j as i}from"@junobuild/schema";import*as t from"zod";var r=t.strictObject({canisterId:i.principal().optional()});export{r as a};
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
//# sourceMappingURL=chunk-JI3RCRR6.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["src/canisters/
|
|
3
|
+
"sources": ["src/canisters/schema.ts"],
|
|
4
4
|
"sourcesContent": ["import {j} from '@junobuild/schema';\nimport * as z from 'zod';\n\n/**\n * @see CanisterOptions\n */\nexport const CanisterOptionsSchema = z.strictObject({\n canisterId: j.principal().optional()\n});\n\n/**\n * The options to initialize a canister.\n */\nexport type CanisterOptions = z.infer<typeof CanisterOptionsSchema>;\n"],
|
|
5
5
|
"mappings": "AAAA,OAAQ,KAAAA,MAAQ,oBAChB,UAAYC,MAAO,MAKZ,IAAMC,EAA0B,eAAa,CAClD,WAAYF,EAAE,UAAU,EAAE,SAAS,CACrC,CAAC",
|
|
6
6
|
"names": ["j", "z", "CanisterOptionsSchema"]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@junobuild/functions",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0-next-2026-04-20",
|
|
4
4
|
"description": "JavaScript and TypeScript utilities for Juno Serverless Functions",
|
|
5
5
|
"author": "David Dal Busco (https://daviddalbusco.com)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -41,6 +41,10 @@
|
|
|
41
41
|
"types": "./canisters/ic-management/index.d.ts",
|
|
42
42
|
"import": "./canisters/ic-management/index.js"
|
|
43
43
|
},
|
|
44
|
+
"./canisters/ledger/cycles": {
|
|
45
|
+
"types": "./canisters/ledger/cycles/index.d.ts",
|
|
46
|
+
"import": "./canisters/ledger/cycles/index.js"
|
|
47
|
+
},
|
|
44
48
|
"./canisters/ledger/icp": {
|
|
45
49
|
"types": "./canisters/ledger/icp/index.d.ts",
|
|
46
50
|
"import": "./canisters/ledger/icp/index.js"
|
|
@@ -94,9 +98,9 @@
|
|
|
94
98
|
],
|
|
95
99
|
"homepage": "https://juno.build",
|
|
96
100
|
"peerDependencies": {
|
|
97
|
-
"@icp-sdk/core": "
|
|
98
|
-
"@junobuild/schema": "
|
|
99
|
-
"@junobuild/utils": "
|
|
100
|
-
"zod": "
|
|
101
|
+
"@icp-sdk/core": "*",
|
|
102
|
+
"@junobuild/schema": "*",
|
|
103
|
+
"@junobuild/utils": "*",
|
|
104
|
+
"zod": "*"
|
|
101
105
|
}
|
|
102
|
-
}
|
|
106
|
+
}
|
|
@@ -14,6 +14,13 @@ export type address = string;
|
|
|
14
14
|
export type block_hash = Uint8Array;
|
|
15
15
|
export type block_header = Uint8Array;
|
|
16
16
|
export type block_height = number;
|
|
17
|
+
export interface blockchain_info {
|
|
18
|
+
'height' : block_height,
|
|
19
|
+
'block_hash' : block_hash,
|
|
20
|
+
'difficulty' : bigint,
|
|
21
|
+
'timestamp' : number,
|
|
22
|
+
'utxos_length' : bigint,
|
|
23
|
+
}
|
|
17
24
|
export type canister_arg = { 'init' : init_config } |
|
|
18
25
|
{ 'upgrade' : [] | [set_config_request] };
|
|
19
26
|
export interface config {
|
|
@@ -127,6 +134,7 @@ export interface _SERVICE {
|
|
|
127
134
|
[send_transaction_request],
|
|
128
135
|
undefined
|
|
129
136
|
>,
|
|
137
|
+
'get_blockchain_info' : ActorMethod<[], blockchain_info>,
|
|
130
138
|
'get_config' : ActorMethod<[], config>,
|
|
131
139
|
'set_config' : ActorMethod<[set_config_request], undefined>,
|
|
132
140
|
}
|
|
@@ -104,6 +104,13 @@ export const send_transaction_request = IDL.Record({
|
|
|
104
104
|
transaction: IDL.Vec(IDL.Nat8),
|
|
105
105
|
network: network
|
|
106
106
|
});
|
|
107
|
+
export const blockchain_info = IDL.Record({
|
|
108
|
+
height: block_height,
|
|
109
|
+
block_hash: block_hash,
|
|
110
|
+
difficulty: IDL.Nat,
|
|
111
|
+
timestamp: IDL.Nat32,
|
|
112
|
+
utxos_length: IDL.Nat64
|
|
113
|
+
});
|
|
107
114
|
export const config = IDL.Record({
|
|
108
115
|
api_access: flag,
|
|
109
116
|
lazily_evaluate_fee_percentiles: flag,
|
|
@@ -133,6 +140,7 @@ export const idlService = IDL.Service({
|
|
|
133
140
|
bitcoin_get_utxos: IDL.Func([get_utxos_request], [get_utxos_response], []),
|
|
134
141
|
bitcoin_get_utxos_query: IDL.Func([get_utxos_request], [get_utxos_response], ['query']),
|
|
135
142
|
bitcoin_send_transaction: IDL.Func([send_transaction_request], [], []),
|
|
143
|
+
get_blockchain_info: IDL.Func([], [blockchain_info], ['query']),
|
|
136
144
|
get_config: IDL.Func([], [config], ['query']),
|
|
137
145
|
set_config: IDL.Func([set_config_request], [], [])
|
|
138
146
|
});
|
|
@@ -238,6 +246,13 @@ export const idlFactory = ({IDL}) => {
|
|
|
238
246
|
transaction: IDL.Vec(IDL.Nat8),
|
|
239
247
|
network: network
|
|
240
248
|
});
|
|
249
|
+
const blockchain_info = IDL.Record({
|
|
250
|
+
height: block_height,
|
|
251
|
+
block_hash: block_hash,
|
|
252
|
+
difficulty: IDL.Nat,
|
|
253
|
+
timestamp: IDL.Nat32,
|
|
254
|
+
utxos_length: IDL.Nat64
|
|
255
|
+
});
|
|
241
256
|
const config = IDL.Record({
|
|
242
257
|
api_access: flag,
|
|
243
258
|
lazily_evaluate_fee_percentiles: flag,
|
|
@@ -267,6 +282,7 @@ export const idlFactory = ({IDL}) => {
|
|
|
267
282
|
bitcoin_get_utxos: IDL.Func([get_utxos_request], [get_utxos_response], []),
|
|
268
283
|
bitcoin_get_utxos_query: IDL.Func([get_utxos_request], [get_utxos_response], ['query']),
|
|
269
284
|
bitcoin_send_transaction: IDL.Func([send_transaction_request], [], []),
|
|
285
|
+
get_blockchain_info: IDL.Func([], [blockchain_info], ['query']),
|
|
270
286
|
get_config: IDL.Func([], [config], ['query']),
|
|
271
287
|
set_config: IDL.Func([set_config_request], [], [])
|
|
272
288
|
});
|
|
@@ -40,6 +40,40 @@ export type BtcNetwork = {
|
|
|
40
40
|
*/
|
|
41
41
|
'Testnet' : null
|
|
42
42
|
};
|
|
43
|
+
export type BurnMemo = {
|
|
44
|
+
/**
|
|
45
|
+
* The minter consolidated UTXOs.
|
|
46
|
+
*/
|
|
47
|
+
'Consolidate' : {
|
|
48
|
+
/**
|
|
49
|
+
* The total value of the consolidated UTXOs.
|
|
50
|
+
*/
|
|
51
|
+
'value' : bigint,
|
|
52
|
+
/**
|
|
53
|
+
* The number of input UTXOs that were consolidated.
|
|
54
|
+
*/
|
|
55
|
+
'inputs' : bigint,
|
|
56
|
+
}
|
|
57
|
+
} |
|
|
58
|
+
{
|
|
59
|
+
/**
|
|
60
|
+
* The minter processed a retrieve_btc request.
|
|
61
|
+
*/
|
|
62
|
+
'Convert' : {
|
|
63
|
+
/**
|
|
64
|
+
* The status of the Bitcoin check.
|
|
65
|
+
*/
|
|
66
|
+
'status' : [] | [Status],
|
|
67
|
+
/**
|
|
68
|
+
* The destination of the retrieve BTC request.
|
|
69
|
+
*/
|
|
70
|
+
'address' : [] | [string],
|
|
71
|
+
/**
|
|
72
|
+
* The check fee for the burn.
|
|
73
|
+
*/
|
|
74
|
+
'kyt_fee' : [] | [bigint],
|
|
75
|
+
}
|
|
76
|
+
};
|
|
43
77
|
export interface CanisterStatusResponse {
|
|
44
78
|
'memory_metrics' : MemoryMetrics,
|
|
45
79
|
'status' : CanisterStatusType,
|
|
@@ -56,6 +90,48 @@ export interface CanisterStatusResponse {
|
|
|
56
90
|
export type CanisterStatusType = { 'stopped' : null } |
|
|
57
91
|
{ 'stopping' : null } |
|
|
58
92
|
{ 'running' : null };
|
|
93
|
+
export interface DecodeLedgerMemoArgs {
|
|
94
|
+
/**
|
|
95
|
+
* The encoded memo type
|
|
96
|
+
*/
|
|
97
|
+
'memo_type' : MemoType,
|
|
98
|
+
/**
|
|
99
|
+
* The encoded memo from a minter transaction on the ledger
|
|
100
|
+
*/
|
|
101
|
+
'encoded_memo' : Uint8Array,
|
|
102
|
+
}
|
|
103
|
+
export type DecodeLedgerMemoError = {
|
|
104
|
+
/**
|
|
105
|
+
* The provided memo could not be decoded.
|
|
106
|
+
*/
|
|
107
|
+
'InvalidMemo' : string
|
|
108
|
+
};
|
|
109
|
+
export type DecodeLedgerMemoResult = {
|
|
110
|
+
/**
|
|
111
|
+
* The decoded memo, if the minter was able to decode it. This field is `opt`, so that other memo types can be
|
|
112
|
+
* added in the future.
|
|
113
|
+
*/
|
|
114
|
+
'Ok' : [] | [DecodedMemo]
|
|
115
|
+
} |
|
|
116
|
+
{
|
|
117
|
+
/**
|
|
118
|
+
* An error in case the minter was not able to decode the provided memo. This field is `opt`, so that other error
|
|
119
|
+
* types can be added in the future.
|
|
120
|
+
*/
|
|
121
|
+
'Err' : [] | [DecodeLedgerMemoError]
|
|
122
|
+
};
|
|
123
|
+
export type DecodedMemo = {
|
|
124
|
+
/**
|
|
125
|
+
* The decoded BurnMemo - `opt` since other variants of `BurnMemo` could be added in the future.
|
|
126
|
+
*/
|
|
127
|
+
'Burn' : [] | [BurnMemo]
|
|
128
|
+
} |
|
|
129
|
+
{
|
|
130
|
+
/**
|
|
131
|
+
* The decoded MintMemo - `opt` since other variants of `MintMemo` could be added in the future.
|
|
132
|
+
*/
|
|
133
|
+
'Mint' : [] | [MintMemo]
|
|
134
|
+
};
|
|
59
135
|
export interface DefiniteCanisterSettings {
|
|
60
136
|
'freezing_threshold' : bigint,
|
|
61
137
|
'wasm_memory_threshold' : bigint,
|
|
@@ -88,6 +164,7 @@ export type EventType = {
|
|
|
88
164
|
'fee' : [] | [bigint],
|
|
89
165
|
'change_output' : [] | [{ 'value' : bigint, 'vout' : number }],
|
|
90
166
|
'txid' : Uint8Array,
|
|
167
|
+
'signed_tx' : [] | [Uint8Array],
|
|
91
168
|
'withdrawal_fee' : [] | [WithdrawalFee],
|
|
92
169
|
'utxos' : Array<Utxo>,
|
|
93
170
|
'requests' : BigUint64Array,
|
|
@@ -164,6 +241,14 @@ export type EventType = {
|
|
|
164
241
|
{ 'checked_utxo_v2' : { 'utxo' : Utxo, 'account' : Account } } |
|
|
165
242
|
{ 'ignored_utxo' : { 'utxo' : Utxo } } |
|
|
166
243
|
{ 'checked_utxo_mint_unknown' : { 'utxo' : Utxo, 'account' : Account } } |
|
|
244
|
+
{
|
|
245
|
+
'created_consolidate_utxos_request' : {
|
|
246
|
+
'received_at' : bigint,
|
|
247
|
+
'block_index' : bigint,
|
|
248
|
+
'address' : BitcoinAddress,
|
|
249
|
+
'amount' : bigint,
|
|
250
|
+
}
|
|
251
|
+
} |
|
|
167
252
|
{
|
|
168
253
|
'reimbursed_failed_deposit' : {
|
|
169
254
|
'burn_block_index' : bigint,
|
|
@@ -201,6 +286,11 @@ export interface InitArgs {
|
|
|
201
286
|
* The minimal amount of ckBTC that can be converted to BTC.
|
|
202
287
|
*/
|
|
203
288
|
'retrieve_btc_min_amount' : bigint,
|
|
289
|
+
/**
|
|
290
|
+
* The minimal amount of BTC that can be converted to ckBTC.
|
|
291
|
+
* UTXOs with lower values will be ignored.
|
|
292
|
+
*/
|
|
293
|
+
'deposit_btc_min_amount' : [] | [bigint],
|
|
204
294
|
/**
|
|
205
295
|
* The principal of the ledger that handles ckBTC transfers.
|
|
206
296
|
* The default account of the ckBTC minter must be configured as
|
|
@@ -220,6 +310,14 @@ export interface InitArgs {
|
|
|
220
310
|
* / The fee paid per Bitcoin check.
|
|
221
311
|
*/
|
|
222
312
|
'check_fee' : [] | [bigint],
|
|
313
|
+
/**
|
|
314
|
+
* / The maximum number of input UTXOs allowed in a transaction.
|
|
315
|
+
*/
|
|
316
|
+
'max_num_inputs_in_transaction' : [] | [bigint],
|
|
317
|
+
/**
|
|
318
|
+
* / The minimum number of available UTXOs to trigger a consolidation.
|
|
319
|
+
*/
|
|
320
|
+
'utxo_consolidation_threshold' : [] | [bigint],
|
|
223
321
|
/**
|
|
224
322
|
* / The canister id of the Bitcoin checker canister.
|
|
225
323
|
*/
|
|
@@ -240,6 +338,8 @@ export type InvalidTransactionError = {
|
|
|
240
338
|
export type LogVisibility = { 'controllers' : null } |
|
|
241
339
|
{ 'public' : null } |
|
|
242
340
|
{ 'allowed_viewers' : Array<Principal> };
|
|
341
|
+
export type MemoType = { 'Burn' : null } |
|
|
342
|
+
{ 'Mint' : null };
|
|
243
343
|
export interface MemoryMetrics {
|
|
244
344
|
'wasm_binary_size' : bigint,
|
|
245
345
|
'wasm_chunk_store_size' : bigint,
|
|
@@ -250,6 +350,57 @@ export interface MemoryMetrics {
|
|
|
250
350
|
'global_memory_size' : bigint,
|
|
251
351
|
'custom_sections_size' : bigint,
|
|
252
352
|
}
|
|
353
|
+
export type MintMemo = {
|
|
354
|
+
/**
|
|
355
|
+
* [deprecated] The minter minted accumulated check fees to the KYT provider.
|
|
356
|
+
*/
|
|
357
|
+
'Kyt' : null
|
|
358
|
+
} |
|
|
359
|
+
{
|
|
360
|
+
'ReimburseWithdrawal' : {
|
|
361
|
+
/**
|
|
362
|
+
* The id corresponding to the withdrawal request,
|
|
363
|
+
* which corresponds to the ledger burn index.
|
|
364
|
+
*/
|
|
365
|
+
'withdrawal_id' : bigint,
|
|
366
|
+
}
|
|
367
|
+
} |
|
|
368
|
+
{
|
|
369
|
+
/**
|
|
370
|
+
* [deprecated] The minter failed to check retrieve btc destination address
|
|
371
|
+
* or the destination address is tainted.
|
|
372
|
+
*/
|
|
373
|
+
'KytFail' : {
|
|
374
|
+
/**
|
|
375
|
+
* The status of the Bitcoin check.
|
|
376
|
+
*/
|
|
377
|
+
'status' : [] | [Status],
|
|
378
|
+
'associated_burn_index' : [] | [bigint],
|
|
379
|
+
/**
|
|
380
|
+
* The Bitcoin check fee.
|
|
381
|
+
*/
|
|
382
|
+
'kyt_fee' : [] | [bigint],
|
|
383
|
+
}
|
|
384
|
+
} |
|
|
385
|
+
{
|
|
386
|
+
/**
|
|
387
|
+
* The minter converted a single UTXO to ckBTC.
|
|
388
|
+
*/
|
|
389
|
+
'Convert' : {
|
|
390
|
+
/**
|
|
391
|
+
* The transaction ID of the accepted UTXO.
|
|
392
|
+
*/
|
|
393
|
+
'txid' : [] | [Uint8Array],
|
|
394
|
+
/**
|
|
395
|
+
* UTXO's output index within the BTC transaction.
|
|
396
|
+
*/
|
|
397
|
+
'vout' : [] | [number],
|
|
398
|
+
/**
|
|
399
|
+
* The Bitcoin check fee.
|
|
400
|
+
*/
|
|
401
|
+
'kyt_fee' : [] | [bigint],
|
|
402
|
+
}
|
|
403
|
+
};
|
|
253
404
|
export type MinterArg = { 'Upgrade' : [] | [UpgradeArgs] } |
|
|
254
405
|
{ 'Init' : InitArgs };
|
|
255
406
|
export interface MinterInfo {
|
|
@@ -258,6 +409,11 @@ export interface MinterInfo {
|
|
|
258
409
|
* initialization or upgrades, but may vary according to current network fees.
|
|
259
410
|
*/
|
|
260
411
|
'retrieve_btc_min_amount' : bigint,
|
|
412
|
+
/**
|
|
413
|
+
* Minimal amount of BTC that can be deposited to be converted into ckBTC.
|
|
414
|
+
* UTXOs with lower values will be ignored.
|
|
415
|
+
*/
|
|
416
|
+
'deposit_btc_min_amount' : [] | [bigint],
|
|
261
417
|
'min_confirmations' : number,
|
|
262
418
|
/**
|
|
263
419
|
* The same as `check_fee`, but the old name is kept here to be backward compatible.
|
|
@@ -546,6 +702,19 @@ export type RetrieveBtcWithApprovalError = {
|
|
|
546
702
|
*/
|
|
547
703
|
'InsufficientFunds' : { 'balance' : bigint }
|
|
548
704
|
};
|
|
705
|
+
export type Status = { 'CallFailed' : null } |
|
|
706
|
+
{
|
|
707
|
+
/**
|
|
708
|
+
* The minter rejected a retrieve_btc due to a failed Bitcoin check.
|
|
709
|
+
*/
|
|
710
|
+
'Rejected' : null
|
|
711
|
+
} |
|
|
712
|
+
{
|
|
713
|
+
/**
|
|
714
|
+
* The minter accepted a retrieve_btc request.
|
|
715
|
+
*/
|
|
716
|
+
'Accepted' : null
|
|
717
|
+
};
|
|
549
718
|
export type SuspendedReason = {
|
|
550
719
|
/**
|
|
551
720
|
* The minter ignored this UTXO because UTXO's value is too small to pay
|
|
@@ -618,6 +787,11 @@ export interface UpgradeArgs {
|
|
|
618
787
|
* The minimal amount of ckBTC that the minter converts to BTC.
|
|
619
788
|
*/
|
|
620
789
|
'retrieve_btc_min_amount' : [] | [bigint],
|
|
790
|
+
/**
|
|
791
|
+
* The minimal amount of BTC that can be converted to ckBTC.
|
|
792
|
+
* UTXOs with lower values will be ignored.
|
|
793
|
+
*/
|
|
794
|
+
'deposit_btc_min_amount' : [] | [bigint],
|
|
621
795
|
/**
|
|
622
796
|
* / Maximum time in nanoseconds that a transaction should spend in the queue
|
|
623
797
|
* / before being sent.
|
|
@@ -627,6 +801,14 @@ export interface UpgradeArgs {
|
|
|
627
801
|
* / The fee per Bitcoin check.
|
|
628
802
|
*/
|
|
629
803
|
'check_fee' : [] | [bigint],
|
|
804
|
+
/**
|
|
805
|
+
* / The maximum number of input UTXOs allowed in a transaction.
|
|
806
|
+
*/
|
|
807
|
+
'max_num_inputs_in_transaction' : [] | [bigint],
|
|
808
|
+
/**
|
|
809
|
+
* / The minimum number of available UTXOs to trigger a consolidation.
|
|
810
|
+
*/
|
|
811
|
+
'utxo_consolidation_threshold' : [] | [bigint],
|
|
630
812
|
/**
|
|
631
813
|
* / The principal of the Bitcoin checker canister.
|
|
632
814
|
*/
|
|
@@ -686,6 +868,14 @@ export type WithdrawalReimbursementReason = {
|
|
|
686
868
|
};
|
|
687
869
|
export interface environment_variable { 'value' : string, 'name' : string }
|
|
688
870
|
export interface _SERVICE {
|
|
871
|
+
/**
|
|
872
|
+
* Section "Transaction Information" {{{
|
|
873
|
+
* Returns information related to minter transactions.
|
|
874
|
+
*/
|
|
875
|
+
'decode_ledger_memo' : ActorMethod<
|
|
876
|
+
[DecodeLedgerMemoArgs],
|
|
877
|
+
DecodeLedgerMemoResult
|
|
878
|
+
>,
|
|
689
879
|
/**
|
|
690
880
|
* / Returns an estimate of the user's fee (in Satoshi) for a
|
|
691
881
|
* / retrieve_btc request based on the current status of the Bitcoin network.
|
|
@@ -19,8 +19,11 @@ export const UpgradeArgs = IDL.Record({
|
|
|
19
19
|
kyt_principal: IDL.Opt(IDL.Principal),
|
|
20
20
|
mode: IDL.Opt(Mode),
|
|
21
21
|
retrieve_btc_min_amount: IDL.Opt(IDL.Nat64),
|
|
22
|
+
deposit_btc_min_amount: IDL.Opt(IDL.Nat64),
|
|
22
23
|
max_time_in_queue_nanos: IDL.Opt(IDL.Nat64),
|
|
23
24
|
check_fee: IDL.Opt(IDL.Nat64),
|
|
25
|
+
max_num_inputs_in_transaction: IDL.Opt(IDL.Nat64),
|
|
26
|
+
utxo_consolidation_threshold: IDL.Opt(IDL.Nat64),
|
|
24
27
|
btc_checker_principal: IDL.Opt(IDL.Principal),
|
|
25
28
|
min_confirmations: IDL.Opt(IDL.Nat32),
|
|
26
29
|
kyt_fee: IDL.Opt(IDL.Nat64)
|
|
@@ -36,10 +39,13 @@ export const InitArgs = IDL.Record({
|
|
|
36
39
|
ecdsa_key_name: IDL.Text,
|
|
37
40
|
mode: Mode,
|
|
38
41
|
retrieve_btc_min_amount: IDL.Nat64,
|
|
42
|
+
deposit_btc_min_amount: IDL.Opt(IDL.Nat64),
|
|
39
43
|
ledger_id: IDL.Principal,
|
|
40
44
|
max_time_in_queue_nanos: IDL.Nat64,
|
|
41
45
|
btc_network: BtcNetwork,
|
|
42
46
|
check_fee: IDL.Opt(IDL.Nat64),
|
|
47
|
+
max_num_inputs_in_transaction: IDL.Opt(IDL.Nat64),
|
|
48
|
+
utxo_consolidation_threshold: IDL.Opt(IDL.Nat64),
|
|
43
49
|
btc_checker_principal: IDL.Opt(IDL.Principal),
|
|
44
50
|
min_confirmations: IDL.Opt(IDL.Nat32),
|
|
45
51
|
kyt_fee: IDL.Opt(IDL.Nat64)
|
|
@@ -48,6 +54,47 @@ export const MinterArg = IDL.Variant({
|
|
|
48
54
|
Upgrade: IDL.Opt(UpgradeArgs),
|
|
49
55
|
Init: InitArgs
|
|
50
56
|
});
|
|
57
|
+
export const MemoType = IDL.Variant({Burn: IDL.Null, Mint: IDL.Null});
|
|
58
|
+
export const DecodeLedgerMemoArgs = IDL.Record({
|
|
59
|
+
memo_type: MemoType,
|
|
60
|
+
encoded_memo: IDL.Vec(IDL.Nat8)
|
|
61
|
+
});
|
|
62
|
+
export const Status = IDL.Variant({
|
|
63
|
+
CallFailed: IDL.Null,
|
|
64
|
+
Rejected: IDL.Null,
|
|
65
|
+
Accepted: IDL.Null
|
|
66
|
+
});
|
|
67
|
+
export const BurnMemo = IDL.Variant({
|
|
68
|
+
Consolidate: IDL.Record({value: IDL.Nat64, inputs: IDL.Nat64}),
|
|
69
|
+
Convert: IDL.Record({
|
|
70
|
+
status: IDL.Opt(Status),
|
|
71
|
+
address: IDL.Opt(IDL.Text),
|
|
72
|
+
kyt_fee: IDL.Opt(IDL.Nat64)
|
|
73
|
+
})
|
|
74
|
+
});
|
|
75
|
+
export const MintMemo = IDL.Variant({
|
|
76
|
+
Kyt: IDL.Null,
|
|
77
|
+
ReimburseWithdrawal: IDL.Record({withdrawal_id: IDL.Nat64}),
|
|
78
|
+
KytFail: IDL.Record({
|
|
79
|
+
status: IDL.Opt(Status),
|
|
80
|
+
associated_burn_index: IDL.Opt(IDL.Nat64),
|
|
81
|
+
kyt_fee: IDL.Opt(IDL.Nat64)
|
|
82
|
+
}),
|
|
83
|
+
Convert: IDL.Record({
|
|
84
|
+
txid: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
85
|
+
vout: IDL.Opt(IDL.Nat32),
|
|
86
|
+
kyt_fee: IDL.Opt(IDL.Nat64)
|
|
87
|
+
})
|
|
88
|
+
});
|
|
89
|
+
export const DecodedMemo = IDL.Variant({
|
|
90
|
+
Burn: IDL.Opt(BurnMemo),
|
|
91
|
+
Mint: IDL.Opt(MintMemo)
|
|
92
|
+
});
|
|
93
|
+
export const DecodeLedgerMemoError = IDL.Variant({InvalidMemo: IDL.Text});
|
|
94
|
+
export const DecodeLedgerMemoResult = IDL.Variant({
|
|
95
|
+
Ok: IDL.Opt(DecodedMemo),
|
|
96
|
+
Err: IDL.Opt(DecodeLedgerMemoError)
|
|
97
|
+
});
|
|
51
98
|
export const MemoryMetrics = IDL.Record({
|
|
52
99
|
wasm_binary_size: IDL.Nat,
|
|
53
100
|
wasm_chunk_store_size: IDL.Nat,
|
|
@@ -162,6 +209,7 @@ export const EventType = IDL.Variant({
|
|
|
162
209
|
fee: IDL.Opt(IDL.Nat64),
|
|
163
210
|
change_output: IDL.Opt(IDL.Record({value: IDL.Nat64, vout: IDL.Nat32})),
|
|
164
211
|
txid: IDL.Vec(IDL.Nat8),
|
|
212
|
+
signed_tx: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
165
213
|
withdrawal_fee: IDL.Opt(WithdrawalFee),
|
|
166
214
|
utxos: IDL.Vec(Utxo),
|
|
167
215
|
requests: IDL.Vec(IDL.Nat64),
|
|
@@ -228,6 +276,12 @@ export const EventType = IDL.Variant({
|
|
|
228
276
|
utxo: Utxo,
|
|
229
277
|
account: Account
|
|
230
278
|
}),
|
|
279
|
+
created_consolidate_utxos_request: IDL.Record({
|
|
280
|
+
received_at: IDL.Nat64,
|
|
281
|
+
block_index: IDL.Nat64,
|
|
282
|
+
address: BitcoinAddress,
|
|
283
|
+
amount: IDL.Nat64
|
|
284
|
+
}),
|
|
231
285
|
reimbursed_failed_deposit: IDL.Record({
|
|
232
286
|
burn_block_index: IDL.Nat64,
|
|
233
287
|
mint_block_index: IDL.Nat64
|
|
@@ -243,6 +297,7 @@ export const Event = IDL.Record({
|
|
|
243
297
|
});
|
|
244
298
|
export const MinterInfo = IDL.Record({
|
|
245
299
|
retrieve_btc_min_amount: IDL.Nat64,
|
|
300
|
+
deposit_btc_min_amount: IDL.Opt(IDL.Nat64),
|
|
246
301
|
min_confirmations: IDL.Nat32,
|
|
247
302
|
kyt_fee: IDL.Nat64
|
|
248
303
|
});
|
|
@@ -347,6 +402,7 @@ export const UpdateBalanceError = IDL.Variant({
|
|
|
347
402
|
});
|
|
348
403
|
|
|
349
404
|
export const idlService = IDL.Service({
|
|
405
|
+
decode_ledger_memo: IDL.Func([DecodeLedgerMemoArgs], [DecodeLedgerMemoResult], ['query']),
|
|
350
406
|
estimate_withdrawal_fee: IDL.Func(
|
|
351
407
|
[IDL.Record({amount: IDL.Opt(IDL.Nat64)})],
|
|
352
408
|
[IDL.Record({minter_fee: IDL.Nat64, bitcoin_fee: IDL.Nat64})],
|
|
@@ -444,8 +500,11 @@ export const idlFactory = ({IDL}) => {
|
|
|
444
500
|
kyt_principal: IDL.Opt(IDL.Principal),
|
|
445
501
|
mode: IDL.Opt(Mode),
|
|
446
502
|
retrieve_btc_min_amount: IDL.Opt(IDL.Nat64),
|
|
503
|
+
deposit_btc_min_amount: IDL.Opt(IDL.Nat64),
|
|
447
504
|
max_time_in_queue_nanos: IDL.Opt(IDL.Nat64),
|
|
448
505
|
check_fee: IDL.Opt(IDL.Nat64),
|
|
506
|
+
max_num_inputs_in_transaction: IDL.Opt(IDL.Nat64),
|
|
507
|
+
utxo_consolidation_threshold: IDL.Opt(IDL.Nat64),
|
|
449
508
|
btc_checker_principal: IDL.Opt(IDL.Principal),
|
|
450
509
|
min_confirmations: IDL.Opt(IDL.Nat32),
|
|
451
510
|
kyt_fee: IDL.Opt(IDL.Nat64)
|
|
@@ -461,10 +520,13 @@ export const idlFactory = ({IDL}) => {
|
|
|
461
520
|
ecdsa_key_name: IDL.Text,
|
|
462
521
|
mode: Mode,
|
|
463
522
|
retrieve_btc_min_amount: IDL.Nat64,
|
|
523
|
+
deposit_btc_min_amount: IDL.Opt(IDL.Nat64),
|
|
464
524
|
ledger_id: IDL.Principal,
|
|
465
525
|
max_time_in_queue_nanos: IDL.Nat64,
|
|
466
526
|
btc_network: BtcNetwork,
|
|
467
527
|
check_fee: IDL.Opt(IDL.Nat64),
|
|
528
|
+
max_num_inputs_in_transaction: IDL.Opt(IDL.Nat64),
|
|
529
|
+
utxo_consolidation_threshold: IDL.Opt(IDL.Nat64),
|
|
468
530
|
btc_checker_principal: IDL.Opt(IDL.Principal),
|
|
469
531
|
min_confirmations: IDL.Opt(IDL.Nat32),
|
|
470
532
|
kyt_fee: IDL.Opt(IDL.Nat64)
|
|
@@ -473,6 +535,47 @@ export const idlFactory = ({IDL}) => {
|
|
|
473
535
|
Upgrade: IDL.Opt(UpgradeArgs),
|
|
474
536
|
Init: InitArgs
|
|
475
537
|
});
|
|
538
|
+
const MemoType = IDL.Variant({Burn: IDL.Null, Mint: IDL.Null});
|
|
539
|
+
const DecodeLedgerMemoArgs = IDL.Record({
|
|
540
|
+
memo_type: MemoType,
|
|
541
|
+
encoded_memo: IDL.Vec(IDL.Nat8)
|
|
542
|
+
});
|
|
543
|
+
const Status = IDL.Variant({
|
|
544
|
+
CallFailed: IDL.Null,
|
|
545
|
+
Rejected: IDL.Null,
|
|
546
|
+
Accepted: IDL.Null
|
|
547
|
+
});
|
|
548
|
+
const BurnMemo = IDL.Variant({
|
|
549
|
+
Consolidate: IDL.Record({value: IDL.Nat64, inputs: IDL.Nat64}),
|
|
550
|
+
Convert: IDL.Record({
|
|
551
|
+
status: IDL.Opt(Status),
|
|
552
|
+
address: IDL.Opt(IDL.Text),
|
|
553
|
+
kyt_fee: IDL.Opt(IDL.Nat64)
|
|
554
|
+
})
|
|
555
|
+
});
|
|
556
|
+
const MintMemo = IDL.Variant({
|
|
557
|
+
Kyt: IDL.Null,
|
|
558
|
+
ReimburseWithdrawal: IDL.Record({withdrawal_id: IDL.Nat64}),
|
|
559
|
+
KytFail: IDL.Record({
|
|
560
|
+
status: IDL.Opt(Status),
|
|
561
|
+
associated_burn_index: IDL.Opt(IDL.Nat64),
|
|
562
|
+
kyt_fee: IDL.Opt(IDL.Nat64)
|
|
563
|
+
}),
|
|
564
|
+
Convert: IDL.Record({
|
|
565
|
+
txid: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
566
|
+
vout: IDL.Opt(IDL.Nat32),
|
|
567
|
+
kyt_fee: IDL.Opt(IDL.Nat64)
|
|
568
|
+
})
|
|
569
|
+
});
|
|
570
|
+
const DecodedMemo = IDL.Variant({
|
|
571
|
+
Burn: IDL.Opt(BurnMemo),
|
|
572
|
+
Mint: IDL.Opt(MintMemo)
|
|
573
|
+
});
|
|
574
|
+
const DecodeLedgerMemoError = IDL.Variant({InvalidMemo: IDL.Text});
|
|
575
|
+
const DecodeLedgerMemoResult = IDL.Variant({
|
|
576
|
+
Ok: IDL.Opt(DecodedMemo),
|
|
577
|
+
Err: IDL.Opt(DecodeLedgerMemoError)
|
|
578
|
+
});
|
|
476
579
|
const MemoryMetrics = IDL.Record({
|
|
477
580
|
wasm_binary_size: IDL.Nat,
|
|
478
581
|
wasm_chunk_store_size: IDL.Nat,
|
|
@@ -587,6 +690,7 @@ export const idlFactory = ({IDL}) => {
|
|
|
587
690
|
fee: IDL.Opt(IDL.Nat64),
|
|
588
691
|
change_output: IDL.Opt(IDL.Record({value: IDL.Nat64, vout: IDL.Nat32})),
|
|
589
692
|
txid: IDL.Vec(IDL.Nat8),
|
|
693
|
+
signed_tx: IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
590
694
|
withdrawal_fee: IDL.Opt(WithdrawalFee),
|
|
591
695
|
utxos: IDL.Vec(Utxo),
|
|
592
696
|
requests: IDL.Vec(IDL.Nat64),
|
|
@@ -653,6 +757,12 @@ export const idlFactory = ({IDL}) => {
|
|
|
653
757
|
utxo: Utxo,
|
|
654
758
|
account: Account
|
|
655
759
|
}),
|
|
760
|
+
created_consolidate_utxos_request: IDL.Record({
|
|
761
|
+
received_at: IDL.Nat64,
|
|
762
|
+
block_index: IDL.Nat64,
|
|
763
|
+
address: BitcoinAddress,
|
|
764
|
+
amount: IDL.Nat64
|
|
765
|
+
}),
|
|
656
766
|
reimbursed_failed_deposit: IDL.Record({
|
|
657
767
|
burn_block_index: IDL.Nat64,
|
|
658
768
|
mint_block_index: IDL.Nat64
|
|
@@ -668,6 +778,7 @@ export const idlFactory = ({IDL}) => {
|
|
|
668
778
|
});
|
|
669
779
|
const MinterInfo = IDL.Record({
|
|
670
780
|
retrieve_btc_min_amount: IDL.Nat64,
|
|
781
|
+
deposit_btc_min_amount: IDL.Opt(IDL.Nat64),
|
|
671
782
|
min_confirmations: IDL.Nat32,
|
|
672
783
|
kyt_fee: IDL.Nat64
|
|
673
784
|
});
|
|
@@ -772,6 +883,7 @@ export const idlFactory = ({IDL}) => {
|
|
|
772
883
|
});
|
|
773
884
|
|
|
774
885
|
return IDL.Service({
|
|
886
|
+
decode_ledger_memo: IDL.Func([DecodeLedgerMemoArgs], [DecodeLedgerMemoResult], ['query']),
|
|
775
887
|
estimate_withdrawal_fee: IDL.Func(
|
|
776
888
|
[IDL.Record({amount: IDL.Opt(IDL.Nat64)})],
|
|
777
889
|
[IDL.Record({minter_fee: IDL.Nat64, bitcoin_fee: IDL.Nat64})],
|
|
@@ -873,8 +985,11 @@ export const init = ({IDL}) => {
|
|
|
873
985
|
kyt_principal: IDL.Opt(IDL.Principal),
|
|
874
986
|
mode: IDL.Opt(Mode),
|
|
875
987
|
retrieve_btc_min_amount: IDL.Opt(IDL.Nat64),
|
|
988
|
+
deposit_btc_min_amount: IDL.Opt(IDL.Nat64),
|
|
876
989
|
max_time_in_queue_nanos: IDL.Opt(IDL.Nat64),
|
|
877
990
|
check_fee: IDL.Opt(IDL.Nat64),
|
|
991
|
+
max_num_inputs_in_transaction: IDL.Opt(IDL.Nat64),
|
|
992
|
+
utxo_consolidation_threshold: IDL.Opt(IDL.Nat64),
|
|
878
993
|
btc_checker_principal: IDL.Opt(IDL.Principal),
|
|
879
994
|
min_confirmations: IDL.Opt(IDL.Nat32),
|
|
880
995
|
kyt_fee: IDL.Opt(IDL.Nat64)
|
|
@@ -890,10 +1005,13 @@ export const init = ({IDL}) => {
|
|
|
890
1005
|
ecdsa_key_name: IDL.Text,
|
|
891
1006
|
mode: Mode,
|
|
892
1007
|
retrieve_btc_min_amount: IDL.Nat64,
|
|
1008
|
+
deposit_btc_min_amount: IDL.Opt(IDL.Nat64),
|
|
893
1009
|
ledger_id: IDL.Principal,
|
|
894
1010
|
max_time_in_queue_nanos: IDL.Nat64,
|
|
895
1011
|
btc_network: BtcNetwork,
|
|
896
1012
|
check_fee: IDL.Opt(IDL.Nat64),
|
|
1013
|
+
max_num_inputs_in_transaction: IDL.Opt(IDL.Nat64),
|
|
1014
|
+
utxo_consolidation_threshold: IDL.Opt(IDL.Nat64),
|
|
897
1015
|
btc_checker_principal: IDL.Opt(IDL.Principal),
|
|
898
1016
|
min_confirmations: IDL.Opt(IDL.Nat32),
|
|
899
1017
|
kyt_fee: IDL.Opt(IDL.Nat64)
|