This is emitted whenever the interface fails to contact the underlying daemon. This event will only be emitted on the first disconnection. It will not be emitted again, until the daemon connects, and then disconnects again.
Example:
daemon.on('disconnect', (error) => {
console.log('Possibly lost connection to daemon: ' + error.toString());
});
This is emitted whenever the interface previously failed to contact the underlying daemon, and has now reconnected. This event will only be emitted on the first connection. It will not be emitted again, until the daemon disconnects, and then reconnects again.
Example:
daemon.on('connect', () => {
console.log('Regained connection to daemon!');
});
This is emitted whenever either the localDaemonBlockCount or the networkDaemonBlockCount changes.
Example:
daemon.on('heightchange', (localDaemonBlockCount, networkDaemonBlockCount) => {
console.log(localDaemonBlockCount, networkDaemonBlockCount);
});
@event
Get any transactions which we have sent, but are no longer present in the pool or a block. (They have returned to our wallet)
Returns information on the daemon connection such as host and port
Returns host:port
Returns a mapping of transaction hashes to global indexes
Get global indexes for the transactions in the range [startHeight, endHeight]
Returns the height that the local daemon has.
Returns the height that the network has. Possibly 0 if can't connect to daemon
Gets random outputs for the given amounts. requestedOuts per. Usually mixin+1.
Returns an array of amounts to global indexes and keys. There should be requestedOuts indexes if the daemon fully fulfilled our request.
Hashes of the last known blocks. Later blocks (higher block height) should be ordered at the front of the array.
Height to start taking blocks from
Block timestamp to start taking blocks from
Gets blocks from the daemon. Blocks are returned starting from the last known block hash (if higher than the startHeight/startTimestamp)
Returns TopBlock data if daemon is synced, and daemon supports this feature.
Initializes the daemon if necessary, with node fee and internal data
Gets the node fee address and amount. Will be ['', 0]
if none/invalid
Sends a raw serialized transaction to the daemon. Returns true/false based on daemon status.
Will throw on timeout.
Whether the transaction was accepted and an optional extra error message.
Updates the internal config with the passed in config.
Updates internal daemon info
Generated using TypeDoc
Provides an interface to a daemon or similar, such as a blockchain cache