> ## Documentation Index
> Fetch the complete documentation index at: https://cantonfoundation-generated-references-canton-protobuf-histo.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Events

> Connection, account, and transaction events emitted by the dApp SDK.

The dApp SDK emits events so your UI can stay in sync with the wallet's state. Subscribe
with the `on*` functions and unsubscribe with the matching `off*` function. For usage
examples, see [Handle Events](/sdks-tools/sdks/dapp-sdk/guides/handle-events).

## `onStatusChanged(handler)` / `offStatusChanged(handler)`

Fires when the connection status or session state changes.

| Payload field | Type | Description |
| - | - | - |
| `connection.isConnected` | `boolean` | Whether a session is currently active. |

## `onAccountsChanged(handler)` / `offAccountsChanged(handler)`

Fires when accounts are added or removed, or the primary account changes.

| Payload | Type | Description |
| - | - | - |
| `accounts` | `Account[]` | The current set of parties. |

## `onTxChanged(handler)` / `offTxChanged(handler)`

Fires as a transaction submitted via `prepareExecute` moves through its lifecycle.

| Payload field | Type | Description |
| - | - | - |
| `status` | `'pending' \| 'signed' \| 'executed' \| 'failed'` | Current transaction state. |
| `payload.updateId` | `string` | Ledger update ID (present when `executed`). |

## Related

* [Handle Events](/sdks-tools/sdks/dapp-sdk/guides/handle-events) — Examples for subscribing to and cleaning up these events.
* [SDK Methods](/sdks-tools/sdks/dapp-sdk/reference/sdk-methods) — The functions that trigger these events.
