> ## Documentation Index
> Fetch the complete documentation index at: https://docs.swap.coffee/llms.txt
> Use this file to discover all available pages before exploring further.

# Events Workflow

> These events allow for enhanced monitoring, reporting, and analytics.

## Overview

Each of these **events** provides critical information that can be used to monitor user interactions, improve platform functionality, and generate comprehensive analytics reports.

### Supported Events

Here are the events we currently support:

***

****event\_route\_built**** - `Triggered when a route is built`.

****event\_token\_changed**** - `Triggered when the selected token changes`.

****event\_swap\_settings\_updated**** - `Triggered when the swap settings are updated`.

****event\_token\_imported**** - `Triggered when a token is imported`.

****event\_transactions\_built**** - `Triggered when a set of transactions is built`.

****event\_swap\_result\_received**** - `Triggered when the swap result is received`.

****event\_wallet\_connected**** - `Triggered on wallet successfully connected`

****event\_wallet\_disconnected**** - `Triggered when wallet was disconnected`

****event\_swap\_started**** - `Triggered when SWAP transaction confirmed by wallet and started`

****event\_swap\_completed**** - `Triggered when SWAP or MultiSwap operation completed`

****event\_multi\_swap\_started**** - `Triggered when MultiSwap transaction confirmed by wallet and started`

***

### How to Listen our Events

To listen for these **events** on the client side, you can use the `addEventListener` method. Here's how you can listen `event_route_built` event as example:

```typescript theme={null}

// Event listener for the 'event_route_built' event

window.addEventListener('event_route_built', (event) => {
  console.log('Route build, details:', event.detail);
});

```

### Event Detail

Each of these events carries additional data that can be accessed through `event.detail`. For example:

* **`event_route_built`**: Contains information about the route, including the tokens involved and estimated fees.
* **`event_token_changed`**: Contains the details of the token that has been changed.
* **`event_swap_settings_updated`**: Contains the updated swap settings.
* **`event_token_imported`**: Contains the details of the imported token.
* **`event_transactions_built`**: Contains the details of the built transactions.
* **`event_swap_result_received`**: Contains the result of the swap.
* **`event_wallet_connected`**: Contains information about the connected wallet, including wallet type and address.
* **`event_wallet_disconnected`**: Contains information about the disconnected wallet.
* **`event_swap_started`**: Contains details about the started swap transaction, including transaction hash and tokens involved.
* **`event_swap_completed`**: Contains the final result of the completed swap operation, including success status and transaction details.
* **`event_multi_swap_started`**: Contains details about the started multi-swap transaction, including transaction hash and involved token pairs.

## Conclusion

By following the guidelines outlined in this documentation, you can effectively manage events such as route building, token changes, swap settings updates, and more.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.