Called when the connection drops without close(), so the caller can pick a new server.
Readonly urlTrue while the socket is open and requests can be sent.
Listens for a notification, e.g. blockchain.headers.subscribe after
subscribing to it with request.
a function that stops listening
Listens for a notification, e.g. blockchain.headers.subscribe after
subscribing to it with request.
a function that stops listening
Asks the server one question.
an ElectrumX method, e.g. blockchain.transaction.get
its parameters
whatever the server answers; a result of 0, false or null stays that value
Error ESOCKET without a connection, ETIMEDOUT <method> when the
answer stays away, or the server's own error message
A client for one ElectrumX server.
It answers requests, hands notifications to listeners, keeps an idle connection open with a ping, and says when the connection is gone – it does not reconnect: which server to use next is the application's decision.
Example