2.3.3 • Published 1 month ago

@dfinity/ckbtc v2.3.3

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
1 month ago

ckbtc-js

A library for interfacing with ckBTC on the Internet Computer.

npm version GitHub license

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 @dfinity/agent @dfinity/candid @dfinity/principal @dfinity/utils

Usage

The features are available through the class LedgerCanister. It has to be instantiated with a canister ID.

e.g. fetching a token metadata.

import { CkBTCCanister } from "@dfinity/ckbtc";
import { createAgent } from "@dfinity/utils";

const agent = await createAgent({
  identity,
  host: HOST,
});

const { getBtcAddress } = CkBTCCanister.create({
  agent,
  canisterId: MY_CKBTC_MINTER_CANISTER_ID,
});

const btcAddress = await getBtcAddress({});

Features

ckbtc-js implements following features:

:factory: CkBTCMinterCanister

Constructors

public

Methods

:gear: create
MethodType
create(options: CkBTCMinterCanisterOptions<_SERVICE>) => CkBTCMinterCanister
:gear: getBtcAddress

Returns a BTC address for a given account.

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

MethodType
getBtcAddress(params: GetBTCAddressParams) => Promise<string>

Parameters:

  • params: The parameters for which a BTC address should be resolved.
  • params.owner: The owner for which the BTC address should be generated. If not provided, the caller will be use instead.
  • params.subaccount: An optional subaccount to compute the address.
2.3.3

1 month ago

2.3.2

2 months ago

2.3.1

3 months ago

2.3.0

4 months ago

2.2.1

4 months ago

2.2.0

4 months ago

2.1.1

5 months ago

2.1.0

6 months ago

0.0.10

10 months ago

0.0.11

10 months ago

0.0.9

10 months ago

0.0.8

11 months ago

0.0.7

12 months ago

2.0.0

7 months ago

1.1.0

7 months ago

1.0.1

9 months ago

1.0.0

9 months ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.6

12 months ago

0.0.1

1 year ago