SparkWallet extends EventEmitter, so it inherits the following methods for handling events.
Available Events
The
updatedBalance parameter is a bigint representing the wallet’s new total balance in satoshis after the event.on(event: string, listener: Function)
Adds a listener for the specified event.Parameters
string
required
The event name to listen for
Function
required
The callback function to execute when the event is emitted
Returns
this
required
The SparkWallet instance for chaining
Example
once(event: string, listener: Function)
Adds a one-time listener for the specified event.Parameters
string
required
The event name to listen for
Function
required
The callback function to execute when the event is emitted
Returns
this
required
The SparkWallet instance for chaining
Example
off(event: string, listener: Function)
Removes the specified listener from the specified event.Parameters
string
required
The event name
Function
required
The callback function to remove
Returns
this
required
The SparkWallet instance for chaining