Events
You can listen to specific events such as onTransactionSuccess
, onTransactionError
, onWidgetClose
and onWidgetOpen
FKEvents
The FKEvents
defines callback functions for various events that can occur during the operation of the widget. Here's a breakdown of each event:
onTransactionSuccess
(data: TransactionSuccessData) => void
| undefined
Called when a transaction is successful.
onTransactionError
(data: TransactionErrorData) => void
| undefined
Called when a transaction encounters an error.
onWidgetClose
(error?: Error) => void
| undefined
Called when the widget is closed.
onWidgetOpen
() => void
| undefined
Called when the widget is opened.
Event Data Types
TransactionSuccessData
status
string
The status of the transaction.
message
string
A message describing the transaction result.
data
object
Additional data about the transaction.
data.txHash
string | undefined
The transaction hash, if available.
data[key: string]
string | number | undefined
Any additional key-value pairs.
TransactionErrorData
status
string
The status of the transaction (presumably an error status).
message
string
A message describing the error.
data
string
Additional data about the error.
Example
Last updated