@onecraft/wallet 0.0.0-stage → 0.1.145
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +20 -0
- package/.openclaw/AGENTS.md +100 -0
- package/.openclaw/extensions/agent-wallet/README.md +195 -0
- package/.openclaw/extensions/agent-wallet/dist/index.js +2198 -0
- package/.openclaw/extensions/agent-wallet/index.ts +2198 -0
- package/.openclaw/extensions/agent-wallet/openclaw.plugin.json +251 -0
- package/.openclaw/extensions/agent-wallet/package.json +49 -0
- package/.openclaw/extensions/agent-wallet/skills/cards/SKILL.md +211 -0
- package/.openclaw/extensions/agent-wallet/skills/wallet-operator/SKILL.md +30 -0
- package/CHANGELOG.md +1232 -0
- package/LICENSE +104 -0
- package/README.md +193 -2
- package/VERSION +1 -0
- package/agent-wallet/.env.example +63 -0
- package/agent-wallet/AGENTS.md +130 -0
- package/agent-wallet/CARD_VAULT.md +640 -0
- package/agent-wallet/README.md +615 -0
- package/agent-wallet/UPGRADE_COMPATIBILITY.md +66 -0
- package/agent-wallet/agent_wallet/__init__.py +16 -0
- package/agent-wallet/agent_wallet/approval.py +165 -0
- package/agent-wallet/agent_wallet/autonomous_permissions.py +281 -0
- package/agent-wallet/agent_wallet/autonomous_policy.py +305 -0
- package/agent-wallet/agent_wallet/autonomous_session.py +236 -0
- package/agent-wallet/agent_wallet/boot_key_migration.py +155 -0
- package/agent-wallet/agent_wallet/boot_key_recovery.py +57 -0
- package/agent-wallet/agent_wallet/bootstrap.py +194 -0
- package/agent-wallet/agent_wallet/card_catalog.py +243 -0
- package/agent-wallet/agent_wallet/card_runtime_secrets.py +108 -0
- package/agent-wallet/agent_wallet/card_vault.py +331 -0
- package/agent-wallet/agent_wallet/card_vault_cli.py +174 -0
- package/agent-wallet/agent_wallet/card_vault_import.py +65 -0
- package/agent-wallet/agent_wallet/card_vault_keychain.py +239 -0
- package/agent-wallet/agent_wallet/config.py +719 -0
- package/agent-wallet/agent_wallet/connector_cli.py +198 -0
- package/agent-wallet/agent_wallet/connectors/__init__.py +28 -0
- package/agent-wallet/agent_wallet/connectors/catalog.py +68 -0
- package/agent-wallet/agent_wallet/connectors/client.py +308 -0
- package/agent-wallet/agent_wallet/connectors/intent_policy.py +243 -0
- package/agent-wallet/agent_wallet/connectors/manifest.py +192 -0
- package/agent-wallet/agent_wallet/connectors/registry.py +341 -0
- package/agent-wallet/agent_wallet/encrypted_storage.py +314 -0
- package/agent-wallet/agent_wallet/evm_user_wallets.py +910 -0
- package/agent-wallet/agent_wallet/exceptions.py +10 -0
- package/agent-wallet/agent_wallet/file_ops.py +34 -0
- package/agent-wallet/agent_wallet/http_client.py +25 -0
- package/agent-wallet/agent_wallet/kernel_browser.py +479 -0
- package/agent-wallet/agent_wallet/kernel_cli.py +57 -0
- package/agent-wallet/agent_wallet/kernel_gateway.py +95 -0
- package/agent-wallet/agent_wallet/keystore.py +503 -0
- package/agent-wallet/agent_wallet/laso_card_vault.py +246 -0
- package/agent-wallet/agent_wallet/models.py +66 -0
- package/agent-wallet/agent_wallet/morpho_monitor.py +298 -0
- package/agent-wallet/agent_wallet/nonce_registry.py +59 -0
- package/agent-wallet/agent_wallet/openclaw_adapter.py +9129 -0
- package/agent-wallet/agent_wallet/openclaw_cli.py +658 -0
- package/agent-wallet/agent_wallet/openclaw_runtime.py +194 -0
- package/agent-wallet/agent_wallet/plugin_bundle.py +44 -0
- package/agent-wallet/agent_wallet/providers/__init__.py +1 -0
- package/agent-wallet/agent_wallet/providers/bags.py +202 -0
- package/agent-wallet/agent_wallet/providers/dexscreener.py +147 -0
- package/agent-wallet/agent_wallet/providers/evm_activity.py +257 -0
- package/agent-wallet/agent_wallet/providers/evm_portfolio.py +459 -0
- package/agent-wallet/agent_wallet/providers/imd.py +720 -0
- package/agent-wallet/agent_wallet/providers/jupiter.py +519 -0
- package/agent-wallet/agent_wallet/providers/kamino.py +404 -0
- package/agent-wallet/agent_wallet/providers/lifi.py +302 -0
- package/agent-wallet/agent_wallet/providers/solana_rpc.py +447 -0
- package/agent-wallet/agent_wallet/providers/tokenized_stocks.py +189 -0
- package/agent-wallet/agent_wallet/providers/wdk_evm_local.py +346 -0
- package/agent-wallet/agent_wallet/providers/x402.py +1972 -0
- package/agent-wallet/agent_wallet/sealed_keys.py +118 -0
- package/agent-wallet/agent_wallet/solana_stake.py +103 -0
- package/agent-wallet/agent_wallet/solana_tx.py +93 -0
- package/agent-wallet/agent_wallet/spending_limits.py +119 -0
- package/agent-wallet/agent_wallet/telemetry.py +481 -0
- package/agent-wallet/agent_wallet/transaction_policy.py +573 -0
- package/agent-wallet/agent_wallet/update_check.py +190 -0
- package/agent-wallet/agent_wallet/user_wallets.py +573 -0
- package/agent-wallet/agent_wallet/validation.py +31 -0
- package/agent-wallet/agent_wallet/vault_executor.py +456 -0
- package/agent-wallet/agent_wallet/wallet_layer/__init__.py +1 -0
- package/agent-wallet/agent_wallet/wallet_layer/base.py +1204 -0
- package/agent-wallet/agent_wallet/wallet_layer/base58.py +44 -0
- package/agent-wallet/agent_wallet/wallet_layer/factory.py +117 -0
- package/agent-wallet/agent_wallet/wallet_layer/solana.py +5246 -0
- package/agent-wallet/agent_wallet/wallet_layer/wdk_evm.py +2705 -0
- package/agent-wallet/examples/bootstrap_wallet.py +21 -0
- package/agent-wallet/examples/openclaw_runtime_onboarding.py +28 -0
- package/agent-wallet/examples/openclaw_user_wallet_example.py +31 -0
- package/agent-wallet/examples/openclaw_wallet_adapter_example.py +33 -0
- package/agent-wallet/openclaw.plugin.json +118 -0
- package/agent-wallet/pyproject.toml +36 -0
- package/agent-wallet/scripts/bootstrap_openclaw_evm.py +312 -0
- package/agent-wallet/scripts/build_release_bundle.py +210 -0
- package/agent-wallet/scripts/finalize_openclaw_local_wallet_config.py +121 -0
- package/agent-wallet/scripts/install_agent_wallet.py +1357 -0
- package/agent-wallet/scripts/install_openclaw_local_config.py +421 -0
- package/agent-wallet/scripts/install_openclaw_sealed_keys.py +117 -0
- package/agent-wallet/scripts/manage_openclaw_evm_wallet.py +333 -0
- package/agent-wallet/scripts/security_utils.py +37 -0
- package/agent-wallet/scripts/setup_evm_wallet.sh +140 -0
- package/agent-wallet/scripts/switch_openclaw_wallet_network.py +109 -0
- package/agent-wallet/skills/wallet-operator/SKILL.md +157 -0
- package/bin/lib/boot-key.mjs +184 -0
- package/bin/lib/evm-daemon.mjs +389 -0
- package/bin/lib/host-detection.mjs +259 -0
- package/bin/lib/integrations.mjs +578 -0
- package/bin/lib/release-python.mjs +9 -0
- package/bin/lib/update-transaction.mjs +235 -0
- package/bin/openclaw-agent-wallet.mjs +3354 -0
- package/claude-code/plugins/agent-wallet/.claude-plugin/plugin.json +19 -0
- package/claude-code/plugins/agent-wallet/.mcp.json +14 -0
- package/claude-code/plugins/agent-wallet/AGENTLAYER_AGENT_GUIDE.md +282 -0
- package/claude-code/plugins/agent-wallet/README.md +134 -0
- package/claude-code/plugins/agent-wallet/commands/agentlayer-autonomous-approve.md +39 -0
- package/claude-code/plugins/agent-wallet/commands/agentlayer-autonomous-revoke.md +17 -0
- package/claude-code/plugins/agent-wallet/commands/cards.md +129 -0
- package/claude-code/plugins/agent-wallet/commands/guide.md +40 -0
- package/claude-code/plugins/agent-wallet/commands/imd.md +125 -0
- package/claude-code/plugins/agent-wallet/commands/wallet-base.md +60 -0
- package/claude-code/plugins/agent-wallet/commands/wallet-ethereum.md +37 -0
- package/claude-code/plugins/agent-wallet/commands/wallet-evm.md +39 -0
- package/claude-code/plugins/agent-wallet/commands/wallet-setup.md +25 -0
- package/claude-code/plugins/agent-wallet/commands/wallet-sol.md +51 -0
- package/claude-code/plugins/agent-wallet/commands/wallet-statusline.md +34 -0
- package/claude-code/plugins/agent-wallet/commands/x402.md +121 -0
- package/claude-code/plugins/agent-wallet/commands/yield.md +62 -0
- package/claude-code/plugins/agent-wallet/hooks/hooks.json +16 -0
- package/claude-code/plugins/agent-wallet/scripts/bootstrap_backend.sh +136 -0
- package/claude-code/plugins/agent-wallet/scripts/enable_statusline.py +52 -0
- package/claude-code/plugins/agent-wallet/scripts/resolve_wallet_addresses.py +69 -0
- package/claude-code/plugins/agent-wallet/scripts/run_mcp.sh +66 -0
- package/claude-code/plugins/agent-wallet/scripts/wallet_statusline.py +130 -0
- package/claude-code/plugins/agent-wallet/scripts/wallet_statusline_setup.sh +40 -0
- package/claude-code/plugins/agent-wallet/skills/wallet-operator/SKILL.md +21 -0
- package/codex/plugins/agent-wallet/.codex-plugin/plugin.json +37 -0
- package/codex/plugins/agent-wallet/.mcp.json +15 -0
- package/codex/plugins/agent-wallet/README.md +158 -0
- package/codex/plugins/agent-wallet/scripts/run_mcp.sh +47 -0
- package/codex/plugins/agent-wallet/server.py +1797 -0
- package/codex/plugins/agent-wallet/skills/cards/SKILL.md +225 -0
- package/codex/plugins/agent-wallet/skills/imd/SKILL.md +145 -0
- package/codex/plugins/agent-wallet/skills/wallet-base/SKILL.md +56 -0
- package/codex/plugins/agent-wallet/skills/wallet-operator/SKILL.md +85 -0
- package/codex/plugins/agent-wallet/skills/wallet-sol/SKILL.md +29 -0
- package/codex/plugins/agent-wallet/skills/x402/SKILL.md +159 -0
- package/codex/plugins/agent-wallet/skills/yield/SKILL.md +65 -0
- package/connectors/AGENTS.md +37 -0
- package/connectors/DEVELOPER_GUIDE.md +131 -0
- package/connectors/README.md +139 -0
- package/connectors/READ_ONLY_BETA.md +54 -0
- package/connectors/RELEASING.md +48 -0
- package/connectors/conformance/README.md +31 -0
- package/connectors/conformance/package.json +54 -0
- package/connectors/conformance/scripts/sync-license.mjs +3 -0
- package/connectors/conformance/scripts/sync-spec.mjs +16 -0
- package/connectors/conformance/src/cli.ts +43 -0
- package/connectors/conformance/src/index.ts +7 -0
- package/connectors/conformance/src/runner.ts +314 -0
- package/connectors/conformance/src/types.ts +27 -0
- package/connectors/conformance/test/fixtures/invalid-response-identity.json +14 -0
- package/connectors/conformance/test/fixtures/missing-tool-fixture.json +4 -0
- package/connectors/conformance/test/runner.test.mjs +151 -0
- package/connectors/conformance/tsconfig.json +17 -0
- package/connectors/examples/reference-crypto-data/Dockerfile +21 -0
- package/connectors/examples/reference-crypto-data/README.md +51 -0
- package/connectors/examples/reference-crypto-data/conformance.json +11 -0
- package/connectors/examples/reference-crypto-data/connector.json +95 -0
- package/connectors/examples/reference-crypto-data/package.json +21 -0
- package/connectors/examples/reference-crypto-data/railway.toml +9 -0
- package/connectors/examples/reference-crypto-data/src/connector.ts +137 -0
- package/connectors/examples/reference-crypto-data/src/server.ts +13 -0
- package/connectors/examples/reference-crypto-data/test/connector.test.mjs +97 -0
- package/connectors/examples/reference-crypto-data/tsconfig.json +17 -0
- package/connectors/package-lock.json +561 -0
- package/connectors/package.json +19 -0
- package/connectors/scripts/smoke-packed-packages.mjs +121 -0
- package/connectors/sdk-typescript/README.md +47 -0
- package/connectors/sdk-typescript/package.json +49 -0
- package/connectors/sdk-typescript/scripts/sync-license.mjs +3 -0
- package/connectors/sdk-typescript/src/connector.ts +204 -0
- package/connectors/sdk-typescript/src/errors.ts +11 -0
- package/connectors/sdk-typescript/src/http.ts +116 -0
- package/connectors/sdk-typescript/src/index.ts +26 -0
- package/connectors/sdk-typescript/src/types.ts +101 -0
- package/connectors/sdk-typescript/test/sdk.test.mjs +181 -0
- package/connectors/sdk-typescript/tsconfig.json +21 -0
- package/connectors/spec/connector-manifest.schema.json +340 -0
- package/connectors/spec/connector-protocol.md +159 -0
- package/connectors/spec/transaction-intent.schema.json +281 -0
- package/connectors/templates/read-only/.env.example +1 -0
- package/connectors/templates/read-only/Dockerfile +11 -0
- package/connectors/templates/read-only/README.md +33 -0
- package/connectors/templates/read-only/conformance.json +11 -0
- package/connectors/templates/read-only/connector.json +64 -0
- package/connectors/templates/read-only/package.json +21 -0
- package/connectors/templates/read-only/railway.toml +9 -0
- package/connectors/templates/read-only/src/connector.ts +61 -0
- package/connectors/templates/read-only/src/server.ts +14 -0
- package/connectors/templates/read-only/test/connector.test.mjs +62 -0
- package/connectors/templates/read-only/tsconfig.json +17 -0
- package/cursor/plugins/agent-wallet/.cursor-plugin/plugin.json +14 -0
- package/cursor/plugins/agent-wallet/README.md +62 -0
- package/cursor/plugins/agent-wallet/mcp.json +16 -0
- package/cursor/plugins/agent-wallet/scripts/run_mcp.sh +33 -0
- package/cursor/plugins/agent-wallet/server.py +33 -0
- package/cursor/plugins/agent-wallet/skills/cards/SKILL.md +210 -0
- package/cursor/plugins/agent-wallet/skills/wallet-base/SKILL.md +56 -0
- package/cursor/plugins/agent-wallet/skills/wallet-operator/SKILL.md +23 -0
- package/cursor/plugins/agent-wallet/skills/wallet-sol/SKILL.md +29 -0
- package/cursor/plugins/agent-wallet/skills/x402/SKILL.md +130 -0
- package/hermes/plugins/agent_wallet/README.md +54 -0
- package/hermes/plugins/agent_wallet/__init__.py +55 -0
- package/hermes/plugins/agent_wallet/plugin.yaml +9 -0
- package/hermes/plugins/agent_wallet/schemas.py +211 -0
- package/hermes/plugins/agent_wallet/tools.py +622 -0
- package/install-from-github.sh +139 -0
- package/integrations/hedera/treasury-guard/README.md +92 -0
- package/integrations/hedera/treasury-guard/examples/treasury-policy.example.json +9 -0
- package/integrations/hedera/treasury-guard/package-lock.json +880 -0
- package/integrations/hedera/treasury-guard/package.json +8 -0
- package/integrations/hedera/treasury-guard/skills/onecraft-hedera-treasury/SKILL.md +22 -0
- package/integrations/hedera/treasury-guard/src/hedera-mirror-client.mjs +106 -0
- package/integrations/hedera/treasury-guard/src/hedera-signer.mjs +120 -0
- package/integrations/hedera/treasury-guard/src/treasury-cli.mjs +177 -0
- package/integrations/hedera/treasury-guard/src/treasury-policy.mjs +155 -0
- package/mcp/README.md +39 -0
- package/mcp/scripts/run_mcp.sh +37 -0
- package/mcp/server.py +33 -0
- package/package.json +106 -4
- package/scripts/check_release_version.mjs +72 -0
- package/scripts/version_targets.mjs +60 -0
- package/setup.sh +87 -0
- package/wdk-evm-wallet/.env.example +38 -0
- package/wdk-evm-wallet/README.md +254 -0
- package/wdk-evm-wallet/bootstrap.sh +8 -0
- package/wdk-evm-wallet/package-lock.json +2359 -0
- package/wdk-evm-wallet/package.json +43 -0
- package/wdk-evm-wallet/run-local.sh +12 -0
- package/wdk-evm-wallet/src/config.js +461 -0
- package/wdk-evm-wallet/src/imd.js +231 -0
- package/wdk-evm-wallet/src/json.js +35 -0
- package/wdk-evm-wallet/src/local_vault.js +407 -0
- package/wdk-evm-wallet/src/network_state.js +96 -0
- package/wdk-evm-wallet/src/pending_transactions.js +148 -0
- package/wdk-evm-wallet/src/server.js +849 -0
- package/wdk-evm-wallet/src/shutdown.js +63 -0
- package/wdk-evm-wallet/src/wdk_evm_wallet.js +10036 -0
|
@@ -0,0 +1,615 @@
|
|
|
1
|
+
# OpenClaw Agent Wallet
|
|
2
|
+
|
|
3
|
+
Reusable wallet backend for OpenClaw agents.
|
|
4
|
+
|
|
5
|
+
Current focus:
|
|
6
|
+
|
|
7
|
+
- simple local Solana support
|
|
8
|
+
- separate local EVM custody runtime
|
|
9
|
+
- send-enabled local operation with optional sign-only mode
|
|
10
|
+
- minimal external API surface
|
|
11
|
+
- easy embedding into agent runtimes or MCP adapters
|
|
12
|
+
|
|
13
|
+
### EVM activity history
|
|
14
|
+
|
|
15
|
+
`get_transaction_activity` reads the active local wallet's asset movements on
|
|
16
|
+
Ethereum, Base, or Robinhood Chain. It fetches one incoming and one outgoing
|
|
17
|
+
Alchemy transfer page (20 transfers by default) through `provider-gateway` and
|
|
18
|
+
groups events by transaction hash; `direction=outgoing|incoming` fetches only one
|
|
19
|
+
side and halves the provider cost. Pass the returned `next_outgoing_page_key` and
|
|
20
|
+
`next_incoming_page_key` to load older pages; `__end__` marks an exhausted
|
|
21
|
+
direction. Because the two directions page independently, `complete_since` marks
|
|
22
|
+
the timestamp after which the merged list has no gaps. NFTs are excluded unless
|
|
23
|
+
`include_nfts` is true. Caching and spend limits live in the gateway. Successful wallet submissions
|
|
24
|
+
are recorded locally under `OPENCLAW_HOME/cache/evm-activity` as short-lived hash
|
|
25
|
+
placeholders until Alchemy indexes them. A placeholder older than 30 seconds is
|
|
26
|
+
settled from one transaction receipt read (rechecked at most every 30 seconds, up
|
|
27
|
+
to five per call) and the verdict is stored: `failed` (reverted, gas spent),
|
|
28
|
+
`confirmed` (succeeded without an asset movement, e.g. an ERC-20 approval), or
|
|
29
|
+
`dropped` (no receipt or mempool entry after 30 minutes); otherwise it stays
|
|
30
|
+
`submitted`. The gateway and wallet vault persist no
|
|
31
|
+
transaction history. This feed covers transfers, not zero-value transfers,
|
|
32
|
+
failed transactions, or contract calls without an asset movement.
|
|
33
|
+
|
|
34
|
+
## OpenClaw integration
|
|
35
|
+
|
|
36
|
+
The package now includes a thin adapter for agent runtimes:
|
|
37
|
+
|
|
38
|
+
- `agent_wallet.openclaw_adapter.OpenClawWalletAdapter`
|
|
39
|
+
- `agent_wallet.plugin_bundle.build_openclaw_plugin_bundle`
|
|
40
|
+
- `agent_wallet.openclaw_runtime.onboard_openclaw_user_wallet`
|
|
41
|
+
- `agent_wallet.openclaw_cli` for the official OpenClaw TypeScript plugin bridge
|
|
42
|
+
- `hermes/plugins/agent_wallet` as an optional Hermes Agent bridge to the same CLI
|
|
43
|
+
|
|
44
|
+
It provides:
|
|
45
|
+
|
|
46
|
+
- tool specs for agent registration
|
|
47
|
+
- runtime instructions for safe wallet usage
|
|
48
|
+
- a single `invoke()` method for safe dispatch
|
|
49
|
+
- OpenClaw-style plugin manifest and skill bundle
|
|
50
|
+
- explicit network-aware results so the host and agent can see the active chain network
|
|
51
|
+
|
|
52
|
+
## Universal local MCP
|
|
53
|
+
|
|
54
|
+
The runtime can also be used directly by any MCP client with `stdio` support;
|
|
55
|
+
this is separate from the Codex, Cursor, Claude Code, OpenClaw, and Hermes bridges.
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
wallet mcp config # prints a ready-to-paste mcpServers JSON object
|
|
59
|
+
wallet mcp serve # starts the same server for clients that launch by command
|
|
60
|
+
wallet mcp path # prints the stable local launcher path
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
The universal MCP exposes the same tool set and calls the same adapter as the
|
|
64
|
+
Codex, Cursor, and Claude Code bridges. It does not carry secrets in its generated
|
|
65
|
+
config, and all signing and approval policy remains in this Python backend.
|
|
66
|
+
|
|
67
|
+
## Hermes integration
|
|
68
|
+
|
|
69
|
+
The optional Hermes plugin is intentionally a bridge, not a port of the OpenClaw plugin. It registers:
|
|
70
|
+
|
|
71
|
+
- `agent_wallet_tools` - read-only discovery for the underlying Python adapter tool specs.
|
|
72
|
+
- `agent_wallet_invoke` - a dispatcher that calls `python -m agent_wallet.openclaw_cli invoke`.
|
|
73
|
+
- `agent_wallet_approve` - a host approval-token issuer for exact execute operations.
|
|
74
|
+
- `agent_wallet_evm_status` - a read-only EVM runtime and binding inspector.
|
|
75
|
+
- `agent_wallet_evm_setup` - a host-side EVM bootstrap helper for Hermes.
|
|
76
|
+
|
|
77
|
+
Install it with:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
npx @onecraft/wallet hermes install --yes
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
That command symlinks `hermes/plugins/agent_wallet` into `~/.hermes/plugins/agent_wallet`, enables the plugin with `hermes plugins enable agent-wallet`, and writes `AGENT_WALLET_PACKAGE_ROOT`, `AGENT_WALLET_PYTHON`, and `AGENT_WALLET_BOOT_KEY_FILE` into `~/.hermes/.env`. OpenClaw remains the canonical host integration and wallet safety policy remains in Python.
|
|
84
|
+
|
|
85
|
+
Hermes tool config must not contain wallet secrets. Use the existing sealed runtime path and host-issued approval tokens for execute flows. `AGENT_WALLET_BOOT_KEY_FILE` lets OpenClaw and Hermes reference one local boot-key file instead of duplicating the boot key across multiple env files.
|
|
86
|
+
|
|
87
|
+
For EVM on Hermes, the intended host flow is:
|
|
88
|
+
|
|
89
|
+
- call `agent_wallet_evm_status` to inspect `wdk-evm-wallet` health and current bindings
|
|
90
|
+
- call `agent_wallet_evm_setup` once to auto-start the local service when needed, create or unlock the local EVM wallet, and patch local OpenClaw config to `backend=wdk_evm_local`
|
|
91
|
+
- then use ordinary `agent_wallet_invoke` calls for EVM reads, transfers, swaps, and Aave flows
|
|
92
|
+
|
|
93
|
+
Current safe tools:
|
|
94
|
+
|
|
95
|
+
- `get_wallet_capabilities`
|
|
96
|
+
- `get_wallet_address`
|
|
97
|
+
- `get_wallet_balance`
|
|
98
|
+
- `get_evm_token_metadata`
|
|
99
|
+
- `get_evm_token_balance`
|
|
100
|
+
- `get_evm_fee_rates`
|
|
101
|
+
- `get_evm_transaction_receipt`
|
|
102
|
+
- `get_evm_swap_quote`
|
|
103
|
+
- `swap_evm_tokens`
|
|
104
|
+
- `get_evm_aave_account`
|
|
105
|
+
- `get_evm_aave_reserves`
|
|
106
|
+
- `get_evm_aave_positions`
|
|
107
|
+
- `manage_evm_aave_position`
|
|
108
|
+
- `get_lifi_supported_chains`
|
|
109
|
+
- `get_lifi_quote`
|
|
110
|
+
- `get_lifi_transfer_status`
|
|
111
|
+
- `transfer_evm_native`
|
|
112
|
+
- `transfer_evm_token`
|
|
113
|
+
- `swap_evm_lifi_cross_chain_tokens` - EVM-origin LI.FI routes from Ethereum/Base/Arc to Ethereum/Base/Arc/Solana when LI.FI returns a route.
|
|
114
|
+
- `swap_solana_lifi_cross_chain_tokens` - Solana-origin LI.FI routes from Solana to Ethereum/Base/Arc when LI.FI returns a route.
|
|
115
|
+
- `get_wallet_portfolio`
|
|
116
|
+
- `get_solana_token_prices`
|
|
117
|
+
- `get_solana_staking_validators`
|
|
118
|
+
- `get_solana_stake_account`
|
|
119
|
+
- `sign_wallet_message`
|
|
120
|
+
- `transfer_sol`
|
|
121
|
+
- `stake_sol_native`
|
|
122
|
+
- `transfer_spl_token`
|
|
123
|
+
- `swap_solana_tokens` - Solana Jupiter swaps; prefer `intent_preview` -> chat confirmation -> `intent_execute` so execution refreshes the quote inside approved limits.
|
|
124
|
+
- `get_kamino_lend_markets`
|
|
125
|
+
- `get_kamino_portfolio`
|
|
126
|
+
- `get_kamino_vaults`
|
|
127
|
+
- `get_kamino_earn_positions`
|
|
128
|
+
- `get_kamino_liquidity_positions`
|
|
129
|
+
- `get_kamino_lend_market_reserves`
|
|
130
|
+
- `get_kamino_lend_user_obligations`
|
|
131
|
+
- `get_kamino_lend_user_rewards`
|
|
132
|
+
- `get_kamino_open_positions`
|
|
133
|
+
- `kamino_lend_deposit`
|
|
134
|
+
- `kamino_lend_withdraw`
|
|
135
|
+
- `kamino_lend_borrow`
|
|
136
|
+
- `kamino_lend_repay`
|
|
137
|
+
- `kamino_earn_deposit`
|
|
138
|
+
- `kamino_earn_withdraw`
|
|
139
|
+
- `close_empty_token_accounts`
|
|
140
|
+
- `deactivate_solana_stake`
|
|
141
|
+
- `withdraw_solana_stake`
|
|
142
|
+
- `x402_search_services`
|
|
143
|
+
- `x402_get_service_details`
|
|
144
|
+
- `x402_preview_request`
|
|
145
|
+
- `x402_pay_request`
|
|
146
|
+
|
|
147
|
+
The signing tool still requires explicit `user_confirmed=true`.
|
|
148
|
+
Transfer, native staking, swap, and Aave position-management tools support `preview`, `prepare`, and `execute` modes. The safe operational path is still preview-first. `prepare` now returns an execution plan only and never exposes signed transaction bytes to the agent. `execute` works only when the backend has a signer and `sign_only=false`.
|
|
149
|
+
|
|
150
|
+
Policy defaults:
|
|
151
|
+
|
|
152
|
+
- read-only tools are always allowed
|
|
153
|
+
- `prepare` requires `user_intent=true`
|
|
154
|
+
- `prepare` does not return signed transaction bytes
|
|
155
|
+
- backend `execute` requires an internal authorization token bound to the exact previewed operation
|
|
156
|
+
- in OpenClaw, the extension handles that internal authorization automatically after the user explicitly confirms the shown summary in chat; do not ask OpenClaw users for `/approve`, buttons, popups, or a manual token
|
|
157
|
+
- on mainnet networks, that internal authorization must include explicit mainnet confirmation
|
|
158
|
+
- on mainnet networks, preview and prepare responses include a `confirmation_summary` and `mainnet_warning` to force a clearer final confirmation step
|
|
159
|
+
|
|
160
|
+
## Install
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
cd agent-wallet
|
|
164
|
+
pip install -e .
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
If you want a simpler local setup flow, use the installer:
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
sh ../setup.sh
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
The public npm entrypoint is a universal host orchestrator:
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
npx @onecraft/wallet install --yes
|
|
177
|
+
npx @onecraft/wallet install --yes --hosts codex,claude-code
|
|
178
|
+
npx @onecraft/wallet detect --json
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
It detects OpenClaw, Codex, Cursor, Claude Code, and Hermes before installation. The
|
|
182
|
+
direct `setup.sh`/Python path retains its OpenClaw-oriented default for
|
|
183
|
+
backward compatibility; the npm CLI passes `--no-configure-openclaw` and lets
|
|
184
|
+
the selected OpenClaw host adapter own `openclaw.json`.
|
|
185
|
+
|
|
186
|
+
If you already use a local coding agent on the same machine, it can run this installer for you. You can simply ask the agent to install the wallet, and it can perform the file setup, Python setup, and selected host-bridge setup automatically.
|
|
187
|
+
|
|
188
|
+
By default it will:
|
|
189
|
+
|
|
190
|
+
- create `.env` from `.env.example` if missing
|
|
191
|
+
- create `.venv` and install `agent-wallet` into it
|
|
192
|
+
- install Node dependencies for `wdk-evm-wallet`
|
|
193
|
+
- create a minimal `~/.openclaw/openclaw.json` if needed
|
|
194
|
+
- run `install_openclaw_local_config.py` automatically when the required secret env vars are already present
|
|
195
|
+
- otherwise return a JSON summary with `pending_env` and the exact next configure command
|
|
196
|
+
|
|
197
|
+
For a future `curl | bash` entrypoint, the repo now also includes a remote bootstrap wrapper at [`install-from-github.sh`](/Users/yuriytsygankov/Documents/openclaw_skill/install-from-github.sh). That script resolves the newest matching release bundle asset from GitHub Release metadata, downloads it, and then delegates to `setup.sh`.
|
|
198
|
+
|
|
199
|
+
For release assets, use the bundle builder:
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
python3 agent-wallet/scripts/build_release_bundle.py
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
That produces a release tarball with a broad runtime/backend slice of the repo while excluding the marketing site, docs site, local notes, and generated/dev artifacts.
|
|
206
|
+
|
|
207
|
+
The boundary stays the same: the operator must still provide the root secrets. The installer may be executed by an agent, but `AGENT_WALLET_BOOT_KEY`, `AGENT_WALLET_MASTER_KEY`, and `AGENT_WALLET_APPROVAL_SECRET` should be created or chosen by the user and then supplied to the runtime environment.
|
|
208
|
+
|
|
209
|
+
For a no-network or pre-existing Python setup, add:
|
|
210
|
+
|
|
211
|
+
```bash
|
|
212
|
+
python3 scripts/install_agent_wallet.py --skip-python-setup --skip-node-setup
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
## Configuration
|
|
216
|
+
|
|
217
|
+
Copy `.env.example` to `.env` and choose one of two modes:
|
|
218
|
+
|
|
219
|
+
1. Read-only:
|
|
220
|
+
set `SOLANA_AGENT_PUBLIC_KEY`
|
|
221
|
+
|
|
222
|
+
2. Signing:
|
|
223
|
+
set `SOLANA_AGENT_PRIVATE_KEY` or `SOLANA_AGENT_KEYPAIR_PATH`
|
|
224
|
+
|
|
225
|
+
For production `mainnet`, prefer a dedicated RPC instead of the public Solana endpoint. You can now configure either:
|
|
226
|
+
|
|
227
|
+
- `SOLANA_RPC_URL` for one primary endpoint
|
|
228
|
+
- `SOLANA_RPC_URLS` as a comma-separated ordered failover list
|
|
229
|
+
- or just `ALCHEMY_API_KEY` / `HELIUS_API_KEY`, which auto-derive a primary Solana RPC for `mainnet`
|
|
230
|
+
|
|
231
|
+
Production recommendation: treat RPC as deployment-owned config, not wallet logic. Runtime env wins over `openclaw.json` plugin config, so keep `Alchemy/Helius/QuickNode` endpoints in deployment secrets or service env and use plugin `rpcUrl` / `rpcUrls` only as local fallback.
|
|
232
|
+
|
|
233
|
+
For OpenClaw onboarding, `agent-wallet` now ships with a hosted default provider gateway:
|
|
234
|
+
|
|
235
|
+
- `https://agent-layer-production.up.railway.app`
|
|
236
|
+
|
|
237
|
+
So users do not need to enter `PROVIDER_GATEWAY_URL` manually for the default Bags launch/fees flows or shared mainnet RPC path. You only need to set `PROVIDER_GATEWAY_URL` yourself if you want to override that hosted default with your own deployment.
|
|
238
|
+
|
|
239
|
+
For a self-hosted install where each operator brings their own RPC key, a minimal Solana setup can be just:
|
|
240
|
+
|
|
241
|
+
```bash
|
|
242
|
+
AGENT_WALLET_BOOT_KEY=...
|
|
243
|
+
ALCHEMY_API_KEY=...
|
|
244
|
+
# or
|
|
245
|
+
HELIUS_API_KEY=...
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
`AGENT_WALLET_BOOT_KEY` is the root local secret for the wallet runtime. It is not a wallet private key, not a Solana keypair, and not something provided by this repository or by OpenClaw. The operator must generate it locally and keep it safe.
|
|
249
|
+
|
|
250
|
+
What it is used for:
|
|
251
|
+
|
|
252
|
+
- unlocking `~/.openclaw/sealed_keys.json`
|
|
253
|
+
- decrypting the stored `master_key`, `approval_secret`, and optional signer `private_key`
|
|
254
|
+
- allowing the runtime to start without placing those secrets directly in plain environment variables
|
|
255
|
+
|
|
256
|
+
What it is not:
|
|
257
|
+
|
|
258
|
+
- not the on-chain wallet address
|
|
259
|
+
- not the Solana signing key
|
|
260
|
+
- not a key that should be committed to GitHub
|
|
261
|
+
- not something the agent should silently invent and hide from the operator
|
|
262
|
+
|
|
263
|
+
Recommended generation:
|
|
264
|
+
|
|
265
|
+
```bash
|
|
266
|
+
openssl rand -base64 32
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
Alternative:
|
|
270
|
+
|
|
271
|
+
```bash
|
|
272
|
+
python3 -c "import secrets; print(secrets.token_urlsafe(32))"
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
Recommended handling:
|
|
276
|
+
|
|
277
|
+
- store it in a password manager or local secret store
|
|
278
|
+
- export it locally in shell env or deployment env
|
|
279
|
+
- keep a backup, because losing it means the existing `sealed_keys.json` bundle can no longer be decrypted
|
|
280
|
+
|
|
281
|
+
Example:
|
|
282
|
+
|
|
283
|
+
```bash
|
|
284
|
+
export AGENT_WALLET_BOOT_KEY='paste-generated-secret-here'
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
In that mode, `agent-wallet` will auto-resolve:
|
|
288
|
+
|
|
289
|
+
- `mainnet` -> `https://solana-mainnet.g.alchemy.com/v2/<ALCHEMY_API_KEY>`
|
|
290
|
+
- `mainnet` -> `https://mainnet.helius-rpc.com/?api-key=<HELIUS_API_KEY>`
|
|
291
|
+
|
|
292
|
+
and still append the official Solana endpoint as fallback.
|
|
293
|
+
|
|
294
|
+
For OpenClaw self-hosting, this means users can keep their own Alchemy/Helius key locally in `.env` or shell env. Nothing needs to be proxied or hosted by us.
|
|
295
|
+
|
|
296
|
+
For OpenClaw install/runtime, the default creation flow is:
|
|
297
|
+
|
|
298
|
+
1. OpenClaw plugin config sets `backend=solana_local`
|
|
299
|
+
2. The installer configures `network=mainnet` unless you pass `--network`
|
|
300
|
+
3. The installer calls host-side onboarding once the sealed runtime secrets exist
|
|
301
|
+
4. If no explicit sealed signer or `SOLANA_AGENT_KEYPAIR_PATH` exists, onboarding creates an encrypted per-user Solana wallet under `~/.openclaw/users/.../wallets/`
|
|
302
|
+
|
|
303
|
+
For multi-user OpenClaw integration, use `agent_wallet.user_wallets.create_wallet_backend_for_user(user_id)`.
|
|
304
|
+
That provisions a wallet per user under:
|
|
305
|
+
`~/.openclaw/users/<normalized-user-id>/wallets/solana-<network>-agent.json`
|
|
306
|
+
|
|
307
|
+
For the local EVM backend (`backend=wdk_evm_local`), the lifecycle is:
|
|
308
|
+
|
|
309
|
+
- the local `wdk-evm-wallet` service holds the encrypted seed vault
|
|
310
|
+
- the EVM service is localhost-only and no longer accepts remote service URLs through the OpenClaw EVM flow
|
|
311
|
+
- `agent-wallet` talks to it through a local bearer token loaded from `~/.openclaw/wdk-evm-wallet/local-auth-token`
|
|
312
|
+
- `agent-wallet` stores only a per-user EVM wallet binding under `~/.openclaw/users/<normalized-user-id>/wallets/evm-<network>-agent.json`
|
|
313
|
+
- the runtime can auto-create missing EVM bindings or auto-unlock the local vault during ordinary OpenClaw switching/tool calls when `sealed_keys.json` contains `wdk_evm_wallet_password`
|
|
314
|
+
- supported EVM networks are `ethereum` and `base`
|
|
315
|
+
- OpenClaw-facing EVM tools accept an optional per-call `network` override for `ethereum` or `base`, so the agent can switch between the two mainnet EVM paths without editing host config
|
|
316
|
+
- EVM `get_wallet_balance` now returns an enriched portfolio-style payload with native balance, discovered ERC-20 balances, and USD values when token discovery and pricing are available
|
|
317
|
+
- if a requested EVM network binding is missing, `agent-wallet` auto-binds it from the same local wallet when there is exactly one reusable EVM wallet for that user or when `wdkEvmWalletId` is provided explicitly
|
|
318
|
+
- you can manage that binding through `agent_wallet.openclaw_cli`:
|
|
319
|
+
- `evm-wallet-create`
|
|
320
|
+
- `evm-wallet-import`
|
|
321
|
+
- `evm-wallet-get`
|
|
322
|
+
- `evm-wallet-unlock`
|
|
323
|
+
- `evm-wallet-lock`
|
|
324
|
+
|
|
325
|
+
For a simpler host-side bootstrap, use:
|
|
326
|
+
|
|
327
|
+
```bash
|
|
328
|
+
sh agent-wallet/scripts/setup_evm_wallet.sh
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
That wrapper:
|
|
332
|
+
|
|
333
|
+
- prompts for `user-id` and EVM network when run interactively
|
|
334
|
+
- defaults to a per-install unix socket at `~/.openclaw/wdk-evm-wallet/daemon.sock`
|
|
335
|
+
(or wherever `OPENCLAW_HOME` points); set `WDK_EVM_SERVICE_URL` to override
|
|
336
|
+
with an explicit `unix://` or `http://` URL for either transport
|
|
337
|
+
- can auto-start `wdk-evm-wallet/run-local.sh` if the local service is not already healthy
|
|
338
|
+
- creates or unlocks the local EVM wallet binding
|
|
339
|
+
- also binds the paired EVM network by default: `ethereum <-> base`
|
|
340
|
+
- stores the entered EVM vault password into `sealed_keys.json` when `AGENT_WALLET_BOOT_KEY` is available, so later OpenClaw wallet switching can auto-raise the EVM backend without another password prompt
|
|
341
|
+
- patches OpenClaw config to `backend=wdk_evm_local`
|
|
342
|
+
|
|
343
|
+
Example host-side EVM wallet creation (explicit TCP `wdkEvmServiceUrl` override —
|
|
344
|
+
TCP mode is an opt-in for advanced/remote deployments via `WDK_EVM_TRANSPORT=tcp`
|
|
345
|
+
on the `wdk-evm-wallet` side, and no longer gets the same protection against a
|
|
346
|
+
foreign daemon sharing the port that the unix-socket default gets by construction):
|
|
347
|
+
|
|
348
|
+
```bash
|
|
349
|
+
printf '%s\n' 'your-local-evm-password' | \
|
|
350
|
+
python -m agent_wallet.openclaw_cli evm-wallet-create \
|
|
351
|
+
--user-id alice@example.com \
|
|
352
|
+
--password-stdin \
|
|
353
|
+
--config-json '{"backend":"wdk_evm_local","network":"ethereum","wdkEvmServiceUrl":"http://127.0.0.1:8081"}'
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
After that, `onboard` and `invoke` can use the bound EVM wallet by `user_id` without manually passing `wdkEvmWalletId` every time.
|
|
357
|
+
|
|
358
|
+
Per-user wallets are now encrypted at rest in one hardened mode:
|
|
359
|
+
|
|
360
|
+
- runtime must have `AGENT_WALLET_BOOT_KEY`
|
|
361
|
+
- runtime secrets live only in `~/.openclaw/sealed_keys.json`
|
|
362
|
+
- per-user HKDF derivation is always on for `user_id + network`
|
|
363
|
+
- per-user wallet files are always encrypted
|
|
364
|
+
- `AGENT_WALLET_MIGRATE_PLAINTEXT_USER_WALLETS=true` controls whether legacy plaintext/global-master wallets are auto-migrated on load
|
|
365
|
+
|
|
366
|
+
Do not store `masterKey`, `privateKey`, or approval secrets in plugin config JSON or direct runtime environment variables.
|
|
367
|
+
`AGENT_WALLET_MASTER_KEY`, `AGENT_WALLET_APPROVAL_SECRET`, and `SOLANA_AGENT_PRIVATE_KEY` are now provisioning-only inputs for installer/admin scripts and are rejected by the runtime.
|
|
368
|
+
The installer also provisions a sealed `wdk_evm_wallet_password` by default so greenfield EVM wallet setup can happen automatically on first switch.
|
|
369
|
+
Create or update that sealed file with:
|
|
370
|
+
|
|
371
|
+
```bash
|
|
372
|
+
AGENT_WALLET_BOOT_KEY=... \
|
|
373
|
+
AGENT_WALLET_MASTER_KEY=... \
|
|
374
|
+
AGENT_WALLET_APPROVAL_SECRET=... \
|
|
375
|
+
python scripts/install_openclaw_sealed_keys.py
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
Add `SOLANA_AGENT_PRIVATE_KEY=...` as well if you want the local signer secret to live in the sealed bundle instead of plain env.
|
|
379
|
+
If you already run `python scripts/install_openclaw_local_config.py` with `AGENT_WALLET_BOOT_KEY` and one or more of those secret env vars set, the installer now creates or updates `sealed_keys.json` automatically in the same pass.
|
|
380
|
+
|
|
381
|
+
If a legacy plaintext per-user wallet already exists, the helper will migrate it in place on the next successful load when a sealed master key is available.
|
|
382
|
+
Existing encrypted wallets created under the old global master-key mode are also migrated in place on the next successful load.
|
|
383
|
+
|
|
384
|
+
Mainnet hardening:
|
|
385
|
+
|
|
386
|
+
- per-user wallets now pin the expected wallet address in a sidecar file
|
|
387
|
+
- if a pinned `mainnet` wallet file disappears, the runtime refuses to silently create a replacement wallet
|
|
388
|
+
- this reduces the risk of a user unknowingly switching to a fresh address and losing access to funds at the original address
|
|
389
|
+
|
|
390
|
+
Operational helpers for the host runtime are also available in `agent_wallet.user_wallets`:
|
|
391
|
+
|
|
392
|
+
- `get_user_wallet_storage_info(...)`
|
|
393
|
+
- `export_user_wallet_backup(...)`
|
|
394
|
+
- `rotate_user_wallet_encryption(...)`
|
|
395
|
+
|
|
396
|
+
These are service-level helpers for OpenClaw runtime/admin flows and are intentionally not exposed as agent tools.
|
|
397
|
+
|
|
398
|
+
Recommended host-side runtime flow:
|
|
399
|
+
|
|
400
|
+
1. OpenClaw resolves the authenticated `user_id`
|
|
401
|
+
2. Host runtime calls `onboard_openclaw_user_wallet(user_id, ...)`
|
|
402
|
+
3. The helper provisions or loads the user wallet, builds the backend, adapter, and plugin bundle
|
|
403
|
+
4. Host runtime stores `session_metadata()` and registers `serializable_bundle()["tools"]`
|
|
404
|
+
5. Tool execution is delegated to `context.plugin_bundle["invoke"]`
|
|
405
|
+
|
|
406
|
+
This keeps wallet creation and custody in the host/runtime layer while the agent only sees the safe tool surface.
|
|
407
|
+
|
|
408
|
+
## Network switching
|
|
409
|
+
|
|
410
|
+
The wallet backend is already network-scoped:
|
|
411
|
+
|
|
412
|
+
- Solana stays on `mainnet`
|
|
413
|
+
- per-user Solana wallets continue to use `solana-mainnet-agent.json`
|
|
414
|
+
- switching EVM networks does not mix balances across chains
|
|
415
|
+
|
|
416
|
+
For a local OpenClaw install, use:
|
|
417
|
+
|
|
418
|
+
```bash
|
|
419
|
+
python agent-wallet/scripts/switch_openclaw_wallet_network.py --network mainnet
|
|
420
|
+
```
|
|
421
|
+
|
|
422
|
+
Useful flags:
|
|
423
|
+
|
|
424
|
+
- `--show-only` shows which wallet path will be used without changing config
|
|
425
|
+
- `--sign-only` or `--no-sign-only` updates the execution mode together with the network
|
|
426
|
+
- `--rpc-url` updates the local fallback RPC endpoint for the selected network
|
|
427
|
+
|
|
428
|
+
## Jupiter coverage
|
|
429
|
+
|
|
430
|
+
Current Jupiter integration now includes:
|
|
431
|
+
|
|
432
|
+
- `Ultra Swap` as the default swap path, with legacy `Metis` fallback
|
|
433
|
+
- `Price API` token lookup
|
|
434
|
+
- `Earn` reads and deposit/withdraw transaction building
|
|
435
|
+
|
|
436
|
+
Operational notes:
|
|
437
|
+
|
|
438
|
+
- Jupiter `Earn` can use the hosted or self-hosted provider gateway for shared onboarding-friendly access.
|
|
439
|
+
- Ordinary Jupiter swap routing remains direct and does not go through the provider gateway.
|
|
440
|
+
|
|
441
|
+
## Native staking coverage
|
|
442
|
+
|
|
443
|
+
Current native Solana staking integration now includes:
|
|
444
|
+
|
|
445
|
+
- validator discovery via Solana `getVoteAccounts`
|
|
446
|
+
- stake account inspection with activation status
|
|
447
|
+
- native `stake SOL` flow via the Solana Stake Program
|
|
448
|
+
- native stake deactivation
|
|
449
|
+
- native stake withdraw
|
|
450
|
+
|
|
451
|
+
Operational notes:
|
|
452
|
+
|
|
453
|
+
- this path uses Solana RPC and the Stake Program directly, without third-party DeFi APIs
|
|
454
|
+
- stake creation allocates a new stake account controlled by the connected wallet as staker and withdrawer
|
|
455
|
+
- preview and prepare were live-checked against a real wallet context
|
|
456
|
+
|
|
457
|
+
## Official OpenClaw plugin
|
|
458
|
+
|
|
459
|
+
For the official OpenClaw agent, the repository now includes a workspace extension at:
|
|
460
|
+
|
|
461
|
+
`.openclaw/extensions/agent-wallet`
|
|
462
|
+
|
|
463
|
+
That extension uses the documented OpenClaw plugin shape:
|
|
464
|
+
|
|
465
|
+
- `index.ts`
|
|
466
|
+
- `openclaw.plugin.json`
|
|
467
|
+
- `skills/wallet-operator/SKILL.md`
|
|
468
|
+
|
|
469
|
+
It forwards tool execution to the Python bridge CLI:
|
|
470
|
+
|
|
471
|
+
`python -m agent_wallet.openclaw_cli`
|
|
472
|
+
|
|
473
|
+
This keeps the official OpenClaw-facing layer in TypeScript while the actual wallet/security logic remains in the Python backend.
|
|
474
|
+
|
|
475
|
+
If you want OpenClaw to install the plugin through ClawHub instead of a repo-local path, use:
|
|
476
|
+
|
|
477
|
+
```bash
|
|
478
|
+
openclaw plugins install clawhub:@agentlayertech/agent-wallet-plugin
|
|
479
|
+
```
|
|
480
|
+
|
|
481
|
+
That native plugin package is additive. Keep the existing runtime installer for the actual wallet backend:
|
|
482
|
+
|
|
483
|
+
```bash
|
|
484
|
+
npx @onecraft/wallet install --yes
|
|
485
|
+
```
|
|
486
|
+
|
|
487
|
+
To bind a welcome invite from `https://www.agent-layer.tech/onboard` to the
|
|
488
|
+
local Base address during installation:
|
|
489
|
+
|
|
490
|
+
```bash
|
|
491
|
+
npx @onecraft/wallet install --yes --invite alw_...
|
|
492
|
+
```
|
|
493
|
+
|
|
494
|
+
The installer sends only the one-time invite and the public EVM address to the
|
|
495
|
+
OneCraft onboarding API. It never sends a private key, seed, wallet password,
|
|
496
|
+
local user ID, or telemetry install ID. A network or EVM provisioning failure
|
|
497
|
+
does not consume the invite and does not roll back the wallet installation.
|
|
498
|
+
|
|
499
|
+
The ClawHub plugin package auto-checks `~/.openclaw/agent-wallet-runtime/current/agent-wallet` before it falls back to a local workspace checkout.
|
|
500
|
+
|
|
501
|
+
Public-safe helper scripts are available in `agent-wallet/scripts/`:
|
|
502
|
+
|
|
503
|
+
- `install_openclaw_local_config.py`
|
|
504
|
+
- `finalize_openclaw_local_wallet_config.py`
|
|
505
|
+
|
|
506
|
+
Both scripts now use generic defaults instead of hardcoded local usernames or paths. Sensitive secrets must be supplied via protected environment variables, not config JSON or CLI arguments.
|
|
507
|
+
When `~/.openclaw/agent-wallet-runtime/current` exists, the config installer now prefers that trusted runtime path over a workspace checkout for the plugin manifest, package root, and Python bridge launcher.
|
|
508
|
+
|
|
509
|
+
Recommended Solana mainnet setup:
|
|
510
|
+
|
|
511
|
+
```bash
|
|
512
|
+
AGENT_WALLET_BACKEND=solana_local
|
|
513
|
+
AGENT_WALLET_BOOT_KEY=change-this-in-production
|
|
514
|
+
SOLANA_NETWORK=mainnet
|
|
515
|
+
SOLANA_RPC_URLS=https://api.mainnet-beta.solana.com
|
|
516
|
+
SOLANA_AUTO_CREATE_WALLET=true
|
|
517
|
+
AGENT_WALLET_SIGN_ONLY=false
|
|
518
|
+
```
|
|
519
|
+
|
|
520
|
+
## Current scope
|
|
521
|
+
|
|
522
|
+
- Solana balance lookup
|
|
523
|
+
- capability discovery
|
|
524
|
+
- message signing
|
|
525
|
+
- local keypair signer
|
|
526
|
+
|
|
527
|
+
The package now supports:
|
|
528
|
+
|
|
529
|
+
- transfer preview
|
|
530
|
+
- Jupiter token price lookup
|
|
531
|
+
- native SOL transfer execution
|
|
532
|
+
- native SOL staking preview, preparation, and execution
|
|
533
|
+
- native stake deactivation and withdraw flows
|
|
534
|
+
- SPL token transfer preview and execution by mint address
|
|
535
|
+
- Jupiter-based swap preview and execution on mainnet
|
|
536
|
+
- compact swap `fee_summary` in preview/prepare/execute, including known network fees and route fee bps when Jupiter provides them
|
|
537
|
+
- zero-balance token account cleanup
|
|
538
|
+
|
|
539
|
+
## Private prepaid card vault
|
|
540
|
+
|
|
541
|
+
The installer and updater automatically create a local card vault on macOS;
|
|
542
|
+
card issuance also provisions a missing vault for the actual runtime user.
|
|
543
|
+
No separate initialization or new password is required. The private decryption
|
|
544
|
+
key is protected by the macOS login Keychain, with system password authentication
|
|
545
|
+
on access. Wallet boot-key storage is independent and cannot open this vault.
|
|
546
|
+
|
|
547
|
+
Laso `/cards` responses are encrypted inside Python before host output. Use
|
|
548
|
+
`wallet vault list`, `wallet vault refresh <reference>` and
|
|
549
|
+
`wallet vault reveal <reference>` in your own terminal. macOS collects the
|
|
550
|
+
Keychain password in its own dialog. The CLI resolves the configured wallet
|
|
551
|
+
user ID automatically; `--user-id` can select a different runtime identity.
|
|
552
|
+
A legacy password vault can be moved with `wallet vault migrate` without
|
|
553
|
+
changing its card encryption keys. Other OS platforms currently have no
|
|
554
|
+
system-authenticated card vault implementation and use no plaintext fallback.
|
|
555
|
+
|
|
556
|
+
See [CARD_VAULT.md](CARD_VAULT.md) for architecture, commands, backup limitations,
|
|
557
|
+
research references and the future browser autofill boundary.
|
|
558
|
+
|
|
559
|
+
The agent can use `list_saved_cards`, `get_saved_card_status` and
|
|
560
|
+
`refresh_saved_card` without owner Keychain authentication. The catalog exposes
|
|
561
|
+
only references and masked metadata; balances/status are timestamped snapshots.
|
|
562
|
+
Pending issuance credentials are stored separately under a user-scoped runtime
|
|
563
|
+
encryption key until the card is ready, terminal, or the seven-day retrieval
|
|
564
|
+
window expires. Free refresh receives and encrypts details for the owner without
|
|
565
|
+
returning them to the model. This gives the backend an issuer-retrieval capability
|
|
566
|
+
while pending; it is not cryptographic isolation from a compromised runtime.
|
|
567
|
+
Refresh happens on tool calls, honors persisted retry timing and never purchases
|
|
568
|
+
another card. System authentication remains necessary for owner reveal.
|
|
569
|
+
|
|
570
|
+
### Private card use
|
|
571
|
+
|
|
572
|
+
`use_saved_card` previews an exact HTTPS request with card-field placeholders
|
|
573
|
+
and can combine Laso issuance and use under one normal host confirmation.
|
|
574
|
+
Execute with its `operation_id`. `continue_vault_operation` resumes an already
|
|
575
|
+
authorized delayed task without a second approval or owner unlock;
|
|
576
|
+
`get_vault_operation` reads its cached state. The fixed executor substitutes
|
|
577
|
+
fields internally and returns HTTP status only. It never exposes PAN/CVV or
|
|
578
|
+
raw provider output and never automatically repeats an uncertain payment.
|
|
579
|
+
|
|
580
|
+
Runtime-encrypted `.use` card capsules enable this path without a Keychain
|
|
581
|
+
prompt per use. They are decryptable by the wallet runtime, including after
|
|
582
|
+
issuance; this is a different boundary from the owner-authenticated reveal CLI.
|
|
583
|
+
Authorization lasts 48 hours and binds the exact request/card/wallet. This
|
|
584
|
+
supports private HTTPS use and managed Kernel checkout; local Chrome autofill remains separate.
|
|
585
|
+
|
|
586
|
+
### Kernel browser connection
|
|
587
|
+
|
|
588
|
+
Existing personal Kernel keys keep direct access. Without one, browsers use the
|
|
589
|
+
shared provider gateway automatically once its browser capability is enabled.
|
|
590
|
+
The gateway provisions a separate browser and a temporary credential restricted
|
|
591
|
+
to that browser. The local backend stores it encrypted and sends browser code
|
|
592
|
+
and card fields directly to Kernel, never through the gateway.
|
|
593
|
+
|
|
594
|
+
`wallet vault kernel-connect` remains an optional personal-key connection with
|
|
595
|
+
hidden terminal input. Keys stay in the encrypted runtime bundle. `kernel-status`
|
|
596
|
+
keeps its existing `configured` flag for personal keys and adds `connection_mode`
|
|
597
|
+
(`direct` or `shared_auto`); it is configuration, not a service health check.
|
|
598
|
+
`kernel-disconnect` removes the personal key, so new sessions select shared access.
|
|
599
|
+
Existing sessions retain their original connection mode.
|
|
600
|
+
|
|
601
|
+
`kernel_browser` prepares a billable cloud checkout with public form data.
|
|
602
|
+
`use_saved_card(checkout=...)` binds the browser, exact page, USD total, field
|
|
603
|
+
selectors and submit action to the existing host confirmation. It can issue a
|
|
604
|
+
card in that same task. The backend fills privately, locks observations and
|
|
605
|
+
closes the session after one attempt. Kernel and the merchant process the real
|
|
606
|
+
card data; the model receives only safe status. No local browser installation
|
|
607
|
+
is needed. See [the vault guide](CARD_VAULT.md) for limits and cleanup behavior.
|
|
608
|
+
|
|
609
|
+
For a private fill rehearsal, set `checkout.action` to `fill_only` and omit
|
|
610
|
+
`submit_selector` and `success_selector`. Keep the exact page, displayed USD
|
|
611
|
+
total and card-field bindings. The usual preview/approval flow authorizes only
|
|
612
|
+
that fill. The executor fills, checks the total again and closes the browser
|
|
613
|
+
without clicking submit. `checkout_filled` and `private_fill_completed=true`
|
|
614
|
+
report completion, not payment. No DOM or card values are returned. The page
|
|
615
|
+
and Kernel still receive card data and may react to input events.
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# Upgrade Compatibility
|
|
2
|
+
|
|
3
|
+
The wallet installer supports direct upgrades from older production releases.
|
|
4
|
+
Compatibility code is removed according to the minimum supported source
|
|
5
|
+
version, not according to elapsed time or a fixed number of releases.
|
|
6
|
+
|
|
7
|
+
## OneCraft naming and package migration
|
|
8
|
+
|
|
9
|
+
OneCraft is distributed as `@onecraft/wallet`. The earlier
|
|
10
|
+
`@agentlayer.tech/wallet` package receives the same release under its original
|
|
11
|
+
name so older installers can discover it through their existing `latest` tag.
|
|
12
|
+
Both packages expose `wallet` and share the runtime paths, host ownership
|
|
13
|
+
markers, plugin IDs, MCP tools, addresses, keychain entries, and approval flow.
|
|
14
|
+
Existing users can run `wallet update --yes` from their current installation.
|
|
15
|
+
|
|
16
|
+
Build both npm archives from a version-synchronized checkout with
|
|
17
|
+
`npm run pack:release`. Each listing has its own package name, description,
|
|
18
|
+
and README. Both archives contain the same runtime files. Verify fresh
|
|
19
|
+
installation, direct upgrades from the supported floor and the current stable
|
|
20
|
+
AgentLayer release, and rollback from the exact packed candidate before publishing.
|
|
21
|
+
Publish the OneCraft archive first, then the matching AgentLayer archive, both
|
|
22
|
+
with public access. Verify registry versions and integrity and smoke-test
|
|
23
|
+
both public commands before deploying the website and marketplace copy.
|
|
24
|
+
|
|
25
|
+
## Supported Floor
|
|
26
|
+
|
|
27
|
+
The current regression floor is `0.1.53`. CI must keep a direct upgrade fixture
|
|
28
|
+
at that floor until the project explicitly raises it in release documentation.
|
|
29
|
+
|
|
30
|
+
Raising the floor requires all of the following:
|
|
31
|
+
|
|
32
|
+
- a documented migration path for users below the new floor
|
|
33
|
+
- upgrade fixtures for the new floor and the latest stable release
|
|
34
|
+
- support and telemetry evidence that the retired path is no longer material
|
|
35
|
+
- a release note naming the removed compatibility behavior
|
|
36
|
+
|
|
37
|
+
## Compatibility Paths
|
|
38
|
+
|
|
39
|
+
| Path | Purpose | Removal condition |
|
|
40
|
+
|---|---|---|
|
|
41
|
+
| JavaScript boot-key fallback | Updates runtimes that predate the verified Python installer resolver. | The supported floor no longer includes releases without `resolve_boot_key_for_installer`; until then, isolated CI upgrades the published `0.1.53` package to the packed candidate and verifies boot-key, sealed-bundle, wallet-file, and address identity. |
|
|
42
|
+
| Directory runtime-pointer migration | Converts pre-versioned `current/` directories into release entries. | The supported floor guarantees symlink-based runtime pointers. |
|
|
43
|
+
| OpenClaw legacy adoption | Recognizes an AgentLayer entry whose package or extension path belongs to the active runtime home. | The supported floor guarantees an `integrations.json` OpenClaw ownership entry. |
|
|
44
|
+
| Hermes legacy adoption | Recognizes an AgentLayer plugin installed before the ownership registry. | The supported floor guarantees an `integrations.json` Hermes ownership entry. |
|
|
45
|
+
| Codex legacy adoption | Recognizes a matching local marketplace registration and AgentLayer manifest. | The supported floor guarantees an `integrations.json` Codex ownership entry. |
|
|
46
|
+
| Claude Code legacy adoption | Recognizes the AgentLayer marketplace and plugin manifest before registry ownership. | The supported floor guarantees an `integrations.json` Claude Code ownership entry. |
|
|
47
|
+
|
|
48
|
+
## Safety Rules
|
|
49
|
+
|
|
50
|
+
Shared Kernel access is additive: personal keys and old browser records retain
|
|
51
|
+
their direct-connection meaning. New shared records add a fixed connection mode,
|
|
52
|
+
gateway origin, lease ID, expiry and encrypted session key. Never rewrite an
|
|
53
|
+
existing operation or approval summary to select shared access. Installation
|
|
54
|
+
identity is a separate encrypted `browser_identity` record; old versions ignore
|
|
55
|
+
it. Wallet keys and vault recipients do not change. Existing provider routes and
|
|
56
|
+
their authentication are preserved. The direct-upgrade floor remains `0.1.53`.
|
|
57
|
+
Acceptance evidence and deployment constraints are recorded in
|
|
58
|
+
`../docs/plans/kernel-shared-browser-plan.md`. Both published upgrade paths are required
|
|
59
|
+
by the stable npm publication workflow.
|
|
60
|
+
|
|
61
|
+
- Legacy adoption requires independent registration and manifest evidence.
|
|
62
|
+
- Unknown or externally managed integrations are never adopted automatically.
|
|
63
|
+
- Compatibility paths must not weaken boot-key, sealed-state, approval, or
|
|
64
|
+
signing validation.
|
|
65
|
+
- Every retained path needs a direct-upgrade smoke test or an explicit fixture
|
|
66
|
+
showing why it remains necessary.
|