# @trezor/blockchain-link

> High-level javascript interface for blockchain communication

Latest version **10.0.1** (published 2026-09-25) · SEE LICENSE IN LICENSE.md license · 0 weekly downloads

## Install

```sh
npm install @trezor/blockchain-link
pnpm add @trezor/blockchain-link
yarn add @trezor/blockchain-link
bun add @trezor/blockchain-link
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 10.0.1 |
| Published | 2026-09-25 |
| First published | 2019-07-29 |
| Weekly downloads | 0 |
| License | SEE LICENSE IN LICENSE.md |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 12 |
| Unpacked size | 289.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 1064 |
| Author | Trezor <info@trezor.io> |
| Maintainers | prusnak, tsusanka-sl, trezor-ci, trezor-admin |
| Keywords | Trezor, blockchain, blockbook, javascript |

## Links

- npm: https://www.npmjs.com/package/@trezor/blockchain-link
- Repository: https://github.com/trezor/trezor-suite
- Homepage: https://github.com/trezor/trezor-suite/tree/develop/packages/blockchain-link
- Issues: https://github.com/trezor/trezor-suite/issues
- npm.io page: https://npm.io/package/@trezor/blockchain-link

## Dependencies (12)

- [viem](https://npm.io/package/viem.md) ^2.54.1
- [@types/web](https://npm.io/package/@types/web.md) ^0.0.345
- [@trezor/utils](https://npm.io/package/@trezor/utils.md) 10.0.1
- [@trezor/utxo-lib](https://npm.io/package/@trezor/utxo-lib.md) 10.0.1
- [@trezor/env-utils](https://npm.io/package/@trezor/env-utils.md) 10.0.1
- [socks-proxy-agent](https://npm.io/package/socks-proxy-agent.md) 8.0.5
- [@trezor/network-ripple](https://npm.io/package/@trezor/network-ripple.md) 10.0.1
- [@trezor/network-solana](https://npm.io/package/@trezor/network-solana.md) 10.0.1
- [@trezor/network-stellar](https://npm.io/package/@trezor/network-stellar.md) 10.0.1
- [@trezor/websocket-client](https://npm.io/package/@trezor/websocket-client.md) 10.0.1
- [@trezor/blockchain-link-types](https://npm.io/package/@trezor/blockchain-link-types.md) 10.0.1
- [@trezor/blockchain-link-utils](https://npm.io/package/@trezor/blockchain-link-utils.md) 10.0.1

## Recent versions

- 10.0.1 (latest) — 2026-09-25
- 10.0.0-beta.3 (beta) — 2026-09-17
- 10.0.0-alpha.1 (alpha) — 2026-05-15
- 1.0.0-rc1 (next) — 2019-07-29
- 10.0.0 — 2026-09-22
- 10.0.0-beta.2 — 2026-09-16
- 10.0.0-beta.1 — 2026-07-30
- 2.6.2 — 2026-04-22
- 2.6.1 — 2025-12-22
- 2.6.1-beta.1 — 2025-12-19
- 2.6.0 — 2025-12-16
- 2.6.0-beta.2 — 2025-12-09
- 2.6.0-beta.1 — 2025-11-25
- 2.5.5-beta.1 — 2025-11-12
- 2.5.4 — 2025-10-23
- … 102 more at https://npm.io/package/@trezor/blockchain-link/versions

## README

# @trezor/blockchain-link

[![NPM](https://img.shields.io/npm/v/@trezor/blockchain-link.svg)](https://www.npmjs.org/package/@trezor/blockchain-link)

blockchain-link is a client and unified interface for several backends (_BE_ further on) of various blockchain networks. Currently, there are implementations for

- [blockbook](https://github.com/trezor/blockbook): BE developed and deployed by SatoshiLabs. Provides access to Bitcoin(like) and Ethereum(like) networks.
- [ripple](https://xrpl.org/): third party BE that provides access to the Ripple network.
- [blockfrost](https://blockfrost.io): third party BE that provides access to the Cardano network.
- [electrum](https://electrumx-spesmilo.readthedocs.io/en/latest/): protocol implemented by multiple third party backends that provide access to the Bitcoin network.

## Usage

Add blockchain-link to your dependencies.

```shell
yarn add @trezor/blockchain-link
```

And use it.

```javascript
import { BlockchainLink } from '@trezor/blockchain-link';
import Blockbook from '@trezor/blockchain-link/lib/workers/blockbook/index.js';

const link = new BlockchainLink({
    name: 'Name used in logs.',
    worker: Blockbook,
    server: ['url1.of.the.be', 'url2.of.the.be'],
    debug: true,
});

try {
    const resp = link.getInfo();
} catch (error) {}
```

For complete API see the methods of `BlockchainLink` class in [index.ts](./src/index.ts).

## Workers

Each `src/workers/*/index` file can be used in WebWorker thread.
Built from source using webpack `worker-loader`:

```
import BlockbookWorker from 'worker-loader?filename=workers/blockbook-worker.[hash].js!@trezor/blockchain-link/lib/workers/blockbook/index.js';
```

## Development

This package provides a simple testing UI for playing around with various implementations and BEs.
Run UI with webworkers support

```shell
yarn workspace @trezor/blockchain-link dev
```

or without webworkers support (workers are compiled into a bundle)

```shell
yarn workspace @trezor/blockchain-link dev:module
```

### Tests

```
yarn workspace @trezor/blockchain-link lint
yarn workspace @trezor/blockchain-link type-check
yarn workspace @trezor/blockchain-link test:unit
```

### Integration tests

Testing `lib` and `build` outputs:

```
yarn workspace @trezor/blockchain-link build:lib
yarn workspace @trezor/blockchain-link build:workers
yarn workspace @trezor/blockchain-link test:integration
```

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