ckbtc-js
A library for interfacing with ckBTC on the Internet Computer.

[!TIP]
Still using @dfinity/ckbtc? Upgrade to @icp-sdk/canisters/ckbtc!
Table of contents
Installation
You can use ckbtc-js by installing it in your project.
npm i @dfinity/ckbtc
The bundle needs peer dependencies, be sure that following resources are available in your project as well.
npm i @icp-sdk/core @dfinity/utils
Usage
The features are available through the class CkBTCMinterCanister. It has to be instantiated with a canister ID.
import { CkBTCMinterCanister } from "@dfinity/ckbtc";
import { createAgent } from "@dfinity/utils";
const agent = await createAgent({
identity,
host: HOST,
});
const { getBtcAddress } = CkBTCMinterCanister.create({
agent,
canisterId: MY_CKBTC_MINTER_CANISTER_ID,
});
const btcAddress = await getBtcAddress({});
Documentation
You can find the API docs here.
Resources