Skip to content

CkBTCMinterCanister

Defined in: packages/ckbtc/src/minter.canister.ts:42

  • Canister<CkBTCMinterService>

protected new CkBTCMinterCanister(id, service, certifiedService): CkBTCMinterCanister

Defined in: packages/utils/dist/services/canister.d.ts:7

Principal

_SERVICE

_SERVICE

CkBTCMinterCanister

Canister<CkBTCMinterService>.constructor

protected caller: (__namedParameters) => _SERVICE

Defined in: packages/utils/dist/services/canister.d.ts:9

QueryParams

_SERVICE

Canister.caller


protected readonly certifiedService: _SERVICE

Defined in: packages/utils/dist/services/canister.d.ts:6

Canister.certifiedService


protected readonly service: _SERVICE

Defined in: packages/utils/dist/services/canister.d.ts:5

Canister.service

get canisterId(): Principal

Defined in: packages/utils/dist/services/canister.d.ts:8

Principal

Canister.canisterId

estimateWithdrawalFee(params): Promise<EstimateWithdrawalFee>

Defined in: packages/ckbtc/src/minter.canister.ts:239

Returns an estimation of the user’s fee (in Satoshi) for a retrieve_btc request based on the current status of the Bitcoin network and the fee related to the minter.

EstimateWithdrawalFeeParams

The parameters to estimate the fee.

Promise<EstimateWithdrawalFee>


getBtcAddress(params): Promise<string>

Defined in: packages/ckbtc/src/minter.canister.ts:64

Returns a BTC address for a given account.

Note: an update call is required by the Minter canister.

MinterParams

The parameters for which a BTC address should be resolved.

Promise<string>

The BTC address of the given account.


getKnownUtxos(params): Promise<Utxo[]>

Defined in: packages/ckbtc/src/minter.canister.ts:266

Returns UTXOs of the given account known by the minter.

GetKnownUtxosParams

The parameters for which the known utxos should be resolved.

Promise<Utxo[]>

The known utxos (with no guarantee in the ordering).


getMinterInfo(params): Promise<MinterInfo>

Defined in: packages/ckbtc/src/minter.canister.ts:253

Returns internal minter parameters such as the minimal amount to retrieve BTC, minimal number of confirmations or KYT fee.

QueryParams

The parameters to get the minter info.

Promise<MinterInfo>


getWithdrawalAccount(): Promise<Account>

Defined in: packages/ckbtc/src/minter.canister.ts:106

Returns the account to which the caller should deposit ckBTC before withdrawing BTC using the [retrieveBtc] endpoint.

Promise<Account>

The account to which ckBTC needs to be transferred. Provide corresponding information to map an Icrc1 account.


retrieveBtc(params): Promise<RetrieveBtcOk>

Defined in: packages/ckbtc/src/minter.canister.ts:125

Submits a request to convert ckBTC to BTC.

Note:

The BTC retrieval process is slow. Instead of synchronously waiting for a BTC transaction to settle, this method returns a request ([block_index]) that the caller can use to query the request status.

Preconditions:

The caller deposited the requested amount in ckBTC to the account that the [getWithdrawalAccount] endpoint returns.

RetrieveBtcParams

The parameters are the bitcoin address and amount to convert.

Promise<RetrieveBtcOk>

The result or the operation.


retrieveBtcStatus(transactionId): Promise<RetrieveBtcStatus>

Defined in: packages/ckbtc/src/minter.canister.ts:187

Returns the status of a specific BTC withdrawal based on the transaction ID of the corresponding burn transaction.

The ID of the corresponding burn transaction.

boolean

bigint

Promise<RetrieveBtcStatus>

The status of the BTC retrieval request.


retrieveBtcStatusV2ByAccount(certified): Promise<RetrieveBtcStatusV2WithId[]>

Defined in: packages/ckbtc/src/minter.canister.ts:205

Returns the status of all BTC withdrawals for an account.

RetrieveBtcStatusV2ByAccountParams

query or update call

Promise<RetrieveBtcStatusV2WithId[]>

The statuses of the BTC retrieval requests.


retrieveBtcWithApproval(__namedParameters): Promise<RetrieveBtcOk>

Defined in: packages/ckbtc/src/minter.canister.ts:155

Submits a request to convert ckBTC to BTC after making an ICRC-2 approval.

The BTC retrieval process is slow. Instead of synchronously waiting for a BTC transaction to settle, this method returns a request ([block_index]) that the caller can use to query the request status.

The caller allowed the minter’s principal to spend its funds using [icrc2_approve] on the ckBTC ledger.

string

bigint

Uint8Array<ArrayBufferLike>

Promise<RetrieveBtcOk>

The result or the operation.


updateBalance(params): Promise<UpdateBalanceOk>

Defined in: packages/ckbtc/src/minter.canister.ts:83

Notify the minter about the bitcoin transfer.

Upon successful notification, new ckBTC should be available on the targeted address.

MinterParams

The parameters are the address to which bitcoin where transferred.

Promise<UpdateBalanceOk>

The result of the balance update.


static create(options): CkBTCMinterCanister

Defined in: packages/ckbtc/src/minter.canister.ts:43

CkBTCCanisterOptions<_SERVICE>

CkBTCMinterCanister