# zerodevapp/zerodev-wallet-sdk architecture

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

- Interactive diagram: https://gitdiagram.com/zerodevapp/zerodev-wallet-sdk
- Repository: https://github.com/zerodevapp/zerodev-wallet-sdk

## Overview

ZeroDev Wallet SDK provides non-custodial smart-wallet authentication and signing, exposed through a framework-agnostic core and Wagmi/React integrations. The main user path is authenticate (passkey, OAuth, or email), obtain a wallet session, then sign/send a transaction; optional UI packages supply ready-made authentication and signing screens, while a separate funding widget creates a cross-chain deposit address and presents routes and fees. The repository also includes Expo support and demo/QA applications. Some subsystem links are documented in the README; unsampled implementation details are not inferred.

Main entry points: [`packages/core/src/actions/auth`](https://github.com/zerodevapp/zerodev-wallet-sdk/tree/main/packages/core/src/actions/auth) (Authentication actions), [`packages/react/src/core/connector.ts`](https://github.com/zerodevapp/zerodev-wallet-sdk/blob/main/packages/react/src/core/connector.ts) (Wagmi connector), [`packages/smart-routing-address-react-ui/src/context/SmartRoutingAddressContext.ts`](https://github.com/zerodevapp/zerodev-wallet-sdk/blob/main/packages/smart-routing-address-react-ui/src/context/SmartRoutingAddressContext.ts) (Routing context), [`packages/core/src/client/createClient.ts`](https://github.com/zerodevapp/zerodev-wallet-sdk/blob/main/packages/core/src/client/createClient.ts) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Wallet core"]
  node_core_auth["Authentication actions"]
  node_core_wallet["Wallet actions"]
  node_core_client["API client<br/>[createClient.ts]"]
  node_transport["REST transport<br/>[rest.ts]"]
  node_session_store["Session manager<br/>[manager.ts]"]
  node_storage_adapter["Storage adapter<br/>[adapters.ts]"]
end

subgraph group_react["React integration"]
  node_react_connector["Wagmi connector<br/>[connector.ts]"]
  node_react_auth["Auth hooks<br/>[actions.ts]"]
  node_oauth["OAuth flow"]
  node_oauth_verify["OAuth URL verification"]
end

subgraph group_ui["Wallet UI"]
  node_auth_ui["Authentication screens"]
  node_sign_ui["Signing screens"]
  node_history_ui["Transaction history<br/>[History.tsx]"]
  node_kit_store[("UI state store<br/>[store.ts]")]
end

subgraph group_funding["Smart routing"]
  node_routing_provider["Routing provider"]
  node_routing_context["Routing context"]
  node_address_create["Deposit address"]
  node_routing_read["Address and route state"]
  node_funding_ui["Deposit and history UI"]
end

subgraph group_apps["Examples and QA"]
  node_expo["Expo example"]
  node_qa_lab["QA testing lab"]
  node_signer_demo["Signer demo"]
  node_sra_demo["Routing demo"]
end

node_user(("Wallet user"))
node_rpc(("Chain RPC"))
node_backend(("ZeroDev backend"))
node_route_services(("Across and Relay"))

node_user -->|"connects"| node_react_connector
node_react_connector -->|"authenticates"| node_core_auth
node_react_auth -->|"invokes"| node_core_auth
node_react_auth -->|"starts OAuth"| node_oauth
node_oauth -->|"validates redirect"| node_oauth_verify
node_oauth -->|"uses core"| node_core_auth
node_core_auth -->|"requests"| node_core_client
node_core_client -.->|"dispatches"| node_transport
node_core_auth -.->|"persists session"| node_session_store
node_session_store -.->|"uses adapter"| node_storage_adapter
node_react_connector -->|"signs transactions"| node_core_wallet
node_core_wallet -->|"sends UserOperations"| node_rpc
node_core_client -->|"calls backend"| node_backend
node_user -->|"uses"| node_auth_ui
node_auth_ui -->|"authenticates with"| node_react_connector
node_user -->|"reviews request"| node_sign_ui
node_sign_ui -->|"signs with"| node_react_connector
node_auth_ui -->|"reads state"| node_kit_store
node_sign_ui -->|"reads requests"| node_kit_store
node_user -->|"views history"| node_history_ui
node_routing_provider -.->|"provides state"| node_routing_context
node_address_create -->|"reads creation action"| node_routing_context
node_routing_read -->|"reads route state"| node_routing_context
node_funding_ui -.->|"uses state"| node_routing_context
node_funding_ui -->|"routes deposits"| node_route_services
node_user -->|"tries SDK"| node_expo
node_user -.->|"tests features"| node_qa_lab
node_user -.->|"tries wallet"| node_signer_demo
node_user -.->|"previews funding"| node_sra_demo

click node_react_connector "https://github.com/zerodevapp/zerodev-wallet-sdk/blob/main/packages/react/src/core/connector.ts"
click node_react_auth "https://github.com/zerodevapp/zerodev-wallet-sdk/blob/main/packages/react/src/actions.ts"
click node_oauth "https://github.com/zerodevapp/zerodev-wallet-sdk/blob/main/packages/react/src/authenticateOAuth.ts"
click node_oauth_verify "https://github.com/zerodevapp/zerodev-wallet-sdk/blob/main/packages/react/src/utils/verifyGoogleLoginUrl.ts"
click node_core_auth "https://github.com/zerodevapp/zerodev-wallet-sdk/tree/main/packages/core/src/actions/auth"
click node_core_wallet "https://github.com/zerodevapp/zerodev-wallet-sdk/tree/main/packages/core/src/actions/wallet"
click node_core_client "https://github.com/zerodevapp/zerodev-wallet-sdk/blob/main/packages/core/src/client/createClient.ts"
click node_transport "https://github.com/zerodevapp/zerodev-wallet-sdk/blob/main/packages/core/src/client/transports/rest.ts"
click node_session_store "https://github.com/zerodevapp/zerodev-wallet-sdk/blob/main/packages/core/src/storage/manager.ts"
click node_storage_adapter "https://github.com/zerodevapp/zerodev-wallet-sdk/blob/main/packages/core/src/storage/adapters.ts"
click node_auth_ui "https://github.com/zerodevapp/zerodev-wallet-sdk/tree/main/packages/wallet-react-ui/src/auth"
click node_sign_ui "https://github.com/zerodevapp/zerodev-wallet-sdk/tree/main/packages/wallet-react-ui/src/signing"
click node_history_ui "https://github.com/zerodevapp/zerodev-wallet-sdk/blob/main/packages/wallet-react-ui/src/history/pages/History.tsx"
click node_kit_store "https://github.com/zerodevapp/zerodev-wallet-sdk/blob/main/packages/wallet-react-ui/src/store.ts"
click node_routing_provider "https://github.com/zerodevapp/zerodev-wallet-sdk/blob/main/packages/smart-routing-address-react-ui/src/context/SmartRoutingAddressProvider.tsx"
click node_routing_context "https://github.com/zerodevapp/zerodev-wallet-sdk/blob/main/packages/smart-routing-address-react-ui/src/context/SmartRoutingAddressContext.ts"
click node_address_create "https://github.com/zerodevapp/zerodev-wallet-sdk/blob/main/packages/smart-routing-address-react-ui/src/hooks/useCreateSmartRoutingAddress.ts"
click node_routing_read "https://github.com/zerodevapp/zerodev-wallet-sdk/blob/main/packages/smart-routing-address-react-ui/src/hooks/useSmartRoutingAddress.ts"
click node_funding_ui "https://github.com/zerodevapp/zerodev-wallet-sdk/tree/main/packages/smart-routing-address-react-ui/src/pages"
click node_expo "https://github.com/zerodevapp/zerodev-wallet-sdk/tree/main/apps/expo-example/src/app"
click node_qa_lab "https://github.com/zerodevapp/zerodev-wallet-sdk/tree/main/apps/qa-lab-testing/src/app"
click node_signer_demo "https://github.com/zerodevapp/zerodev-wallet-sdk/tree/main/apps/zerodev-signer-demo/src/app"
click node_sra_demo "https://github.com/zerodevapp/zerodev-wallet-sdk/tree/main/apps/sra-demo/src/app"

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_core_auth,node_core_wallet,node_core_client,node_transport,node_session_store,node_storage_adapter,node_user toneBlue
class node_react_connector,node_react_auth,node_oauth,node_oauth_verify toneAmber
class node_auth_ui,node_sign_ui,node_history_ui,node_kit_store toneMint
class node_routing_provider,node_routing_context,node_address_create,node_routing_read,node_funding_ui toneRose
class node_expo,node_qa_lab,node_signer_demo,node_sra_demo,node_rpc,node_backend,node_route_services toneIndigo
```

## Components

### Wallet core

- [Authentication actions](https://github.com/zerodevapp/zerodev-wallet-sdk/tree/main/packages/core/src/actions/auth): `packages/core/src/actions/auth`
- [Wallet actions](https://github.com/zerodevapp/zerodev-wallet-sdk/tree/main/packages/core/src/actions/wallet): `packages/core/src/actions/wallet`
- [API client](https://github.com/zerodevapp/zerodev-wallet-sdk/blob/main/packages/core/src/client/createClient.ts): `packages/core/src/client/createClient.ts`
- [REST transport](https://github.com/zerodevapp/zerodev-wallet-sdk/blob/main/packages/core/src/client/transports/rest.ts): `packages/core/src/client/transports/rest.ts`
- [Session manager](https://github.com/zerodevapp/zerodev-wallet-sdk/blob/main/packages/core/src/storage/manager.ts): `packages/core/src/storage/manager.ts`
- [Storage adapter](https://github.com/zerodevapp/zerodev-wallet-sdk/blob/main/packages/core/src/storage/adapters.ts): `packages/core/src/storage/adapters.ts`

### React integration

- [Wagmi connector](https://github.com/zerodevapp/zerodev-wallet-sdk/blob/main/packages/react/src/core/connector.ts): `packages/react/src/core/connector.ts`
- [Auth hooks](https://github.com/zerodevapp/zerodev-wallet-sdk/blob/main/packages/react/src/actions.ts): `packages/react/src/actions.ts`
- [OAuth flow](https://github.com/zerodevapp/zerodev-wallet-sdk/blob/main/packages/react/src/authenticateOAuth.ts): `packages/react/src/authenticateOAuth.ts`
- [OAuth URL verification](https://github.com/zerodevapp/zerodev-wallet-sdk/blob/main/packages/react/src/utils/verifyGoogleLoginUrl.ts): `packages/react/src/utils/verifyGoogleLoginUrl.ts`

### Wallet UI

- [Authentication screens](https://github.com/zerodevapp/zerodev-wallet-sdk/tree/main/packages/wallet-react-ui/src/auth): `packages/wallet-react-ui/src/auth`
- [Signing screens](https://github.com/zerodevapp/zerodev-wallet-sdk/tree/main/packages/wallet-react-ui/src/signing): `packages/wallet-react-ui/src/signing`
- [Transaction history](https://github.com/zerodevapp/zerodev-wallet-sdk/blob/main/packages/wallet-react-ui/src/history/pages/History.tsx): `packages/wallet-react-ui/src/history/pages/History.tsx`
- [UI state store](https://github.com/zerodevapp/zerodev-wallet-sdk/blob/main/packages/wallet-react-ui/src/store.ts): `packages/wallet-react-ui/src/store.ts`

### Smart routing

- [Routing provider](https://github.com/zerodevapp/zerodev-wallet-sdk/blob/main/packages/smart-routing-address-react-ui/src/context/SmartRoutingAddressProvider.tsx): `packages/smart-routing-address-react-ui/src/context/SmartRoutingAddressProvider.tsx`
- [Routing context](https://github.com/zerodevapp/zerodev-wallet-sdk/blob/main/packages/smart-routing-address-react-ui/src/context/SmartRoutingAddressContext.ts): `packages/smart-routing-address-react-ui/src/context/SmartRoutingAddressContext.ts`
- [Deposit address](https://github.com/zerodevapp/zerodev-wallet-sdk/blob/main/packages/smart-routing-address-react-ui/src/hooks/useCreateSmartRoutingAddress.ts): `packages/smart-routing-address-react-ui/src/hooks/useCreateSmartRoutingAddress.ts`
- [Address and route state](https://github.com/zerodevapp/zerodev-wallet-sdk/blob/main/packages/smart-routing-address-react-ui/src/hooks/useSmartRoutingAddress.ts): `packages/smart-routing-address-react-ui/src/hooks/useSmartRoutingAddress.ts`
- [Deposit and history UI](https://github.com/zerodevapp/zerodev-wallet-sdk/tree/main/packages/smart-routing-address-react-ui/src/pages): `packages/smart-routing-address-react-ui/src/pages`

### Examples and QA

- [Expo example](https://github.com/zerodevapp/zerodev-wallet-sdk/tree/main/apps/expo-example/src/app): `apps/expo-example/src/app`
- [QA testing lab](https://github.com/zerodevapp/zerodev-wallet-sdk/tree/main/apps/qa-lab-testing/src/app): `apps/qa-lab-testing/src/app`
- [Signer demo](https://github.com/zerodevapp/zerodev-wallet-sdk/tree/main/apps/zerodev-signer-demo/src/app): `apps/zerodev-signer-demo/src/app`
- [Routing demo](https://github.com/zerodevapp/zerodev-wallet-sdk/tree/main/apps/sra-demo/src/app): `apps/sra-demo/src/app`

### Other components

- **Wallet user**
- **Chain RPC**
- **ZeroDev backend**
- **Across and Relay**

## Connections

- Wallet user → Wagmi connector: connects (evidence: `README.md`)
- Wagmi connector → Authentication actions: authenticates (evidence: `README.md`)
- Auth hooks → Authentication actions: invokes (evidence: `README.md`)
- Auth hooks → OAuth flow: starts OAuth (evidence: `packages/react/src/authenticateOAuth.ts`)
- OAuth flow → OAuth URL verification: validates redirect (evidence: `packages/react/src/authenticateOAuth.ts`)
- OAuth flow → Authentication actions: uses core (evidence: `packages/react/src/authenticateOAuth.ts`)
- Authentication actions → API client: requests
- API client → REST transport: dispatches
- Authentication actions → Session manager: persists session
- Session manager → Storage adapter: uses adapter
- Wagmi connector → Wallet actions: signs transactions (evidence: `README.md`)
- Wallet actions → Chain RPC: sends UserOperations (evidence: `README.md`)
- API client → ZeroDev backend: calls backend (evidence: `README.md`)
- Wallet user → Authentication screens: uses (evidence: `README.md`)
- Authentication screens → Wagmi connector: authenticates with (evidence: `README.md`)
- Wallet user → Signing screens: reviews request (evidence: `README.md`)
- Signing screens → Wagmi connector: signs with (evidence: `README.md`)
- Authentication screens → UI state store: reads state (evidence: `packages/wallet-react-ui/src/auth/hooks/useAuth.ts`)
- Signing screens → UI state store: reads requests (evidence: `packages/wallet-react-ui/src/signing/hooks/usePendingRequest.ts`)
- Wallet user → Transaction history: views history (evidence: `README.md`)
- Routing provider → Routing context: provides state
- Deposit address → Routing context: reads creation action (evidence: `packages/smart-routing-address-react-ui/src/hooks/useCreateSmartRoutingAddress.ts`)
- Address and route state → Routing context: reads route state (evidence: `packages/smart-routing-address-react-ui/src/hooks/useSmartRoutingAddress.ts`)
- Deposit and history UI → Routing context: uses state
- Deposit and history UI → Across and Relay: routes deposits (evidence: `README.md`)
- Wallet user → Expo example: tries SDK (evidence: `README.md`)
- Wallet user → QA testing lab: tests features
- Wallet user → Signer demo: tries wallet
- Wallet user → Routing demo: previews funding
