05 — SDK architecture
Universal Wallet Manager
Framework-agnostic wallet infrastructure with adapters, capabilities, hardware wallet discovery and multi-account support.
- TypeScriptStrict-mode TypeScript across apps, SDKs and services.
- SDK
- EVMEthereum-compatible chains, accounts and transactions.
Overview
The Universal Wallet Manager is a framework-agnostic TypeScript SDK for connecting to wallets. It treats every wallet — browser extension, hardware device, remote signer, smart account or passkey — as an adapter with declared capabilities, and lets applications ask for what they need rather than which wallet they want.
It is currently in development.
The problem
Wallet code tends to rot in predictable ways. Features check for specific wallets (if (wallet === "ledger")). Each framework gets its own integration. Hardware discovery, account derivation and chain switching are re-implemented per app. Adding a wallet means touching dozens of files.
Engineering challenges
- Heterogeneous capabilities. Some wallets can switch chains, some can batch transactions, some can only sign. Some hold one account, others derive many.
- Discovery. Extensions inject providers asynchronously; hardware wallets appear through WebHID or WebUSB; remote wallets connect through a relay.
- Framework independence. The same core must back React, Vue and plain TypeScript apps — and stay observable from all of them.
- Lifecycle correctness. Connecting, approving, switching chains, locking and disconnecting form a state machine with many illegal transitions.
Architecture
- Bindings
- React
- Vue
- Vanilla
- Core
- WalletManagerobservable state
- Connection machineexplicit lifecycle
- Selection
- Adapter registrytype-safe
- Capability matcher
- Adapters
- Injected
- HardwareHID discovery
- Remote
- Smart account
Key decisions
Capabilities over brands
Adapters declare capabilities (signTypedData, switchChain, multiAccount, batchTransactions…). Features request capabilities, and a matcher ranks the adapters that can satisfy them — including why the others can't.
A type-safe registry
Adapters register into a typed registry, so get("ledger") returns the Ledger adapter's precise type and unknown ids fail at compile time.
The lifecycle is a state machine that emits effects
Connection state transitions are pure; prompts, persistence and notifications are emitted as data and executed by the host. See Separating State Transitions from Side Effects.
Observable, framework-free core
The core exposes subscribe/get semantics. Framework bindings are thin adapters over that contract.
Patterns
- Adapter + registry
- Capability negotiation / matching
- Finite state machine with effects as data
- Observable service with thin framework bindings