@onekeyfe/blockchain-link
Version:
High-level javascript interface for blockchain communication
56 lines (39 loc) • 1.03 kB
Markdown
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/)
Compile and run with simple ui for the API methods.
```
yarn
yarn dev
```
```
yarn lint
yarn test
yarn build
```
```
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 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)