Events Handler

You can choose whether to provide an events handler during the mobile and web Software Development Kits (SDKs) setup for the Fireblocks Non-Custodial Wallet (NCW). The events handler activates during different operations within the SDK and keeps you in the loop about significant occurrences, such as key generation, backup and recovery, and transaction signing.

The events handler can be tailored to match your application's needs. It can be designed to execute various actions, such as refreshing the user interface, recording events, dispatching notifications, or initiating other behaviors specific to your application's functionality.

The events handler object should be provided when initializing the NCW SDK. It must implement the following method (following a defined interface):

handleEvent(event: Event): void: The method invoked whenever there's a new event.

export interface IEventsHandler {  
  handleEvent(event: TEvent): void;  
}
interface FireblocksEventHandler {

    /**
     * Listens to various Fireblocks events see [Event]. Each event has relevant information.
     * In addition, in case of an error we will add the [FireblocksError] with the relevant error code
     */
    fun onEvent(event: Event)
}

public protocol EventHandlerDelegate: AnyObject {
    /// Listens to various Fireblocks events [FireblocksEvent]. Each event has relevant information.
    /// In addition, in case of an error we will add the FireblocksError with the relevant error code
    /// - Parameter event: FireblocksEvent
     func onEvent(event: FireblocksEvent)
}