# bdk

> BDK bindings for node

Latest version **0.0.0** (published 2023-02-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install bdk
pnpm add bdk
yarn add bdk
bun add bdk
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.0 |
| Published | 2023-02-10 |
| First published | 2023-02-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >= 10 |
| Dependencies | 3 |
| Unpacked size | 12.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Maintainers | mcroad |

## Links

- npm: https://www.npmjs.com/package/bdk
- Repository: https://github.com/mcroad/node-bdk
- Homepage: https://github.com/mcroad/node-bdk#readme
- Issues: https://github.com/mcroad/node-bdk/issues
- npm.io page: https://npm.io/package/bdk

## Dependencies (3)

- [bdk-darwin-x64](https://npm.io/package/bdk-darwin-x64.md) 0.0.0
- [bdk-linux-x64-gnu](https://npm.io/package/bdk-linux-x64-gnu.md) 0.0.0
- [bdk-win32-x64-msvc](https://npm.io/package/bdk-win32-x64-msvc.md) 0.0.0

## Recent versions

- 0.0.0 (latest) — 2023-02-10

## README

# node-bdk

### EXPERIMENTAL. DO NOT USE.

Use natively compiled [BDK](https://github.com/bitcoindevkit/bdk) in a nodejs context with TypeScript typings. Extremely experimental. Uses https://napi.rs/ to generate bindings.

Inspired by [bdk-nodejs](https://github.com/danielabrozzoni/bdk-nodejs) and a week at [Bitcoin Park](https://bitcoinpark.co/).

## Supported features

- [x] Create a wallet
- [x] Sync to Electrum
- [x] Get balance

## Example

```ts
import { ElectrumBlockchain, Wallet, Network } from 'bdk';

const wallet = new Wallet(
  'wpkh([c258d2e4/84h/1h/0h]tpubDDYkZojQFQjht8Tm4jsS3iuEmKjTiEGjG6KnuFNKKJb5A6ZUCUZKdvLdSDWofKi4ToRCwb9poe1XdqfUnP4jaJjCB2Zwv11ZLgSbnZSNecE/0/*)',
  'wpkh([c258d2e4/84h/1h/0h]tpubDDYkZojQFQjht8Tm4jsS3iuEmKjTiEGjG6KnuFNKKJb5A6ZUCUZKdvLdSDWofKi4ToRCwb9poe1XdqfUnP4jaJjCB2Zwv11ZLgSbnZSNecE/1/*)',
  Network.Testnet,
);

const chain = new ElectrumBlockchain('ssl://electrum.blockstream.info:60002');
wallet.sync(chain);

const balance: bigint = wallet.getBalance();
console.log('balance', balance); // 5748838n
```

---
_Source: https://npm.io/package/bdk · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
