@codewarriorr/btcv-api-client
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.2 • Public • Published

    BTCV api client

    TypeScript 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 BTCV methods described in Electrum Protocol methods documentation.

    Install

    npm install --save @codewarriorr/btcv-api-client
    

    Usage

    const { BtcvApiClient } = require('@codewarriorr/btcv-api-client');
    
    async function main() {
      const config = {
        host: '127.0.0.1',
        port: 5002,
        protocol: 'ssl',
      };
      const client = new BtcvApiClient(config);
    
      try {
        await client.connect();
    
        const header = await client.getCurrentBlock();
        console.log('Current header:', header);
      } catch (err) {
        console.error(err);
      } finally {
        await client.close();
      }
    }
    
    main();

    See more examples.

    Install

    npm i @codewarriorr/btcv-api-client

    DownloadsWeekly Downloads

    1

    Version

    1.0.2

    License

    MIT

    Unpacked Size

    40.6 kB

    Total Files

    23

    Last publish

    Collaborators

    • codewarriorr