Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/you21979/node-electrum-client
Electrum Client for node.js
https://github.com/you21979/node-electrum-client
bitcoin client electrum
Last synced: about 5 hours ago
JSON representation
Electrum Client for node.js
- Host: GitHub
- URL: https://github.com/you21979/node-electrum-client
- Owner: you21979
- License: mit
- Created: 2017-06-22T06:40:36.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-11-01T11:53:44.000Z (about 1 year ago)
- Last Synced: 2024-10-03T00:11:02.242Z (about 1 month ago)
- Topics: bitcoin, client, electrum
- Language: JavaScript
- Homepage:
- Size: 90.8 KB
- Stars: 32
- Watchers: 5
- Forks: 115
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-bitcoin-sv - Electrum Client - Electrum Protocol Client for Node.js. (Libraries / Applications)
README
# node-electrum-client
Electrum Protocol Client for Node.js
## what is this
https://electrum.org/
electrum is bitcoin wallet service.
This is a library of Node.js that can communicate with the electrum(x) server.## install
```
npm i electrum-client
```## spec
* TCP / TLS
* JSON-RPC
* Subscribe Message
* High Performance Message
* no dependency for other library## protocol spec
* https://electrumx.readthedocs.io/en/latest/PROTOCOL.html
## usage
```
const ElectrumCli = require('electrum-client')
const main = async () => {
const ecl = new ElectrumCli(995, 'btc.smsys.me', 'tls') // tcp or tls
await ecl.connect() // connect(promise)
ecl.subscribe.on('blockchain.headers.subscribe', (v) => console.log(v)) // subscribe message(EventEmitter)
try{
const ver = await ecl.server_version("2.7.11", "1.0") // json-rpc(promise)
console.log(ver)
}catch(e){
console.log(e)
}
await ecl.close() // disconnect(promise)
}
main()
```