Giter Site home page Giter Site logo

ws-electrumx-client's Introduction

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

ws-electrumx-client's People

Contributors

louisinger avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

chautnguyen4392

ws-electrumx-client's Issues

Error message is not correct

The error message is for example sendrawtransactionRPCerror:{"code":-27,"message":"Transactionalreadyinblockchain"} when err.message should be Transactionalreadyinblockchain.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.