Skip to content

Canada-eCoin/electrum-client-js

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

electrum-client-js

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 github:Canada-eCoin/electrum-client-js

Usage

const ElectrumClient = require('@eCoinCore/electrum-client-js')

async function main() {
  const client = new ElectrumClient(
    'explorer.canadaecoin.ca',
    50002,
    'ssl'
  )

  try {
    await client.connect(
      'electrum-client-js', // 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.

About

Electrum Client for node.js

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%