🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis
Socket
Book a DemoInstallSign in
Socket

@dfinity/ckbtc

Package Overview
Dependencies
Maintainers
10
Versions
793
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dfinity/ckbtc

A library for interfacing with ckBTC.

Source
npmnpm
Version
0.0.2-next-2023-02-08
Version published
Weekly downloads
4.1K
-0.67%
Maintainers
10
Weekly downloads
 
Created
Source

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.

Keywords

internet computer

FAQs

Package last updated on 08 Feb 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts