Overview
Wallet management is at the heart of any Solana dApp. Hermis provides a comprehensive system for managing wallet connections, state, and interactions across all supported wallets.Wallet Lifecycle
States
Unconnected
No wallet is connected. User needs to select and connect a wallet.
Connecting
Connection in progress. Waiting for user approval in wallet.
Connected
Wallet successfully connected. Can perform transactions.
Disconnecting
Disconnection in progress. Cleaning up resources.
Supported Wallets
Hermis supports any wallet that implements the Wallet Standard. This includes browser extension wallets, mobile wallets, and hardware wallets that conform to the standard.Wallet Detection
The SDK automatically detects installed wallets and groups them by ready state:Ready States
ReadyState
Wallet is installed and detected in the user’s browser
ReadyState
Wallet can be loaded on demand (e.g., WalletConnect)
ReadyState
Wallet is not installed or detected
ReadyState
Wallet is not supported in current environment
Connection Management
Manual Connection
Auto-Connect
Automatically reconnect to the last used wallet on page load:Wallet Selection
Building a Wallet Selector
Persistence
Local Storage
Wallet selection is automatically persisted to local storage:Custom Storage
Implement custom storage (e.g., IndexedDB):Multi-Wallet Support
Switching Wallets
Users can switch between wallets without refreshing:Wallet Events
React
Use hooks to react to wallet changes:Vanilla JS
Subscribe to wallet events:Error Handling
Hermis usesHermisError for type-safe error handling:
Common Error Patterns
Connection Failed
Connection Failed
Handle wallet connection failures with context data:
Not Connected
Not Connected
Check if wallet is not connected before operations:
Generic Error Handling
Generic Error Handling
Handle any HermisError with automatic message formatting:
Global Error Handler
Best Practices
Always Handle Disconnection
Always Handle Disconnection
Users can disconnect from their wallet extension at any time. Always handle this gracefully:
Validate Network
Validate Network
Ensure the wallet is connected to the correct network:
Provide Visual Feedback
Provide Visual Feedback
Show clear states for connecting, connected, and errors:
Support Mobile
Support Mobile
Hermis automatically handles mobile wallet detection and deep linking. Simply ensure the Mobile Wallet Adapter is included in your adapters, and users can seamlessly connect from mobile devices.For best performance, remind users to disable battery/power saving mode on their devices to ensure reliable connections and smooth deep linking between your dApp and wallet apps.
What’s Next?
Transactions
Learn about transaction handling
Cookbook
See wallet connection examples
API Reference
Explore wallet APIs
Examples
View complete implementations
