# mytonwallet-org/mytonwallet architecture

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

- Interactive diagram: https://gitdiagram.com/mytonwallet-org/mytonwallet
- Repository: https://github.com/mytonwallet-org/mytonwallet

## Overview

My Wallet is a self-custodial, multichain wallet delivered across web, desktop, mobile, browser extensions, and Telegram. A user enters the wallet, chooses an asset action, reviews and confirms it, and receives a transfer or other wallet result; the sampled iOS send controllers show the review-and-confirm step. The README also documents Agent-assisted actions, swaps, staking, portfolio tracking, dApp connections, and hardware wallets. Those broader branches are represented at their existing source directories; their detailed runtime wiring was not sampled.

Main entry points: [`src/components/App.tsx`](https://github.com/mytonwallet-org/mytonwallet/blob/master/src/components/App.tsx) (Wallet app), [`mobile/ios/Air/SubModules/UISend/Token/Review/TokenSendReviewViewController.swift`](https://github.com/mytonwallet-org/mytonwallet/blob/master/mobile/ios/Air/SubModules/UISend/Token/Review/TokenSendReviewViewController.swift) (Send review), [`src/components/agent/hooks/agentV2RunController.ts`](https://github.com/mytonwallet-org/mytonwallet/blob/master/src/components/agent/hooks/agentV2RunController.ts) (Smart Agent), [`mobile/android/air`](https://github.com/mytonwallet-org/mytonwallet/tree/master/mobile/android/air) (Native Air)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Wallet clients"]
  node_wallet["Wallet app<br/>[App.tsx]"]
  node_platform["Native Air"]
end

subgraph group_asset["Asset actions"]
  node_send["Send review"]
  node_nftsend["NFT send"]
  node_multisend["Batch transfers<br/>[App.tsx]"]
  node_swap["Smart swaps"]
  node_onofframp["Buy and sell"]
end

subgraph group_services["Wallet capabilities"]
  node_agent["Smart Agent"]
  node_portfolio["Portfolio tracking<br/>[App.tsx]"]
  node_staking["Staking"]
  node_search["Universal search"]
  node_dapps["dApp sessions<br/>[storage.ts]"]
end

subgraph group_security["Security and storage"]
  node_ledger["Ledger connection<br/>[LedgerManager.kt]"]
  node_secure["Secure storage"]
  node_account["Account context"]
end

node_user(("Wallet user"))

node_user -->|"opens"| node_wallet
node_wallet -->|"reviews transfer"| node_send
node_wallet -->|"reviews NFT send"| node_nftsend
node_wallet -->|"starts batch send"| node_multisend
node_wallet -->|"starts swap"| node_swap
node_wallet -->|"buys or sells"| node_onofframp
node_wallet -->|"uses Agent"| node_agent
node_agent -.->|"can initiate"| node_send
node_wallet -->|"tracks holdings"| node_portfolio
node_wallet -->|"stakes assets"| node_staking
node_wallet -.->|"searches assets"| node_search
node_wallet -->|"connects dApps"| node_dapps
node_wallet -->|"connects hardware"| node_ledger
node_platform -->|"uses shared SDK"| node_agent
node_send -->|"uses account"| node_account

click node_wallet "https://github.com/mytonwallet-org/mytonwallet/blob/master/src/components/App.tsx"
click node_platform "https://github.com/mytonwallet-org/mytonwallet/tree/master/mobile/android/air"
click node_send "https://github.com/mytonwallet-org/mytonwallet/blob/master/mobile/ios/Air/SubModules/UISend/Token/Review/TokenSendReviewViewController.swift"
click node_nftsend "https://github.com/mytonwallet-org/mytonwallet/blob/master/mobile/ios/Air/SubModules/UISend/NFT/Review/NftSendReviewViewController.swift"
click node_multisend "https://github.com/mytonwallet-org/mytonwallet/blob/master/src/multisend/components/App.tsx"
click node_swap "https://github.com/mytonwallet-org/mytonwallet/tree/master/src"
click node_onofframp "https://github.com/mytonwallet-org/mytonwallet/tree/master/src"
click node_agent "https://github.com/mytonwallet-org/mytonwallet/blob/master/src/components/agent/hooks/agentV2RunController.ts"
click node_portfolio "https://github.com/mytonwallet-org/mytonwallet/blob/master/src/portfolio/components/App.tsx"
click node_staking "https://github.com/mytonwallet-org/mytonwallet/tree/master/src"
click node_search "https://github.com/mytonwallet-org/mytonwallet/blob/master/mobile/ios/Air/SubModules/UniversalSearchCore/UniversalSearchEngine.swift"
click node_dapps "https://github.com/mytonwallet-org/mytonwallet/blob/master/src/api/dappProtocols/storage.ts"
click node_ledger "https://github.com/mytonwallet-org/mytonwallet/blob/master/mobile/android/air/SubModules/Ledger/src/main/java/org/mytonwallet/app_air/ledger/LedgerManager.kt"
click node_secure "https://github.com/mytonwallet-org/mytonwallet/blob/master/mobile/android/air/SubModules/WalletContext/src/main/java/org/mytonwallet/app_air/walletcontext/secureStorage/WSecureStorageProvider.java"
click node_account "https://github.com/mytonwallet-org/mytonwallet/blob/master/mobile/ios/Air/SubModules/WalletCore/Stores/Accounts/AccountContext.swift"

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_wallet,node_platform,node_user toneBlue
class node_send,node_nftsend,node_multisend,node_swap,node_onofframp toneAmber
class node_agent,node_portfolio,node_staking,node_search,node_dapps toneMint
class node_ledger,node_secure,node_account toneRose
```

## Components

### Wallet clients

- [Wallet app](https://github.com/mytonwallet-org/mytonwallet/blob/master/src/components/App.tsx): `src/components/App.tsx`
- [Native Air](https://github.com/mytonwallet-org/mytonwallet/tree/master/mobile/android/air): `mobile/android/air`

### Asset actions

- [Send review](https://github.com/mytonwallet-org/mytonwallet/blob/master/mobile/ios/Air/SubModules/UISend/Token/Review/TokenSendReviewViewController.swift): `mobile/ios/Air/SubModules/UISend/Token/Review/TokenSendReviewViewController.swift`
- [NFT send](https://github.com/mytonwallet-org/mytonwallet/blob/master/mobile/ios/Air/SubModules/UISend/NFT/Review/NftSendReviewViewController.swift): `mobile/ios/Air/SubModules/UISend/NFT/Review/NftSendReviewViewController.swift`
- [Batch transfers](https://github.com/mytonwallet-org/mytonwallet/blob/master/src/multisend/components/App.tsx): `src/multisend/components/App.tsx`
- [Smart swaps](https://github.com/mytonwallet-org/mytonwallet/tree/master/src): `src`
- [Buy and sell](https://github.com/mytonwallet-org/mytonwallet/tree/master/src): `src`

### Wallet capabilities

- [Smart Agent](https://github.com/mytonwallet-org/mytonwallet/blob/master/src/components/agent/hooks/agentV2RunController.ts): `src/components/agent/hooks/agentV2RunController.ts`
- [Portfolio tracking](https://github.com/mytonwallet-org/mytonwallet/blob/master/src/portfolio/components/App.tsx): `src/portfolio/components/App.tsx`
- [Staking](https://github.com/mytonwallet-org/mytonwallet/tree/master/src): `src`
- [Universal search](https://github.com/mytonwallet-org/mytonwallet/blob/master/mobile/ios/Air/SubModules/UniversalSearchCore/UniversalSearchEngine.swift): `mobile/ios/Air/SubModules/UniversalSearchCore/UniversalSearchEngine.swift`
- [dApp sessions](https://github.com/mytonwallet-org/mytonwallet/blob/master/src/api/dappProtocols/storage.ts): `src/api/dappProtocols/storage.ts`

### Security and storage

- [Ledger connection](https://github.com/mytonwallet-org/mytonwallet/blob/master/mobile/android/air/SubModules/Ledger/src/main/java/org/mytonwallet/app_air/ledger/LedgerManager.kt): `mobile/android/air/SubModules/Ledger/src/main/java/org/mytonwallet/app_air/ledger/LedgerManager.kt`
- [Secure storage](https://github.com/mytonwallet-org/mytonwallet/blob/master/mobile/android/air/SubModules/WalletContext/src/main/java/org/mytonwallet/app_air/walletcontext/secureStorage/WSecureStorageProvider.java): `mobile/android/air/SubModules/WalletContext/src/main/java/org/mytonwallet/app_air/walletcontext/secureStorage/WSecureStorageProvider.java`
- [Account context](https://github.com/mytonwallet-org/mytonwallet/blob/master/mobile/ios/Air/SubModules/WalletCore/Stores/Accounts/AccountContext.swift): `mobile/ios/Air/SubModules/WalletCore/Stores/Accounts/AccountContext.swift`

### Other components

- **Wallet user**

## Connections

- Wallet user → Wallet app: opens
- Wallet app → Send review: reviews transfer
- Wallet app → NFT send: reviews NFT send
- Wallet app → Batch transfers: starts batch send
- Wallet app → Smart swaps: starts swap
- Wallet app → Buy and sell: buys or sells
- Wallet app → Smart Agent: uses Agent
- Smart Agent → Send review: can initiate
- Wallet app → Portfolio tracking: tracks holdings
- Wallet app → Staking: stakes assets
- Wallet app → Universal search: searches assets
- Wallet app → dApp sessions: connects dApps
- Wallet app → Ledger connection: connects hardware
- Native Air → Smart Agent: uses shared SDK
- Send review → Account context: uses account (evidence: `mobile/ios/Air/SubModules/UISend/Token/Review/TokenSendReviewViewController.swift`)
