Skip to content

BitcoinCanister

Defined in: packages/ckbtc/src/bitcoin.canister.ts:17

  • Canister<BitcoinService>

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

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

Principal

_SERVICE

_SERVICE

BitcoinCanister

Canister<BitcoinService>.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

getBalanceQuery(params): Promise<bigint>

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

Given a get_balance_request, which must specify a Bitcoin address and a Bitcoin network (mainnet, testnet or regtest), the function returns the current balance of this address in Satoshi (10^8 Satoshi = 1 Bitcoin) in the specified Bitcoin network.

⚠️ Note that this method does not support certified calls because only canisters are allowed to get Bitcoin balance via update calls.

GetBalanceParams

Promise<bigint>

The balance is returned in Satoshi (10^8 Satoshi = 1 Bitcoin).

https://internetcomputer.org/docs/current/references/ic-interface-spec#ic-bitcoin_get_balance


getUtxosQuery(params): Promise<get_utxos_response>

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

Given a get_utxos_request, which must specify a Bitcoin address and a Bitcoin network (mainnet, testnet or regtest), the function returns all unspent transaction outputs (UTXOs) associated with the provided address in the specified Bitcoin network based on the current view of the Bitcoin blockchain available to the Bitcoin component.

⚠️ Note that this method does not support certified calls because only canisters are allowed to get UTXOs via update calls.

GetUtxosParams

Promise<get_utxos_response>

The UTXOs are returned sorted by block height in descending order.

https://internetcomputer.org/docs/current/references/ic-interface-spec#ic-bitcoin_get_utxos


static create(options): BitcoinCanister

Defined in: packages/ckbtc/src/bitcoin.canister.ts:18

CkBTCCanisterOptions<_SERVICE>

BitcoinCanister