ws-electrumx-client
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

ws-electrumx-client

Light electrum x websocket client.

Installation

npm install ws-electrumx-client
# or with yarn
yarn add ws-electrumx-client

Usage

import { ElectrumWS } from 'ws-electrumx-client';

const electrum = new ElectrumWS('wss://blockstream.info/liquidtestnet/electrum-websocket/api');
const response = await electrum.batchRequest(
  {
    method: 'blockchain.estimatefee',
    params: [1],
  },
  {
    method: 'blockchain.block.header',
    params: [1],
  }
);

Development

Setup

yarn install

Build

yarn build

Test

Some tests requires nigiri to be installed and running as well as a websocat instance mapping the electrumx port to a local ws endpoint.

nigiri start --liquid

You can map the nigiri electrum port to a local websocket endpoint using solsson/websocat docker image:

docker run --net=host solsson/websocat -b ws-l:127.0.0.1:1234 tcp:127.0.0.1:50001&

Then you can run the unit tests:

yarn test

Test coverage

yarn cov

Documentation

Generate and open in browser an HTML TypeDoc documentation:

yarn doc

Linter and Formatter

yarn fix

Acknowledgements

Readme

Keywords

none

Package Sidebar

Install

npm i ws-electrumx-client

Weekly Downloads

26

Version

1.0.5

License

MIT

Unpacked Size

147 kB

Total Files

35

Last publish

Collaborators

  • louisinger
  • altafan
  • tiero