# ambiretech/extension architecture

> Architecture diagram of the GitHub repository ambiretech/extension, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ambiretech/extension
- Repository: https://github.com/ambiretech/extension

## Overview

Ambire Wallet is a self-custodial Ethereum/EVM wallet delivered across browser extensions and mobile apps. The user-facing product centers on managing accounts and interacting with on-chain activity; documented capabilities also include swap and bridge aggregation and Explore links to third-party sites. Internally, controller hooks expose controller actions and subscribed state to UI components. The graph preserves major platform and feature areas visible in the tree, but most route wiring and controller implementations were not sampled, so uncertain relationships are omitted or marked dashed.

Main entry points: [`src/web/modules/router/components/MainRoutes/MainRoutes.tsx`](https://github.com/ambiretech/extension/blob/main/src/web/modules/router/components/MainRoutes/MainRoutes.tsx) (Web wallet), [`src/mobile/modules/router/components/MainRoutes/MainRoutes.tsx`](https://github.com/ambiretech/extension/blob/main/src/mobile/modules/router/components/MainRoutes/MainRoutes.tsx) (Mobile wallet), [`src/common/modules/swap-and-bridge`](https://github.com/ambiretech/extension/tree/main/src/common/modules/swap-and-bridge) (Swap and bridge), [`src/common/modules/provider/ProviderController.ts`](https://github.com/ambiretech/extension/blob/main/src/common/modules/provider/ProviderController.ts) (Network provider)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_platform["Wallet platforms"]
  node_webapp["Web wallet<br/>[MainRoutes.tsx]"]
  node_mobileapp["Mobile wallet<br/>[MainRoutes.tsx]"]
end

subgraph group_account["Wallet services"]
  node_accountsetup["Account setup"]
  node_dapps["Dapp connections"]
  node_hardware["Hardware wallets"]
  node_storage[("Wallet storage<br/>[storage.web.ts]")]
  node_provider["Network provider"]
end

subgraph group_activity["Transactions"]
  node_txstatus["Operation tracking<br/>[useSteps.ts]"]
  node_benzin["Benzin status UI<br/>[BenzinScreen.tsx]"]
end

subgraph group_features["Wallet features"]
  node_swap["Swap and bridge"]
  node_routepreview["Route preview"]
  node_explore["Explore directory"]
  node_legends["Legends rewards"]
end

subgraph group_internal["Controller layer"]
  node_controllerhook["Controller access<br/>[useController.ts]"]
  node_controllerstate["Controller state"]
  node_middleware["Controller middleware"]
end

node_user(("Wallet user"))

node_user -.->|"uses"| node_webapp
node_user -.->|"uses"| node_mobileapp
node_webapp -.->|"manages accounts"| node_accountsetup
node_mobileapp -.->|"manages accounts"| node_accountsetup
node_webapp -.->|"connects dapps"| node_dapps
node_mobileapp -.->|"supports signing"| node_hardware
node_webapp -.->|"uses networks"| node_provider
node_mobileapp -.->|"uses networks"| node_provider
node_webapp -.->|"persists wallet data"| node_storage
node_mobileapp -.->|"persists wallet data"| node_storage
node_webapp -.->|"offers swaps"| node_swap
node_mobileapp -.->|"offers swaps"| node_swap
node_swap -.->|"shows route"| node_routepreview
node_webapp -.->|"opens directory"| node_explore
node_mobileapp -.->|"opens directory"| node_explore
node_webapp -.->|"offers rewards"| node_legends
node_mobileapp -.->|"tracks operations"| node_benzin
node_benzin -.->|"reads status"| node_txstatus
node_controllerhook -->|"subscribes to"| node_controllerstate
node_controllerhook -->|"dispatches actions"| node_middleware
node_txstatus -.->|"fetches operation data"| node_provider

click node_webapp "https://github.com/ambiretech/extension/blob/main/src/web/modules/router/components/MainRoutes/MainRoutes.tsx"
click node_mobileapp "https://github.com/ambiretech/extension/blob/main/src/mobile/modules/router/components/MainRoutes/MainRoutes.tsx"
click node_accountsetup "https://github.com/ambiretech/extension/blob/main/src/common/constants/controllersMapping.ts"
click node_dapps "https://github.com/ambiretech/extension/blob/main/src/web/hooks/useDappsControllerHelpers/useDappsControllerHelpers.ts"
click node_hardware "https://github.com/ambiretech/extension/tree/main/src/mobile/modules/hardware-wallet/controllers"
click node_storage "https://github.com/ambiretech/extension/blob/main/src/common/services/storage/storage.web.ts"
click node_provider "https://github.com/ambiretech/extension/blob/main/src/common/modules/provider/ProviderController.ts"
click node_txstatus "https://github.com/ambiretech/extension/blob/main/src/benzin/screens/BenzinScreen/hooks/useSteps/useSteps.ts"
click node_benzin "https://github.com/ambiretech/extension/blob/main/src/benzin/screens/BenzinScreen/BenzinScreen.tsx"
click node_swap "https://github.com/ambiretech/extension/tree/main/src/common/modules/swap-and-bridge"
click node_routepreview "https://github.com/ambiretech/extension/blob/main/src/common/modules/swap-and-bridge/components/RouteStepsPreview/RouteStepsPreview.tsx"
click node_explore "https://github.com/ambiretech/extension/tree/main/src/common/modules/explore"
click node_legends "https://github.com/ambiretech/extension/tree/main/src/legends"
click node_controllerhook "https://github.com/ambiretech/extension/blob/main/src/common/hooks/useController/useController.ts"
click node_controllerstate "https://github.com/ambiretech/extension/blob/main/src/common/hooks/useControllerState/useControllerState.ts"
click node_middleware "https://github.com/ambiretech/extension/blob/main/src/common/hooks/useControllersMiddleware/useControllersMiddleware.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_webapp,node_mobileapp,node_user toneBlue
class node_accountsetup,node_dapps,node_hardware,node_storage,node_provider toneAmber
class node_txstatus,node_benzin toneMint
class node_swap,node_routepreview,node_explore,node_legends toneRose
class node_controllerhook,node_controllerstate,node_middleware toneIndigo
```

## Components

### Wallet platforms

- [Web wallet](https://github.com/ambiretech/extension/blob/main/src/web/modules/router/components/MainRoutes/MainRoutes.tsx): `src/web/modules/router/components/MainRoutes/MainRoutes.tsx`
- [Mobile wallet](https://github.com/ambiretech/extension/blob/main/src/mobile/modules/router/components/MainRoutes/MainRoutes.tsx): `src/mobile/modules/router/components/MainRoutes/MainRoutes.tsx`

### Wallet services

- [Account setup](https://github.com/ambiretech/extension/blob/main/src/common/constants/controllersMapping.ts): `src/common/constants/controllersMapping.ts`
- [Dapp connections](https://github.com/ambiretech/extension/blob/main/src/web/hooks/useDappsControllerHelpers/useDappsControllerHelpers.ts): `src/web/hooks/useDappsControllerHelpers/useDappsControllerHelpers.ts`
- [Hardware wallets](https://github.com/ambiretech/extension/tree/main/src/mobile/modules/hardware-wallet/controllers): `src/mobile/modules/hardware-wallet/controllers`
- [Wallet storage](https://github.com/ambiretech/extension/blob/main/src/common/services/storage/storage.web.ts): `src/common/services/storage/storage.web.ts`
- [Network provider](https://github.com/ambiretech/extension/blob/main/src/common/modules/provider/ProviderController.ts): `src/common/modules/provider/ProviderController.ts`

### Transactions

- [Operation tracking](https://github.com/ambiretech/extension/blob/main/src/benzin/screens/BenzinScreen/hooks/useSteps/useSteps.ts): `src/benzin/screens/BenzinScreen/hooks/useSteps/useSteps.ts`
- [Benzin status UI](https://github.com/ambiretech/extension/blob/main/src/benzin/screens/BenzinScreen/BenzinScreen.tsx): `src/benzin/screens/BenzinScreen/BenzinScreen.tsx`

### Wallet features

- [Swap and bridge](https://github.com/ambiretech/extension/tree/main/src/common/modules/swap-and-bridge): `src/common/modules/swap-and-bridge`
- [Route preview](https://github.com/ambiretech/extension/blob/main/src/common/modules/swap-and-bridge/components/RouteStepsPreview/RouteStepsPreview.tsx): `src/common/modules/swap-and-bridge/components/RouteStepsPreview/RouteStepsPreview.tsx`
- [Explore directory](https://github.com/ambiretech/extension/tree/main/src/common/modules/explore): `src/common/modules/explore`
- [Legends rewards](https://github.com/ambiretech/extension/tree/main/src/legends): `src/legends`

### Controller layer

- [Controller access](https://github.com/ambiretech/extension/blob/main/src/common/hooks/useController/useController.ts): `src/common/hooks/useController/useController.ts`
- [Controller state](https://github.com/ambiretech/extension/blob/main/src/common/hooks/useControllerState/useControllerState.ts): `src/common/hooks/useControllerState/useControllerState.ts`
- [Controller middleware](https://github.com/ambiretech/extension/blob/main/src/common/hooks/useControllersMiddleware/useControllersMiddleware.ts): `src/common/hooks/useControllersMiddleware/useControllersMiddleware.ts`

### Other components

- **Wallet user**

## Connections

- Wallet user → Web wallet: uses
- Wallet user → Mobile wallet: uses
- Web wallet → Account setup: manages accounts
- Mobile wallet → Account setup: manages accounts
- Web wallet → Dapp connections: connects dapps
- Mobile wallet → Hardware wallets: supports signing
- Web wallet → Network provider: uses networks
- Mobile wallet → Network provider: uses networks
- Web wallet → Wallet storage: persists wallet data
- Mobile wallet → Wallet storage: persists wallet data
- Web wallet → Swap and bridge: offers swaps
- Mobile wallet → Swap and bridge: offers swaps
- Swap and bridge → Route preview: shows route (evidence: `src/common/modules/swap-and-bridge/components/RouteStepsPreview/RouteStepsPreview.tsx`)
- Web wallet → Explore directory: opens directory
- Mobile wallet → Explore directory: opens directory
- Web wallet → Legends rewards: offers rewards
- Mobile wallet → Benzin status UI: tracks operations
- Benzin status UI → Operation tracking: reads status
- Controller access → Controller state: subscribes to (evidence: `src/common/hooks/useController/useController.ts`)
- Controller access → Controller middleware: dispatches actions (evidence: `src/common/hooks/useController/useController.ts`)
- Operation tracking → Network provider: fetches operation data
