@gemlinkofficial/electrum-client-webpack
TypeScript icon, indicating that this package has built-in type declarations

0.1.24 • Public • Published

electrum-client-ts

JavaScript implementation of Electrum Protocol Client.

This is a library that can communicate with the ElectrumX Server on tcp, ssl, ws and wss protocols.

Works in node.js and browser.

Implements methods described in Electrum Protocol methods documentation.

Subscriptions and notifications are also supported, please see example.

Install

npm install --save @gemlinkofficial/electrum-client-ts

Usage

import { ElectrumClient } from "@gemlinkofficial/electrum-client-webpack";
async function main() {
  const client = new ElectrumClient("electrum.bitaroo.net", 50002, "ssl");

  try {
    await client.connect(
      "electrum-client-webpack", // optional client name
      "1.4.2" // optional protocol version
    );

    const header = await client.blockchain_headers_subscribe();
    console.log("Current header:", header);

    await client.close();
  } catch (err) {
    console.error(err);
  }
}

main();

See more examples.

Readme

Keywords

Package Sidebar

Install

npm i @gemlinkofficial/electrum-client-webpack

Weekly Downloads

2

Version

0.1.24

License

MIT

Unpacked Size

69.1 kB

Total Files

46

Last publish

Collaborators

  • gemlinkofficial