@dfinity/ckbtc
v8.0.0
Published
A library for interfacing with ckBTC.
Readme
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/ckbtcThe bundle needs peer dependencies, be sure that following resources are available in your project as well.
npm i @icp-sdk/core @dfinity/utilsUsage
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.
