Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ export type address = string;
export type block_hash = Uint8Array;
export type block_header = Uint8Array;
export type block_height = number;
export interface blockchain_info {
'height' : block_height,
'block_hash' : block_hash,
'difficulty' : bigint,
'timestamp' : number,
'utxos_length' : bigint,
}
export type canister_arg = { 'init' : init_config } |
{ 'upgrade' : [] | [set_config_request] };
export interface config {
Expand Down Expand Up @@ -127,6 +134,7 @@ export interface _SERVICE {
[send_transaction_request],
undefined
>,
'get_blockchain_info' : ActorMethod<[], blockchain_info>,
'get_config' : ActorMethod<[], config>,
'set_config' : ActorMethod<[set_config_request], undefined>,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,13 @@ export const send_transaction_request = IDL.Record({
transaction: IDL.Vec(IDL.Nat8),
network: network
});
export const blockchain_info = IDL.Record({
height: block_height,
block_hash: block_hash,
difficulty: IDL.Nat,
timestamp: IDL.Nat32,
utxos_length: IDL.Nat64
});
export const config = IDL.Record({
api_access: flag,
lazily_evaluate_fee_percentiles: flag,
Expand Down Expand Up @@ -133,6 +140,7 @@ export const idlService = IDL.Service({
bitcoin_get_utxos: IDL.Func([get_utxos_request], [get_utxos_response], []),
bitcoin_get_utxos_query: IDL.Func([get_utxos_request], [get_utxos_response], ['query']),
bitcoin_send_transaction: IDL.Func([send_transaction_request], [], []),
get_blockchain_info: IDL.Func([], [blockchain_info], ['query']),
get_config: IDL.Func([], [config], ['query']),
set_config: IDL.Func([set_config_request], [], [])
});
Expand Down Expand Up @@ -238,6 +246,13 @@ export const idlFactory = ({IDL}) => {
transaction: IDL.Vec(IDL.Nat8),
network: network
});
const blockchain_info = IDL.Record({
height: block_height,
block_hash: block_hash,
difficulty: IDL.Nat,
timestamp: IDL.Nat32,
utxos_length: IDL.Nat64
});
const config = IDL.Record({
api_access: flag,
lazily_evaluate_fee_percentiles: flag,
Expand Down Expand Up @@ -267,6 +282,7 @@ export const idlFactory = ({IDL}) => {
bitcoin_get_utxos: IDL.Func([get_utxos_request], [get_utxos_response], []),
bitcoin_get_utxos_query: IDL.Func([get_utxos_request], [get_utxos_response], ['query']),
bitcoin_send_transaction: IDL.Func([send_transaction_request], [], []),
get_blockchain_info: IDL.Func([], [blockchain_info], ['query']),
get_config: IDL.Func([], [config], ['query']),
set_config: IDL.Func([set_config_request], [], [])
});
Expand Down
190 changes: 190 additions & 0 deletions packages/functions/src/canisters/declarations/ckbtc/minter.did.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,40 @@ export type BtcNetwork = {
*/
'Testnet' : null
};
export type BurnMemo = {
/**
* The minter consolidated UTXOs.
*/
'Consolidate' : {
/**
* The total value of the consolidated UTXOs.
*/
'value' : bigint,
/**
* The number of input UTXOs that were consolidated.
*/
'inputs' : bigint,
}
} |
{
/**
* The minter processed a retrieve_btc request.
*/
'Convert' : {
/**
* The status of the Bitcoin check.
*/
'status' : [] | [Status],
/**
* The destination of the retrieve BTC request.
*/
'address' : [] | [string],
/**
* The check fee for the burn.
*/
'kyt_fee' : [] | [bigint],
}
};
export interface CanisterStatusResponse {
'memory_metrics' : MemoryMetrics,
'status' : CanisterStatusType,
Expand All @@ -56,6 +90,48 @@ export interface CanisterStatusResponse {
export type CanisterStatusType = { 'stopped' : null } |
{ 'stopping' : null } |
{ 'running' : null };
export interface DecodeLedgerMemoArgs {
/**
* The encoded memo type
*/
'memo_type' : MemoType,
/**
* The encoded memo from a minter transaction on the ledger
*/
'encoded_memo' : Uint8Array,
}
export type DecodeLedgerMemoError = {
/**
* The provided memo could not be decoded.
*/
'InvalidMemo' : string
};
export type DecodeLedgerMemoResult = {
/**
* The decoded memo, if the minter was able to decode it. This field is `opt`, so that other memo types can be
* added in the future.
*/
'Ok' : [] | [DecodedMemo]
} |
{
/**
* An error in case the minter was not able to decode the provided memo. This field is `opt`, so that other error
* types can be added in the future.
*/
'Err' : [] | [DecodeLedgerMemoError]
};
export type DecodedMemo = {
/**
* The decoded BurnMemo - `opt` since other variants of `BurnMemo` could be added in the future.
*/
'Burn' : [] | [BurnMemo]
} |
{
/**
* The decoded MintMemo - `opt` since other variants of `MintMemo` could be added in the future.
*/
'Mint' : [] | [MintMemo]
};
export interface DefiniteCanisterSettings {
'freezing_threshold' : bigint,
'wasm_memory_threshold' : bigint,
Expand Down Expand Up @@ -88,6 +164,7 @@ export type EventType = {
'fee' : [] | [bigint],
'change_output' : [] | [{ 'value' : bigint, 'vout' : number }],
'txid' : Uint8Array,
'signed_tx' : [] | [Uint8Array],
'withdrawal_fee' : [] | [WithdrawalFee],
'utxos' : Array<Utxo>,
'requests' : BigUint64Array,
Expand Down Expand Up @@ -164,6 +241,14 @@ export type EventType = {
{ 'checked_utxo_v2' : { 'utxo' : Utxo, 'account' : Account } } |
{ 'ignored_utxo' : { 'utxo' : Utxo } } |
{ 'checked_utxo_mint_unknown' : { 'utxo' : Utxo, 'account' : Account } } |
{
'created_consolidate_utxos_request' : {
'received_at' : bigint,
'block_index' : bigint,
'address' : BitcoinAddress,
'amount' : bigint,
}
} |
{
'reimbursed_failed_deposit' : {
'burn_block_index' : bigint,
Expand Down Expand Up @@ -201,6 +286,11 @@ export interface InitArgs {
* The minimal amount of ckBTC that can be converted to BTC.
*/
'retrieve_btc_min_amount' : bigint,
/**
* The minimal amount of BTC that can be converted to ckBTC.
* UTXOs with lower values will be ignored.
*/
'deposit_btc_min_amount' : [] | [bigint],
/**
* The principal of the ledger that handles ckBTC transfers.
* The default account of the ckBTC minter must be configured as
Expand All @@ -220,6 +310,14 @@ export interface InitArgs {
* / The fee paid per Bitcoin check.
*/
'check_fee' : [] | [bigint],
/**
* / The maximum number of input UTXOs allowed in a transaction.
*/
'max_num_inputs_in_transaction' : [] | [bigint],
/**
* / The minimum number of available UTXOs to trigger a consolidation.
*/
'utxo_consolidation_threshold' : [] | [bigint],
/**
* / The canister id of the Bitcoin checker canister.
*/
Expand All @@ -240,6 +338,8 @@ export type InvalidTransactionError = {
export type LogVisibility = { 'controllers' : null } |
{ 'public' : null } |
{ 'allowed_viewers' : Array<Principal> };
export type MemoType = { 'Burn' : null } |
{ 'Mint' : null };
export interface MemoryMetrics {
'wasm_binary_size' : bigint,
'wasm_chunk_store_size' : bigint,
Expand All @@ -250,6 +350,57 @@ export interface MemoryMetrics {
'global_memory_size' : bigint,
'custom_sections_size' : bigint,
}
export type MintMemo = {
/**
* [deprecated] The minter minted accumulated check fees to the KYT provider.
*/
'Kyt' : null
} |
{
'ReimburseWithdrawal' : {
/**
* The id corresponding to the withdrawal request,
* which corresponds to the ledger burn index.
*/
'withdrawal_id' : bigint,
}
} |
{
/**
* [deprecated] The minter failed to check retrieve btc destination address
* or the destination address is tainted.
*/
'KytFail' : {
/**
* The status of the Bitcoin check.
*/
'status' : [] | [Status],
'associated_burn_index' : [] | [bigint],
/**
* The Bitcoin check fee.
*/
'kyt_fee' : [] | [bigint],
}
} |
{
/**
* The minter converted a single UTXO to ckBTC.
*/
'Convert' : {
/**
* The transaction ID of the accepted UTXO.
*/
'txid' : [] | [Uint8Array],
/**
* UTXO's output index within the BTC transaction.
*/
'vout' : [] | [number],
/**
* The Bitcoin check fee.
*/
'kyt_fee' : [] | [bigint],
}
};
export type MinterArg = { 'Upgrade' : [] | [UpgradeArgs] } |
{ 'Init' : InitArgs };
export interface MinterInfo {
Expand All @@ -258,6 +409,11 @@ export interface MinterInfo {
* initialization or upgrades, but may vary according to current network fees.
*/
'retrieve_btc_min_amount' : bigint,
/**
* Minimal amount of BTC that can be deposited to be converted into ckBTC.
* UTXOs with lower values will be ignored.
*/
'deposit_btc_min_amount' : [] | [bigint],
'min_confirmations' : number,
/**
* The same as `check_fee`, but the old name is kept here to be backward compatible.
Expand Down Expand Up @@ -546,6 +702,19 @@ export type RetrieveBtcWithApprovalError = {
*/
'InsufficientFunds' : { 'balance' : bigint }
};
export type Status = { 'CallFailed' : null } |
{
/**
* The minter rejected a retrieve_btc due to a failed Bitcoin check.
*/
'Rejected' : null
} |
{
/**
* The minter accepted a retrieve_btc request.
*/
'Accepted' : null
};
export type SuspendedReason = {
/**
* The minter ignored this UTXO because UTXO's value is too small to pay
Expand Down Expand Up @@ -618,6 +787,11 @@ export interface UpgradeArgs {
* The minimal amount of ckBTC that the minter converts to BTC.
*/
'retrieve_btc_min_amount' : [] | [bigint],
/**
* The minimal amount of BTC that can be converted to ckBTC.
* UTXOs with lower values will be ignored.
*/
'deposit_btc_min_amount' : [] | [bigint],
/**
* / Maximum time in nanoseconds that a transaction should spend in the queue
* / before being sent.
Expand All @@ -627,6 +801,14 @@ export interface UpgradeArgs {
* / The fee per Bitcoin check.
*/
'check_fee' : [] | [bigint],
/**
* / The maximum number of input UTXOs allowed in a transaction.
*/
'max_num_inputs_in_transaction' : [] | [bigint],
/**
* / The minimum number of available UTXOs to trigger a consolidation.
*/
'utxo_consolidation_threshold' : [] | [bigint],
/**
* / The principal of the Bitcoin checker canister.
*/
Expand Down Expand Up @@ -686,6 +868,14 @@ export type WithdrawalReimbursementReason = {
};
export interface environment_variable { 'value' : string, 'name' : string }
export interface _SERVICE {
/**
* Section "Transaction Information" {{{
* Returns information related to minter transactions.
*/
'decode_ledger_memo' : ActorMethod<
[DecodeLedgerMemoArgs],
DecodeLedgerMemoResult
>,
/**
* / Returns an estimate of the user's fee (in Satoshi) for a
* / retrieve_btc request based on the current status of the Bitcoin network.
Expand Down
Loading
Loading