Checks if the connection to the server is alive.
For the Electrum client, this method directly checks the server's
availability by sending a ping.
It returns true if the ping is successful, otherwise false.
For the Esplora client, this method checks the server's availability by
attempting to fetch the current block height.
Note that the Esplora client returns true even after closing the
connection, because an HTTP connection is stateless and not persistent.
Thus, for Esplora, isConnected effectively checks if the server can
respond to requests.
Promise resolving to true if the server is
reachable and responding; otherwise, false.
Returns true if connect has never been called or if close() was called after a connect().
Close the connection.
Get the balance of an address and find out whether the address ever received some coins.
A Bitcoin address
An object with 'balance' & confirmedTxCount properties.
Get the balance of a scriptHash and find out whether the scriptHash ever received some coins.
A Bitcoin scriptHash
An object with 'balance' & txCount properties.
Fetches the transaction history for a given address or script hash.
The parameters for the method.
Optionaladdress?: stringThe address to fetch transaction history for.
OptionalscriptHash?: stringThe script hash to fetch transaction history for.
A promise that resolves to an array containing
transaction history, each item is an object containing txId, blockHeight and irreversible.
txId is the transaction ID, blockHeight is the height of the block that includes the transaction,
and irreversible is a boolean indicating whether the transaction has reached the irreversible confirmation threshold (set to IRREV_CONF_THRESH confirmations).
They are returned in blockchain order. However, esplora might not respect
order when txs belong to the same block. See https://github.com/Blockstream/esplora/issues/165
Get an object where the key is the confirmation target (in number of blocks) and the value is the estimated feerate (in sat/vB).
The available confirmation targets are 1-25, 144, 504 and 1008 blocks.
An object where the key is the confirmation target (in number of blocks).
Get's the BlockStatus: { blockHeight: number; blockHash: string; blockTime: number; })
of a certain blockHeight.
Returns undefined if this block height has not been mined yet.
BlockStatus | undefined;
Get's current block height (blockchain tip).
A number representing the current height.
Connect to the server.