mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-02 08:47:26 +08:00
Phase 2 of the wallet architecture — crypto wallet functionality built on top of the keystore. Core components: - wallet/manager.py: Wallet CRUD, balance checks, transaction execution. Private keys stored as sealed keystore secrets — only the manager reads them, and only to pass to chain providers for signing. - wallet/policy.py: Transaction policy engine with spending limits, daily limits, rate limits, cooldown, recipient allow/blocklists, approval thresholds, and a kill switch (freeze/unfreeze). - wallet/chains/: Abstract ChainProvider interface + EVM and Solana impls. EVM supports Ethereum, Base, Polygon, Arbitrum, Optimism + testnets. Solana supports mainnet + devnet. Agent integration: - tools/wallet_tool.py: 5 agent-facing tools (wallet_list, wallet_balance, wallet_send, wallet_history, wallet_estimate_gas). All return JSON, none expose private keys. wallet_send goes through the policy engine. - toolsets.py: New 'wallet' toolset - model_tools.py: wallet_tool added to discovery list CLI: - wallet/cli.py: Full CLI — create, create-agent, import, list, balance, send (with interactive confirmation), fund, history, freeze, unfreeze, status - hermes_cli/main.py: 'hermes wallet' subcommand registered Policy defaults: - Agent wallets: 1.0 native/tx max, 5.0/day, 5 txns/hour, 30s cooldown, approval required above 0.5 native - User wallets: owner approval required for all transactions Tests: 100 passing (28 wallet + 72 keystore)
21 lines
659 B
Python
21 lines
659 B
Python
"""hermes-wallet — crypto wallet for Hermes Agent.
|
|
|
|
Built on top of hermes-keystore. Private keys are stored as sealed
|
|
secrets — the agent never has direct access. Transactions go through
|
|
a policy engine and optional owner approval.
|
|
|
|
Scope (v1):
|
|
- Wallet creation, import, listing
|
|
- Native token transfers (ETH, SOL)
|
|
- Balance checks
|
|
- Transaction history (local log)
|
|
- Policy engine (spending limits, rate limits, approval thresholds)
|
|
- CLI + gateway approval flow for high-value transactions
|
|
|
|
Out of scope (v1):
|
|
- Smart contracts / DeFi / swaps
|
|
- ERC-20 / SPL token transfers
|
|
- Hardware wallets
|
|
- Multi-sig
|
|
"""
|