Various types of events are triggered as a result of different scenarios and states. You can subscribe to these events to implement your custom logic in your dApp. The events emitted from the widget can be categorized into four distinct groups, each of which is explained below.
There are different events that will be triggered:
Once a user executes a route within Rango Widget, various events will be triggered depending on the different states of the route. You can subscribe to these events to implement your custom logic related to executing routes. For instance, you can display a personalized notification whenever a route succeeds or fails.
Once a user executes a swap within Rango Widget, various events will be triggered depending on the different states of each step transactions. You can subscribe to these events to implement your custom logic related to executing steps of each transaction. For instance, you can display a personalized notification whenever a step of a transaction succeeds or fails.
Once a user connects or disconnects a wallet within Rango Widget, various events will be triggered depending on the different states of the wallet. You can subscribe to these events to implement your custom logic related connecting or disconnecting wallets. For instance, you can display a personalized notification whenever a wallet connects or disconnects.
Once inputs or outputs for a quote gets updated within Rango Widget, various events will be triggered to demonstrate the changes in inputs and output. You can subscribe to these events to implement your custom logic related to updating inputs and outputs. For instance, you can update the ui of your website if a certain blockchain or token is selected in inputs.
Once a user does some certain actions on the widget UI, various events will be triggered depending on the action of user. You can subscribe to these events to implement your custom logic related to actions of users. For instance, you can display a personalized wallet connect modal when user clicks on "Connect Wallet" button in the widget.
Note: Currently, the only event triggered from UI is click on "Connect Wallet" button.