# metamask/metamask-mobile architecture

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

- Interactive diagram: https://gitdiagram.com/metamask/metamask-mobile
- Repository: https://github.com/metamask/metamask-mobile

## Overview

MetaMask Mobile is a self-custody wallet for accessing blockchain networks and compatible websites. Its principal user journey spans onboarding and account selection, network-aware wallet activity, and transaction or purchase flows; the repository also exposes browser, swaps, Perps, Predict, rewards, collectibles, and notification capabilities. The sampled sources show Quick Buy submitting through the Engine and activity queries using account, network, and transaction selectors. Several product branches are represented from the tree but their internal wiring was not sampled, so uncertain relationships are omitted or shown as unverified.

Main entry points: [`app/components/Views/ActivityList/useTransactionsQuery.ts`](https://github.com/metamask/metamask-mobile/blob/main/app/components/Views/ActivityList/useTransactionsQuery.ts) (Transaction activity), [`index.js`](https://github.com/metamask/metamask-mobile/blob/main/index.js) (Mobile wallet), [`app/reducers/index.ts`](https://github.com/metamask/metamask-mobile/blob/main/app/reducers/index.ts) (App state), [`app/components/UI/QuickBuy/hooks/useQuickBuyController.ts`](https://github.com/metamask/metamask-mobile/blob/main/app/components/UI/QuickBuy/hooks/useQuickBuyController.ts) (Quick Buy)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_wallet["Wallet foundation"]
  node_mobile["Mobile wallet<br/>[index.js]"]
  node_onboard["Onboarding<br/>[index.ts]"]
  node_accounts["Account selection"]
  node_engine["Wallet Engine<br/>[Engine.ts]"]
  node_network["Network state"]
  node_state["App state<br/>[index.ts]"]
  node_storage[("Local storage<br/>[storage-wrapper.ts]")]
end

subgraph group_transact["Transactions and markets"]
  node_bridge["Bridge swaps"]
  node_quickbuy["Quick Buy"]
  node_ramp["Fiat on-ramp"]
  node_activity["Transaction activity"]
  node_transactionstate["Transaction selectors"]
  node_perps["Perpetual markets"]
  node_predict["Prediction markets"]
end

subgraph group_discover["Browser and assets"]
  node_browser["Web3 browser<br/>[index.js]"]
  node_tokens["Token and collectibles<br/>[index.js]"]
end

subgraph group_services["Account services"]
  node_rewards["Rewards<br/>[index.ts]"]
  node_notifications["Notifications<br/>[index.js]"]
  node_settings["Wallet settings<br/>[index.js]"]
end

node_user(("Wallet user"))
node_infura["Infura networks"]

node_user -->|"uses"| node_mobile
node_mobile -.->|"runs wallet logic"| node_engine
node_mobile -->|"connects to networks"| node_infura
node_activity -->|"queries transactions"| node_transactionstate
node_activity -->|"queries accounts"| node_accounts
node_activity -->|"queries network"| node_network
node_quickbuy -->|"submits transaction"| node_engine
node_quickbuy -->|"opens buy flow"| node_ramp
node_accounts -->|"selects account state"| node_state
node_transactionstate -->|"selects transaction state"| node_state
node_network -->|"selects network state"| node_state
node_settings -.->|"persists preferences"| node_storage
node_notifications -.->|"stores preferences"| node_storage

click node_mobile "https://github.com/metamask/metamask-mobile/blob/main/index.js"
click node_onboard "https://github.com/metamask/metamask-mobile/blob/main/app/actions/onboarding/index.ts"
click node_accounts "https://github.com/metamask/metamask-mobile/blob/main/app/selectors/multichainAccounts/accountTreeController.ts"
click node_engine "https://github.com/metamask/metamask-mobile/blob/main/app/core/Engine/Engine.ts"
click node_network "https://github.com/metamask/metamask-mobile/blob/main/app/selectors/networkController.ts"
click node_state "https://github.com/metamask/metamask-mobile/blob/main/app/reducers/index.ts"
click node_storage "https://github.com/metamask/metamask-mobile/blob/main/app/store/storage-wrapper.ts"
click node_browser "https://github.com/metamask/metamask-mobile/blob/main/app/actions/browser/index.js"
click node_tokens "https://github.com/metamask/metamask-mobile/blob/main/app/actions/collectibles/index.js"
click node_bridge "https://github.com/metamask/metamask-mobile/tree/main/app/components/UI/Bridge"
click node_quickbuy "https://github.com/metamask/metamask-mobile/blob/main/app/components/UI/QuickBuy/hooks/useQuickBuyController.ts"
click node_ramp "https://github.com/metamask/metamask-mobile/blob/main/app/components/UI/Ramp/hooks/useTransakController.ts"
click node_activity "https://github.com/metamask/metamask-mobile/blob/main/app/components/Views/ActivityList/useTransactionsQuery.ts"
click node_transactionstate "https://github.com/metamask/metamask-mobile/blob/main/app/selectors/transactionController.ts"
click node_perps "https://github.com/metamask/metamask-mobile/tree/main/app/components/UI/Perps"
click node_predict "https://github.com/metamask/metamask-mobile/blob/main/app/components/UI/Predict/controllers/PredictController.ts"
click node_rewards "https://github.com/metamask/metamask-mobile/blob/main/app/actions/rewards/index.ts"
click node_notifications "https://github.com/metamask/metamask-mobile/blob/main/app/actions/notification/index.js"
click node_settings "https://github.com/metamask/metamask-mobile/blob/main/app/actions/settings/index.js"

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_mobile,node_onboard,node_accounts,node_engine,node_network,node_state,node_storage,node_user toneBlue
class node_bridge,node_quickbuy,node_ramp,node_activity,node_transactionstate,node_perps,node_predict toneAmber
class node_browser,node_tokens toneMint
class node_rewards,node_notifications,node_settings toneRose
class node_infura toneIndigo
```

## Components

### Wallet foundation

- [Mobile wallet](https://github.com/metamask/metamask-mobile/blob/main/index.js): `index.js`
- [Onboarding](https://github.com/metamask/metamask-mobile/blob/main/app/actions/onboarding/index.ts): `app/actions/onboarding/index.ts`
- [Account selection](https://github.com/metamask/metamask-mobile/blob/main/app/selectors/multichainAccounts/accountTreeController.ts): `app/selectors/multichainAccounts/accountTreeController.ts`
- [Wallet Engine](https://github.com/metamask/metamask-mobile/blob/main/app/core/Engine/Engine.ts): `app/core/Engine/Engine.ts`
- [Network state](https://github.com/metamask/metamask-mobile/blob/main/app/selectors/networkController.ts): `app/selectors/networkController.ts`
- [App state](https://github.com/metamask/metamask-mobile/blob/main/app/reducers/index.ts): `app/reducers/index.ts`
- [Local storage](https://github.com/metamask/metamask-mobile/blob/main/app/store/storage-wrapper.ts): `app/store/storage-wrapper.ts`

### Transactions and markets

- [Bridge swaps](https://github.com/metamask/metamask-mobile/tree/main/app/components/UI/Bridge): `app/components/UI/Bridge`
- [Quick Buy](https://github.com/metamask/metamask-mobile/blob/main/app/components/UI/QuickBuy/hooks/useQuickBuyController.ts): `app/components/UI/QuickBuy/hooks/useQuickBuyController.ts`
- [Fiat on-ramp](https://github.com/metamask/metamask-mobile/blob/main/app/components/UI/Ramp/hooks/useTransakController.ts): `app/components/UI/Ramp/hooks/useTransakController.ts`
- [Transaction activity](https://github.com/metamask/metamask-mobile/blob/main/app/components/Views/ActivityList/useTransactionsQuery.ts): `app/components/Views/ActivityList/useTransactionsQuery.ts`
- [Transaction selectors](https://github.com/metamask/metamask-mobile/blob/main/app/selectors/transactionController.ts): `app/selectors/transactionController.ts`
- [Perpetual markets](https://github.com/metamask/metamask-mobile/tree/main/app/components/UI/Perps): `app/components/UI/Perps`
- [Prediction markets](https://github.com/metamask/metamask-mobile/blob/main/app/components/UI/Predict/controllers/PredictController.ts): `app/components/UI/Predict/controllers/PredictController.ts`

### Browser and assets

- [Web3 browser](https://github.com/metamask/metamask-mobile/blob/main/app/actions/browser/index.js): `app/actions/browser/index.js`
- [Token and collectibles](https://github.com/metamask/metamask-mobile/blob/main/app/actions/collectibles/index.js): `app/actions/collectibles/index.js`

### Account services

- [Rewards](https://github.com/metamask/metamask-mobile/blob/main/app/actions/rewards/index.ts): `app/actions/rewards/index.ts`
- [Notifications](https://github.com/metamask/metamask-mobile/blob/main/app/actions/notification/index.js): `app/actions/notification/index.js`
- [Wallet settings](https://github.com/metamask/metamask-mobile/blob/main/app/actions/settings/index.js): `app/actions/settings/index.js`

### Other components

- **Wallet user**
- **Infura networks**

## Connections

- Wallet user → Mobile wallet: uses (evidence: `README.md`)
- Mobile wallet → Wallet Engine: runs wallet logic
- Mobile wallet → Infura networks: connects to networks (evidence: `README.md`)
- Transaction activity → Transaction selectors: queries transactions (evidence: `app/components/Views/ActivityList/useTransactionsQuery.ts`)
- Transaction activity → Account selection: queries accounts (evidence: `app/components/Views/ActivityList/useTransactionsQuery.ts`)
- Transaction activity → Network state: queries network (evidence: `app/components/Views/ActivityList/useTransactionsQuery.ts`)
- Quick Buy → Wallet Engine: submits transaction (evidence: `app/components/UI/QuickBuy/hooks/useQuickBuyController.ts`)
- Quick Buy → Fiat on-ramp: opens buy flow (evidence: `app/components/UI/QuickBuy/hooks/useQuickBuyController.ts`)
- Account selection → App state: selects account state (evidence: `app/selectors/multichainAccounts/accountTreeController.ts`)
- Transaction selectors → App state: selects transaction state (evidence: `app/selectors/transactionController.ts`)
- Network state → App state: selects network state (evidence: `app/selectors/networkController.ts`)
- Wallet settings → Local storage: persists preferences
- Notifications → Local storage: stores preferences
