# artxds/solana-wallet-hub architecture

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

- Interactive diagram: https://gitdiagram.com/artxds/solana-wallet-hub
- Repository: https://github.com/artxds/solana-wallet-hub

## Overview

Solana Wallet Hub is a browser wallet for connecting a Solana account, viewing its balance and recent activity, switching Devnet/Mainnet, sending SOL, and requesting Devnet faucet funds. Users enter through the Next.js pages into WalletHub; its balance and history hooks read chain data, while the send form and confirmation flow lead to a wallet-signed transfer. The faucet is a separate API route. Evidence is limited to the README, SOURCE INDEX relationships, and the excerpts shown; unsampled implementation details are not inferred.

Main entry points: [`src/components/layout/WalletHub.tsx`](https://github.com/artxds/solana-wallet-hub/blob/main/src/components/layout/WalletHub.tsx) (Wallet hub), [`app`](https://github.com/artxds/solana-wallet-hub/tree/main/app) (Wallet pages), [`src/components/send/SendForm.tsx`](https://github.com/artxds/solana-wallet-hub/blob/main/src/components/send/SendForm.tsx) (Send form), [`src/components/providers/SolanaProvider.tsx`](https://github.com/artxds/solana-wallet-hub/blob/main/src/components/providers/SolanaProvider.tsx) (Solana provider)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application UI"]
  node_pages["Wallet pages"]
  node_wallet_hub["Wallet hub<br/>[WalletHub.tsx]"]
  node_history_list["History list<br/>[HistoryList.tsx]"]
  node_send_form["Send form<br/>[SendForm.tsx]"]
  node_confirm["Transfer review"]
  node_balance_card["Balance card<br/>[BalanceCard.tsx]"]
end

subgraph group_wallet["Wallet and network"]
  node_provider["Solana provider<br/>[SolanaProvider.tsx]"]
  node_network_settings["Network settings"]
  node_network_switcher["Network switcher"]
end

subgraph group_activity["Wallet activity"]
  node_balance_hook["Balance query"]
  node_history_hook["History query"]
  node_price_hook["SOL price query<br/>[useSolPrice.ts]"]
  node_transfer_logic["Transfer builder<br/>[transactions.ts]"]
  node_faucet_api["Devnet faucet API<br/>[route.ts]"]
end

subgraph group_services["External services"]
  node_wallet_adapter["Wallet adapter"]
  node_solana_rpc["Solana RPC"]
  node_jupiter["Jupiter price API"]
end

node_user(("Wallet user"))

node_user -->|"opens app"| node_pages
node_pages -->|"routes views"| node_wallet_hub
node_pages -->|"opens home"| node_wallet_hub
node_user -->|"connects wallet"| node_wallet_adapter
node_wallet_hub -->|"reads network"| node_provider
node_provider -.->|"provides connection"| node_wallet_adapter
node_network_settings -.->|"offers switching"| node_network_switcher
node_wallet_hub -->|"loads balance"| node_balance_hook
node_wallet_hub -->|"loads activity"| node_history_hook
node_wallet_hub -->|"loads price"| node_price_hook
node_balance_hook -->|"queries balance"| node_solana_rpc
node_history_hook -->|"queries transactions"| node_solana_rpc
node_price_hook -->|"fetches price"| node_jupiter
node_wallet_hub -->|"renders balance"| node_balance_card
node_wallet_hub -->|"renders history"| node_history_list
node_wallet_hub -->|"renders form"| node_send_form
node_send_form -.->|"requests review"| node_wallet_hub
node_wallet_hub -->|"opens review"| node_confirm
node_wallet_hub -->|"builds transfer"| node_transfer_logic
node_wallet_hub -->|"submits transfer"| node_wallet_adapter
node_wallet_hub -->|"requests airdrop"| node_faucet_api
node_user -->|"requests funds"| node_faucet_api

click node_pages "https://github.com/artxds/solana-wallet-hub/tree/main/app"
click node_wallet_hub "https://github.com/artxds/solana-wallet-hub/blob/main/src/components/layout/WalletHub.tsx"
click node_history_list "https://github.com/artxds/solana-wallet-hub/blob/main/src/components/history/HistoryList.tsx"
click node_send_form "https://github.com/artxds/solana-wallet-hub/blob/main/src/components/send/SendForm.tsx"
click node_confirm "https://github.com/artxds/solana-wallet-hub/blob/main/src/components/send/ConfirmationModal.tsx"
click node_balance_card "https://github.com/artxds/solana-wallet-hub/blob/main/src/components/wallet/BalanceCard.tsx"
click node_provider "https://github.com/artxds/solana-wallet-hub/blob/main/src/components/providers/SolanaProvider.tsx"
click node_network_settings "https://github.com/artxds/solana-wallet-hub/blob/main/src/components/layout/NetworkSettings.tsx"
click node_network_switcher "https://github.com/artxds/solana-wallet-hub/blob/main/src/components/layout/NetworkSwitcher.tsx"
click node_balance_hook "https://github.com/artxds/solana-wallet-hub/blob/main/src/hooks/useSolanaBalance.ts"
click node_history_hook "https://github.com/artxds/solana-wallet-hub/blob/main/src/hooks/useTransactionHistory.ts"
click node_price_hook "https://github.com/artxds/solana-wallet-hub/blob/main/src/hooks/useSolPrice.ts"
click node_transfer_logic "https://github.com/artxds/solana-wallet-hub/blob/main/src/lib/solana/transactions.ts"
click node_faucet_api "https://github.com/artxds/solana-wallet-hub/blob/main/app/api/faucet/route.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_pages,node_wallet_hub,node_history_list,node_send_form,node_confirm,node_balance_card,node_user toneBlue
class node_provider,node_network_settings,node_network_switcher toneAmber
class node_balance_hook,node_history_hook,node_price_hook,node_transfer_logic,node_faucet_api toneMint
class node_wallet_adapter,node_solana_rpc,node_jupiter toneRose
```

## Components

### Application UI

- [Wallet pages](https://github.com/artxds/solana-wallet-hub/tree/main/app): `app`
- [Wallet hub](https://github.com/artxds/solana-wallet-hub/blob/main/src/components/layout/WalletHub.tsx): `src/components/layout/WalletHub.tsx`
- [History list](https://github.com/artxds/solana-wallet-hub/blob/main/src/components/history/HistoryList.tsx): `src/components/history/HistoryList.tsx`
- [Send form](https://github.com/artxds/solana-wallet-hub/blob/main/src/components/send/SendForm.tsx): `src/components/send/SendForm.tsx`
- [Transfer review](https://github.com/artxds/solana-wallet-hub/blob/main/src/components/send/ConfirmationModal.tsx): `src/components/send/ConfirmationModal.tsx`
- [Balance card](https://github.com/artxds/solana-wallet-hub/blob/main/src/components/wallet/BalanceCard.tsx): `src/components/wallet/BalanceCard.tsx`

### Wallet and network

- [Solana provider](https://github.com/artxds/solana-wallet-hub/blob/main/src/components/providers/SolanaProvider.tsx): `src/components/providers/SolanaProvider.tsx`
- [Network settings](https://github.com/artxds/solana-wallet-hub/blob/main/src/components/layout/NetworkSettings.tsx): `src/components/layout/NetworkSettings.tsx`
- [Network switcher](https://github.com/artxds/solana-wallet-hub/blob/main/src/components/layout/NetworkSwitcher.tsx): `src/components/layout/NetworkSwitcher.tsx`

### Wallet activity

- [Balance query](https://github.com/artxds/solana-wallet-hub/blob/main/src/hooks/useSolanaBalance.ts): `src/hooks/useSolanaBalance.ts`
- [History query](https://github.com/artxds/solana-wallet-hub/blob/main/src/hooks/useTransactionHistory.ts): `src/hooks/useTransactionHistory.ts`
- [SOL price query](https://github.com/artxds/solana-wallet-hub/blob/main/src/hooks/useSolPrice.ts): `src/hooks/useSolPrice.ts`
- [Transfer builder](https://github.com/artxds/solana-wallet-hub/blob/main/src/lib/solana/transactions.ts): `src/lib/solana/transactions.ts`
- [Devnet faucet API](https://github.com/artxds/solana-wallet-hub/blob/main/app/api/faucet/route.ts): `app/api/faucet/route.ts`

### External services

- **Wallet adapter**
- **Solana RPC**
- **Jupiter price API**

### Other components

- **Wallet user**

## Connections

- Wallet user → Wallet pages: opens app (evidence: `app/page.tsx`)
- Wallet pages → Wallet hub: routes views (evidence: `app/balance/page.tsx`)
- Wallet pages → Wallet hub: opens home (evidence: `app/page.tsx`)
- Wallet user → Wallet adapter: connects wallet (evidence: `README.md`)
- Wallet hub → Solana provider: reads network (evidence: `src/components/layout/WalletHub.tsx`)
- Solana provider → Wallet adapter: provides connection
- Network settings → Network switcher: offers switching
- Wallet hub → Balance query: loads balance (evidence: `src/components/layout/WalletHub.tsx`)
- Wallet hub → History query: loads activity (evidence: `src/components/layout/WalletHub.tsx`)
- Wallet hub → SOL price query: loads price (evidence: `src/components/layout/WalletHub.tsx`)
- Balance query → Solana RPC: queries balance (evidence: `src/hooks/useSolanaBalance.ts`)
- History query → Solana RPC: queries transactions (evidence: `src/hooks/useTransactionHistory.ts`)
- SOL price query → Jupiter price API: fetches price (evidence: `src/hooks/useSolPrice.ts`)
- Wallet hub → Balance card: renders balance (evidence: `src/components/layout/WalletHub.tsx`)
- Wallet hub → History list: renders history (evidence: `src/components/layout/WalletHub.tsx`)
- Wallet hub → Send form: renders form (evidence: `src/components/layout/WalletHub.tsx`)
- Send form → Wallet hub: requests review (evidence: `src/components/layout/WalletHub.tsx`)
- Wallet hub → Transfer review: opens review (evidence: `src/components/layout/WalletHub.tsx`)
- Wallet hub → Transfer builder: builds transfer (evidence: `src/components/layout/WalletHub.tsx`)
- Wallet hub → Wallet adapter: submits transfer (evidence: `src/components/layout/WalletHub.tsx`)
- Wallet hub → Devnet faucet API: requests airdrop (evidence: `src/components/layout/WalletHub.tsx`)
- Wallet user → Devnet faucet API: requests funds (evidence: `README.md`)
