# @onekeyhq/blockchain-link

> High-level javascript interface for blockchain communication

Latest version **1.0.19** (published 2022-01-05) · SEE LICENSE IN LICENSE.md license · 0 weekly downloads

## Install

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

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.19 |
| Published | 2022-01-05 |
| First published | 2022-01-05 |
| Weekly downloads | 0 |
| License | SEE LICENSE IN LICENSE.md |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 4.7 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | OneKey |
| Maintainers | loatheb |
| Keywords | OneKey, blockchain, blockbook, javascript |

## Links

- npm: https://www.npmjs.com/package/@onekeyhq/blockchain-link
- Repository: https://github.com:OneKeyHQ/OneKey-Desktop
- Homepage: https://github.com/OneKeyHQ/OneKey-Desktop/packages/blockchain-link
- Issues: https://github.com/OneKeyHQ/OneKey-Desktop/issues
- npm.io page: https://npm.io/package/@onekeyhq/blockchain-link

## Dependencies (6)

- [ws](https://npm.io/package/ws.md) ^7.4.0
- [events](https://npm.io/package/events.md) ^3.2.0
- [ripple-lib](https://npm.io/package/ripple-lib.md) 1.8.2
- [es6-promise](https://npm.io/package/es6-promise.md) ^4.2.8
- [tiny-worker](https://npm.io/package/tiny-worker.md) ^2.3.0
- [bignumber.js](https://npm.io/package/bignumber.js.md) ^9.0.1

## Recent versions

- 1.0.19 (latest) — 2022-01-05

## README

# @onekeyhq/blockchain-link

API for communication with blockchain backends.
Every type of a backed is isolated inside own worker file.
Currently supported:

-   [blockbook](https://github.com/onekeyhq/blockbook/)
-   [ripple-lib](https://github.com/ripple/ripple-lib/)

## Development:

Compile and run with simple ui for the API methods.

```
yarn
yarn dev
```

## Build

```
yarn lint
yarn test
yarn build
```

## Integration

```
yarn add @onekeyhq/blockchain-link
```

```
import BlockchainLink from '@onekeyhq/blockchain-link';

const link = new BlockchainLink({
    name: string;
    worker: string;
    server: string[];
    debug: boolean;
});

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

}
```

## Workers compilation

Workers are already builded and minified inside `@onekeyhq/blockchain-link/build/` directory.

Then set your project to compile and provide those workers into blockchain-link instance.
An webpack configuration example using `worker-loader` could be found in [here](./webpack/dev.babel.js)

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