@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.
Files changed (248) hide show
  1. package/.claude-plugin/marketplace.json +20 -0
  2. package/.openclaw/AGENTS.md +100 -0
  3. package/.openclaw/extensions/agent-wallet/README.md +195 -0
  4. package/.openclaw/extensions/agent-wallet/dist/index.js +2198 -0
  5. package/.openclaw/extensions/agent-wallet/index.ts +2198 -0
  6. package/.openclaw/extensions/agent-wallet/openclaw.plugin.json +251 -0
  7. package/.openclaw/extensions/agent-wallet/package.json +49 -0
  8. package/.openclaw/extensions/agent-wallet/skills/cards/SKILL.md +211 -0
  9. package/.openclaw/extensions/agent-wallet/skills/wallet-operator/SKILL.md +30 -0
  10. package/CHANGELOG.md +1232 -0
  11. package/LICENSE +104 -0
  12. package/README.md +193 -2
  13. package/VERSION +1 -0
  14. package/agent-wallet/.env.example +63 -0
  15. package/agent-wallet/AGENTS.md +130 -0
  16. package/agent-wallet/CARD_VAULT.md +640 -0
  17. package/agent-wallet/README.md +615 -0
  18. package/agent-wallet/UPGRADE_COMPATIBILITY.md +66 -0
  19. package/agent-wallet/agent_wallet/__init__.py +16 -0
  20. package/agent-wallet/agent_wallet/approval.py +165 -0
  21. package/agent-wallet/agent_wallet/autonomous_permissions.py +281 -0
  22. package/agent-wallet/agent_wallet/autonomous_policy.py +305 -0
  23. package/agent-wallet/agent_wallet/autonomous_session.py +236 -0
  24. package/agent-wallet/agent_wallet/boot_key_migration.py +155 -0
  25. package/agent-wallet/agent_wallet/boot_key_recovery.py +57 -0
  26. package/agent-wallet/agent_wallet/bootstrap.py +194 -0
  27. package/agent-wallet/agent_wallet/card_catalog.py +243 -0
  28. package/agent-wallet/agent_wallet/card_runtime_secrets.py +108 -0
  29. package/agent-wallet/agent_wallet/card_vault.py +331 -0
  30. package/agent-wallet/agent_wallet/card_vault_cli.py +174 -0
  31. package/agent-wallet/agent_wallet/card_vault_import.py +65 -0
  32. package/agent-wallet/agent_wallet/card_vault_keychain.py +239 -0
  33. package/agent-wallet/agent_wallet/config.py +719 -0
  34. package/agent-wallet/agent_wallet/connector_cli.py +198 -0
  35. package/agent-wallet/agent_wallet/connectors/__init__.py +28 -0
  36. package/agent-wallet/agent_wallet/connectors/catalog.py +68 -0
  37. package/agent-wallet/agent_wallet/connectors/client.py +308 -0
  38. package/agent-wallet/agent_wallet/connectors/intent_policy.py +243 -0
  39. package/agent-wallet/agent_wallet/connectors/manifest.py +192 -0
  40. package/agent-wallet/agent_wallet/connectors/registry.py +341 -0
  41. package/agent-wallet/agent_wallet/encrypted_storage.py +314 -0
  42. package/agent-wallet/agent_wallet/evm_user_wallets.py +910 -0
  43. package/agent-wallet/agent_wallet/exceptions.py +10 -0
  44. package/agent-wallet/agent_wallet/file_ops.py +34 -0
  45. package/agent-wallet/agent_wallet/http_client.py +25 -0
  46. package/agent-wallet/agent_wallet/kernel_browser.py +479 -0
  47. package/agent-wallet/agent_wallet/kernel_cli.py +57 -0
  48. package/agent-wallet/agent_wallet/kernel_gateway.py +95 -0
  49. package/agent-wallet/agent_wallet/keystore.py +503 -0
  50. package/agent-wallet/agent_wallet/laso_card_vault.py +246 -0
  51. package/agent-wallet/agent_wallet/models.py +66 -0
  52. package/agent-wallet/agent_wallet/morpho_monitor.py +298 -0
  53. package/agent-wallet/agent_wallet/nonce_registry.py +59 -0
  54. package/agent-wallet/agent_wallet/openclaw_adapter.py +9129 -0
  55. package/agent-wallet/agent_wallet/openclaw_cli.py +658 -0
  56. package/agent-wallet/agent_wallet/openclaw_runtime.py +194 -0
  57. package/agent-wallet/agent_wallet/plugin_bundle.py +44 -0
  58. package/agent-wallet/agent_wallet/providers/__init__.py +1 -0
  59. package/agent-wallet/agent_wallet/providers/bags.py +202 -0
  60. package/agent-wallet/agent_wallet/providers/dexscreener.py +147 -0
  61. package/agent-wallet/agent_wallet/providers/evm_activity.py +257 -0
  62. package/agent-wallet/agent_wallet/providers/evm_portfolio.py +459 -0
  63. package/agent-wallet/agent_wallet/providers/imd.py +720 -0
  64. package/agent-wallet/agent_wallet/providers/jupiter.py +519 -0
  65. package/agent-wallet/agent_wallet/providers/kamino.py +404 -0
  66. package/agent-wallet/agent_wallet/providers/lifi.py +302 -0
  67. package/agent-wallet/agent_wallet/providers/solana_rpc.py +447 -0
  68. package/agent-wallet/agent_wallet/providers/tokenized_stocks.py +189 -0
  69. package/agent-wallet/agent_wallet/providers/wdk_evm_local.py +346 -0
  70. package/agent-wallet/agent_wallet/providers/x402.py +1972 -0
  71. package/agent-wallet/agent_wallet/sealed_keys.py +118 -0
  72. package/agent-wallet/agent_wallet/solana_stake.py +103 -0
  73. package/agent-wallet/agent_wallet/solana_tx.py +93 -0
  74. package/agent-wallet/agent_wallet/spending_limits.py +119 -0
  75. package/agent-wallet/agent_wallet/telemetry.py +481 -0
  76. package/agent-wallet/agent_wallet/transaction_policy.py +573 -0
  77. package/agent-wallet/agent_wallet/update_check.py +190 -0
  78. package/agent-wallet/agent_wallet/user_wallets.py +573 -0
  79. package/agent-wallet/agent_wallet/validation.py +31 -0
  80. package/agent-wallet/agent_wallet/vault_executor.py +456 -0
  81. package/agent-wallet/agent_wallet/wallet_layer/__init__.py +1 -0
  82. package/agent-wallet/agent_wallet/wallet_layer/base.py +1204 -0
  83. package/agent-wallet/agent_wallet/wallet_layer/base58.py +44 -0
  84. package/agent-wallet/agent_wallet/wallet_layer/factory.py +117 -0
  85. package/agent-wallet/agent_wallet/wallet_layer/solana.py +5246 -0
  86. package/agent-wallet/agent_wallet/wallet_layer/wdk_evm.py +2705 -0
  87. package/agent-wallet/examples/bootstrap_wallet.py +21 -0
  88. package/agent-wallet/examples/openclaw_runtime_onboarding.py +28 -0
  89. package/agent-wallet/examples/openclaw_user_wallet_example.py +31 -0
  90. package/agent-wallet/examples/openclaw_wallet_adapter_example.py +33 -0
  91. package/agent-wallet/openclaw.plugin.json +118 -0
  92. package/agent-wallet/pyproject.toml +36 -0
  93. package/agent-wallet/scripts/bootstrap_openclaw_evm.py +312 -0
  94. package/agent-wallet/scripts/build_release_bundle.py +210 -0
  95. package/agent-wallet/scripts/finalize_openclaw_local_wallet_config.py +121 -0
  96. package/agent-wallet/scripts/install_agent_wallet.py +1357 -0
  97. package/agent-wallet/scripts/install_openclaw_local_config.py +421 -0
  98. package/agent-wallet/scripts/install_openclaw_sealed_keys.py +117 -0
  99. package/agent-wallet/scripts/manage_openclaw_evm_wallet.py +333 -0
  100. package/agent-wallet/scripts/security_utils.py +37 -0
  101. package/agent-wallet/scripts/setup_evm_wallet.sh +140 -0
  102. package/agent-wallet/scripts/switch_openclaw_wallet_network.py +109 -0
  103. package/agent-wallet/skills/wallet-operator/SKILL.md +157 -0
  104. package/bin/lib/boot-key.mjs +184 -0
  105. package/bin/lib/evm-daemon.mjs +389 -0
  106. package/bin/lib/host-detection.mjs +259 -0
  107. package/bin/lib/integrations.mjs +578 -0
  108. package/bin/lib/release-python.mjs +9 -0
  109. package/bin/lib/update-transaction.mjs +235 -0
  110. package/bin/openclaw-agent-wallet.mjs +3354 -0
  111. package/claude-code/plugins/agent-wallet/.claude-plugin/plugin.json +19 -0
  112. package/claude-code/plugins/agent-wallet/.mcp.json +14 -0
  113. package/claude-code/plugins/agent-wallet/AGENTLAYER_AGENT_GUIDE.md +282 -0
  114. package/claude-code/plugins/agent-wallet/README.md +134 -0
  115. package/claude-code/plugins/agent-wallet/commands/agentlayer-autonomous-approve.md +39 -0
  116. package/claude-code/plugins/agent-wallet/commands/agentlayer-autonomous-revoke.md +17 -0
  117. package/claude-code/plugins/agent-wallet/commands/cards.md +129 -0
  118. package/claude-code/plugins/agent-wallet/commands/guide.md +40 -0
  119. package/claude-code/plugins/agent-wallet/commands/imd.md +125 -0
  120. package/claude-code/plugins/agent-wallet/commands/wallet-base.md +60 -0
  121. package/claude-code/plugins/agent-wallet/commands/wallet-ethereum.md +37 -0
  122. package/claude-code/plugins/agent-wallet/commands/wallet-evm.md +39 -0
  123. package/claude-code/plugins/agent-wallet/commands/wallet-setup.md +25 -0
  124. package/claude-code/plugins/agent-wallet/commands/wallet-sol.md +51 -0
  125. package/claude-code/plugins/agent-wallet/commands/wallet-statusline.md +34 -0
  126. package/claude-code/plugins/agent-wallet/commands/x402.md +121 -0
  127. package/claude-code/plugins/agent-wallet/commands/yield.md +62 -0
  128. package/claude-code/plugins/agent-wallet/hooks/hooks.json +16 -0
  129. package/claude-code/plugins/agent-wallet/scripts/bootstrap_backend.sh +136 -0
  130. package/claude-code/plugins/agent-wallet/scripts/enable_statusline.py +52 -0
  131. package/claude-code/plugins/agent-wallet/scripts/resolve_wallet_addresses.py +69 -0
  132. package/claude-code/plugins/agent-wallet/scripts/run_mcp.sh +66 -0
  133. package/claude-code/plugins/agent-wallet/scripts/wallet_statusline.py +130 -0
  134. package/claude-code/plugins/agent-wallet/scripts/wallet_statusline_setup.sh +40 -0
  135. package/claude-code/plugins/agent-wallet/skills/wallet-operator/SKILL.md +21 -0
  136. package/codex/plugins/agent-wallet/.codex-plugin/plugin.json +37 -0
  137. package/codex/plugins/agent-wallet/.mcp.json +15 -0
  138. package/codex/plugins/agent-wallet/README.md +158 -0
  139. package/codex/plugins/agent-wallet/scripts/run_mcp.sh +47 -0
  140. package/codex/plugins/agent-wallet/server.py +1797 -0
  141. package/codex/plugins/agent-wallet/skills/cards/SKILL.md +225 -0
  142. package/codex/plugins/agent-wallet/skills/imd/SKILL.md +145 -0
  143. package/codex/plugins/agent-wallet/skills/wallet-base/SKILL.md +56 -0
  144. package/codex/plugins/agent-wallet/skills/wallet-operator/SKILL.md +85 -0
  145. package/codex/plugins/agent-wallet/skills/wallet-sol/SKILL.md +29 -0
  146. package/codex/plugins/agent-wallet/skills/x402/SKILL.md +159 -0
  147. package/codex/plugins/agent-wallet/skills/yield/SKILL.md +65 -0
  148. package/connectors/AGENTS.md +37 -0
  149. package/connectors/DEVELOPER_GUIDE.md +131 -0
  150. package/connectors/README.md +139 -0
  151. package/connectors/READ_ONLY_BETA.md +54 -0
  152. package/connectors/RELEASING.md +48 -0
  153. package/connectors/conformance/README.md +31 -0
  154. package/connectors/conformance/package.json +54 -0
  155. package/connectors/conformance/scripts/sync-license.mjs +3 -0
  156. package/connectors/conformance/scripts/sync-spec.mjs +16 -0
  157. package/connectors/conformance/src/cli.ts +43 -0
  158. package/connectors/conformance/src/index.ts +7 -0
  159. package/connectors/conformance/src/runner.ts +314 -0
  160. package/connectors/conformance/src/types.ts +27 -0
  161. package/connectors/conformance/test/fixtures/invalid-response-identity.json +14 -0
  162. package/connectors/conformance/test/fixtures/missing-tool-fixture.json +4 -0
  163. package/connectors/conformance/test/runner.test.mjs +151 -0
  164. package/connectors/conformance/tsconfig.json +17 -0
  165. package/connectors/examples/reference-crypto-data/Dockerfile +21 -0
  166. package/connectors/examples/reference-crypto-data/README.md +51 -0
  167. package/connectors/examples/reference-crypto-data/conformance.json +11 -0
  168. package/connectors/examples/reference-crypto-data/connector.json +95 -0
  169. package/connectors/examples/reference-crypto-data/package.json +21 -0
  170. package/connectors/examples/reference-crypto-data/railway.toml +9 -0
  171. package/connectors/examples/reference-crypto-data/src/connector.ts +137 -0
  172. package/connectors/examples/reference-crypto-data/src/server.ts +13 -0
  173. package/connectors/examples/reference-crypto-data/test/connector.test.mjs +97 -0
  174. package/connectors/examples/reference-crypto-data/tsconfig.json +17 -0
  175. package/connectors/package-lock.json +561 -0
  176. package/connectors/package.json +19 -0
  177. package/connectors/scripts/smoke-packed-packages.mjs +121 -0
  178. package/connectors/sdk-typescript/README.md +47 -0
  179. package/connectors/sdk-typescript/package.json +49 -0
  180. package/connectors/sdk-typescript/scripts/sync-license.mjs +3 -0
  181. package/connectors/sdk-typescript/src/connector.ts +204 -0
  182. package/connectors/sdk-typescript/src/errors.ts +11 -0
  183. package/connectors/sdk-typescript/src/http.ts +116 -0
  184. package/connectors/sdk-typescript/src/index.ts +26 -0
  185. package/connectors/sdk-typescript/src/types.ts +101 -0
  186. package/connectors/sdk-typescript/test/sdk.test.mjs +181 -0
  187. package/connectors/sdk-typescript/tsconfig.json +21 -0
  188. package/connectors/spec/connector-manifest.schema.json +340 -0
  189. package/connectors/spec/connector-protocol.md +159 -0
  190. package/connectors/spec/transaction-intent.schema.json +281 -0
  191. package/connectors/templates/read-only/.env.example +1 -0
  192. package/connectors/templates/read-only/Dockerfile +11 -0
  193. package/connectors/templates/read-only/README.md +33 -0
  194. package/connectors/templates/read-only/conformance.json +11 -0
  195. package/connectors/templates/read-only/connector.json +64 -0
  196. package/connectors/templates/read-only/package.json +21 -0
  197. package/connectors/templates/read-only/railway.toml +9 -0
  198. package/connectors/templates/read-only/src/connector.ts +61 -0
  199. package/connectors/templates/read-only/src/server.ts +14 -0
  200. package/connectors/templates/read-only/test/connector.test.mjs +62 -0
  201. package/connectors/templates/read-only/tsconfig.json +17 -0
  202. package/cursor/plugins/agent-wallet/.cursor-plugin/plugin.json +14 -0
  203. package/cursor/plugins/agent-wallet/README.md +62 -0
  204. package/cursor/plugins/agent-wallet/mcp.json +16 -0
  205. package/cursor/plugins/agent-wallet/scripts/run_mcp.sh +33 -0
  206. package/cursor/plugins/agent-wallet/server.py +33 -0
  207. package/cursor/plugins/agent-wallet/skills/cards/SKILL.md +210 -0
  208. package/cursor/plugins/agent-wallet/skills/wallet-base/SKILL.md +56 -0
  209. package/cursor/plugins/agent-wallet/skills/wallet-operator/SKILL.md +23 -0
  210. package/cursor/plugins/agent-wallet/skills/wallet-sol/SKILL.md +29 -0
  211. package/cursor/plugins/agent-wallet/skills/x402/SKILL.md +130 -0
  212. package/hermes/plugins/agent_wallet/README.md +54 -0
  213. package/hermes/plugins/agent_wallet/__init__.py +55 -0
  214. package/hermes/plugins/agent_wallet/plugin.yaml +9 -0
  215. package/hermes/plugins/agent_wallet/schemas.py +211 -0
  216. package/hermes/plugins/agent_wallet/tools.py +622 -0
  217. package/install-from-github.sh +139 -0
  218. package/integrations/hedera/treasury-guard/README.md +92 -0
  219. package/integrations/hedera/treasury-guard/examples/treasury-policy.example.json +9 -0
  220. package/integrations/hedera/treasury-guard/package-lock.json +880 -0
  221. package/integrations/hedera/treasury-guard/package.json +8 -0
  222. package/integrations/hedera/treasury-guard/skills/onecraft-hedera-treasury/SKILL.md +22 -0
  223. package/integrations/hedera/treasury-guard/src/hedera-mirror-client.mjs +106 -0
  224. package/integrations/hedera/treasury-guard/src/hedera-signer.mjs +120 -0
  225. package/integrations/hedera/treasury-guard/src/treasury-cli.mjs +177 -0
  226. package/integrations/hedera/treasury-guard/src/treasury-policy.mjs +155 -0
  227. package/mcp/README.md +39 -0
  228. package/mcp/scripts/run_mcp.sh +37 -0
  229. package/mcp/server.py +33 -0
  230. package/package.json +106 -4
  231. package/scripts/check_release_version.mjs +72 -0
  232. package/scripts/version_targets.mjs +60 -0
  233. package/setup.sh +87 -0
  234. package/wdk-evm-wallet/.env.example +38 -0
  235. package/wdk-evm-wallet/README.md +254 -0
  236. package/wdk-evm-wallet/bootstrap.sh +8 -0
  237. package/wdk-evm-wallet/package-lock.json +2359 -0
  238. package/wdk-evm-wallet/package.json +43 -0
  239. package/wdk-evm-wallet/run-local.sh +12 -0
  240. package/wdk-evm-wallet/src/config.js +461 -0
  241. package/wdk-evm-wallet/src/imd.js +231 -0
  242. package/wdk-evm-wallet/src/json.js +35 -0
  243. package/wdk-evm-wallet/src/local_vault.js +407 -0
  244. package/wdk-evm-wallet/src/network_state.js +96 -0
  245. package/wdk-evm-wallet/src/pending_transactions.js +148 -0
  246. package/wdk-evm-wallet/src/server.js +849 -0
  247. package/wdk-evm-wallet/src/shutdown.js +63 -0
  248. package/wdk-evm-wallet/src/wdk_evm_wallet.js +10036 -0
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "agentlayer",
3
+ "description": "OneCraft plugins for Claude Code. Install the wallet bridge and its backend runtime without leaving the CLI.",
4
+ "owner": {
5
+ "name": "OneCraft",
6
+ "url": "https://github.com/lopushok9/Agent-Layer"
7
+ },
8
+ "renames": {
9
+ "agent-wallet": "wallet"
10
+ },
11
+ "plugins": [
12
+ {
13
+ "name": "wallet",
14
+ "displayName": "OneCraft Wallet",
15
+ "description": "Bridge to the local OneCraft wallet runtime (Solana, Bitcoin, EVM). Installs and connects the backend runtime on first use.",
16
+ "category": "development",
17
+ "source": "./claude-code/plugins/agent-wallet"
18
+ }
19
+ ]
20
+ }
@@ -0,0 +1,100 @@
1
+ # AGENTS.md
2
+
3
+ ## Scope
4
+ These instructions apply to the entire `.openclaw/` tree.
5
+
6
+ ## Purpose
7
+ This tree contains local OpenClaw host-side workspace assets. In the current repo, its main responsibilities are:
8
+
9
+ - the `agent-wallet` extension that bridges OpenClaw to the authoritative Python `agent-wallet` backend
10
+
11
+ ## Current structure
12
+ - `.openclaw/extensions/agent-wallet/index.ts` — TypeScript extension entrypoint registered by OpenClaw.
13
+ - `.openclaw/extensions/agent-wallet/openclaw.plugin.json` — plugin manifest and config schema.
14
+ - `.openclaw/extensions/agent-wallet/package.json` — extension package metadata.
15
+ - `.openclaw/extensions/agent-wallet/skills/wallet-operator/SKILL.md` — user-facing operational wallet safety guidance.
16
+
17
+ ## Design intent
18
+ - Keep the TypeScript extension thin and host-oriented.
19
+ - Let Python own wallet logic, policy, approvals, signing rules, and Solana implementation details.
20
+ - Let the extension focus on:
21
+ - resolving config
22
+ - locating the Python package
23
+ - invoking `python -m agent_wallet.openclaw_cli`
24
+ - registering OpenClaw tools
25
+ - passing JSON in and out safely
26
+ - mapping OpenClaw tool schemas to the Python CLI contract
27
+
28
+ ## Working rules
29
+
30
+ ### Keep bridge logic thin
31
+ - Do not duplicate business logic from Python unless OpenClaw requires it at registration time.
32
+ - Do not reimplement approval validation, transaction policy, wallet derivation, or Solana-specific rules in TypeScript.
33
+ - Prefer forwarding config into the CLI bridge and letting Python decide runtime behavior.
34
+ - Treat this layer as a transport and schema bridge, not an execution authority.
35
+
36
+ ### Keep schemas synchronized
37
+ - If you change extension config fields, also update the matching Python and docs surfaces:
38
+ - `.openclaw/extensions/agent-wallet/openclaw.plugin.json`
39
+ - `.openclaw/extensions/agent-wallet/index.ts`
40
+ - `agent-wallet/agent_wallet/openclaw_cli.py`
41
+ - `agent-wallet/README.md`
42
+ - If you add or remove tools, also update:
43
+ - `.openclaw/extensions/agent-wallet/index.ts`
44
+ - `agent-wallet/agent_wallet/openclaw_adapter.py`
45
+ - `agent-wallet/agent_wallet/plugin_bundle.py`
46
+ - `agent-wallet/tests/`
47
+ - If you change wallet safety semantics, update:
48
+ - `agent-wallet/agent_wallet/openclaw_adapter.py`
49
+ - `agent-wallet/agent_wallet/transaction_policy.py`
50
+ - `agent-wallet/agent_wallet/approval.py`
51
+ - the local OpenClaw skill docs in this tree
52
+
53
+ ### Security rules
54
+ - Never add support for passing wallet secrets through OpenClaw config JSON as the preferred path.
55
+ - Keep deprecated sensitive config fields clearly marked as insecure/deprecated if retained for compatibility.
56
+ - Do not move approval, signing, or execution policy into the TypeScript layer.
57
+ - Preserve the separation between host approval issuance and tool execution.
58
+ - Keep the extension from becoming a secret store or key-derivation service.
59
+
60
+ ### Path resolution expectations
61
+ - The extension currently resolves the Python package root from:
62
+ - explicit plugin config
63
+ - env overrides
64
+ - the repo-local sibling `agent-wallet/`
65
+ - Keep fallback resolution practical for local development.
66
+ - If changing path resolution, preserve a clear error when the package root cannot be found.
67
+ - Preserve deterministic resolution for workspace-relative installs and local dev shells.
68
+
69
+ ## Editing guidance
70
+ - Favor small edits in `index.ts`; it is intentionally straightforward.
71
+ - Keep tool parameter schemas explicit and JSON-schema-like.
72
+ - Keep stdout payloads machine-readable because OpenClaw expects structured JSON text content.
73
+ - Keep descriptions aligned with actual Python behavior, especially for `preview`, `prepare`, `execute`, and `approval_token`.
74
+ - If OpenClaw-facing schemas change, keep the bridge names, descriptions, and required fields in lockstep with Python.
75
+
76
+ ## Validation
77
+ - After extension changes, verify the matching Python CLI contract still lines up.
78
+ - Relevant Python-side tests live in `agent-wallet/tests/`, especially:
79
+ - `agent-wallet/tests/smoke_openclaw_cli.py`
80
+ - `agent-wallet/tests/smoke_openclaw_adapter.py`
81
+ - `agent-wallet/tests/smoke_openclaw_runtime.py`
82
+ - For wallet changes, also confirm the hidden operational surface stays disabled here unless the product decision changes.
83
+
84
+ ## Common change patterns
85
+
86
+ ### If changing tool registration
87
+ 1. Update `index.ts`.
88
+ 2. Sync the Python adapter/tool bundle.
89
+ 3. Confirm names, required params, and safety wording match.
90
+
91
+ ### If changing plugin config
92
+ 1. Update `openclaw.plugin.json`.
93
+ 2. Update TypeScript config consumption.
94
+ 3. Update Python CLI env/config mapping.
95
+ 4. Update docs/examples if behavior changed.
96
+
97
+ ### If changing wallet policy
98
+ 1. Update the Python backend first.
99
+ 2. Update the OpenClaw bridge schemas and descriptions second.
100
+ 3. Verify the extension still only forwards requests and never owns policy decisions.
@@ -0,0 +1,195 @@
1
+ # Agent Wallet OpenClaw Extension
2
+
3
+ Workspace extension for the official OpenClaw agent.
4
+
5
+ External install path:
6
+
7
+ ```bash
8
+ openclaw plugins install clawhub:@agentlayertech/agent-wallet-plugin
9
+ ```
10
+
11
+ This extension registers wallet tools through the official OpenClaw plugin API and forwards execution to the local Python `agent-wallet` backend.
12
+
13
+ It is designed so the OpenClaw agent sees a small operational wallet surface instead of raw key management.
14
+ In practice this means the agent works through explicit tools for:
15
+
16
+ - EVM native balance, ERC-20 balance/metadata, fee-rate, receipt, Velora and Uniswap swap quote/execute, Aave V3 account/reserve/position flows, and transfer flows through the local `wdk-evm-wallet` backend
17
+ - wallet address, balances, and portfolio reads
18
+ - native SOL and SPL token transfers
19
+ - Jupiter swap and price lookup, including Solana swap intent execution that refreshes quotes inside user-approved limits
20
+ - Kamino lending read/deposit/withdraw/borrow/repay flows
21
+ - native Solana staking, stake deactivation, and stake withdrawal
22
+
23
+ Expected local layout:
24
+
25
+ - this extension lives at `.openclaw/extensions/agent-wallet`
26
+ - the Python package lives at `agent-wallet/`
27
+
28
+ Recommended config:
29
+
30
+ ```json
31
+ {
32
+ "plugins": {
33
+ "allow": ["agent-wallet"],
34
+ "entries": {
35
+ "agent-wallet": {
36
+ "enabled": true,
37
+ "config": {
38
+ "userId": "openclaw-local-user",
39
+ "backend": "solana_local",
40
+ "network": "mainnet",
41
+ "rpcUrls": [
42
+ "https://your-primary-rpc.example",
43
+ "https://api.mainnet-beta.solana.com"
44
+ ],
45
+ "signOnly": false,
46
+ "encryptUserWallets": true,
47
+ "migratePlaintextUserWallets": true,
48
+ "refuseMainnetWalletRecreation": true,
49
+ "packageRoot": "/absolute/path/to/agent-wallet",
50
+ "pythonBin": "/absolute/path/to/python"
51
+ }
52
+ }
53
+ }
54
+ }
55
+ }
56
+ ```
57
+
58
+ Recommended local installer entrypoint:
59
+
60
+ ```bash
61
+ sh ./setup.sh
62
+ ```
63
+
64
+ For packaged installs, keep the runtime installer path:
65
+
66
+ ```bash
67
+ npx @onecraft/wallet install --yes
68
+ ```
69
+
70
+ The ClawHub plugin package only installs the native OpenClaw plugin. It expects the authoritative Python runtime to already exist, and by default it now looks for it at:
71
+
72
+ ```bash
73
+ ~/.openclaw/agent-wallet-runtime/current/agent-wallet
74
+ ```
75
+
76
+ If that runtime is not present, set `plugins.entries.agent-wallet.config.packageRoot` explicitly.
77
+
78
+ That installs the Python backend, Node dependencies for the local EVM runtime, patches the OpenClaw plugin config, and provisions the first encrypted per-user Solana mainnet wallet when no explicit signer is already configured. EVM readiness can still be auto-healed during normal wallet switching when the runtime has sealed local vault credentials.
79
+
80
+ For self-hosted installs, prefer `SOLANA_RPC_URL` / `SOLANA_RPC_URLS` in local env and treat the plugin `rpcUrl` / `rpcUrls` fields as fallback only. If the local runtime exposes `ALCHEMY_API_KEY` or `HELIUS_API_KEY`, the wallet can derive the Solana RPC URL automatically for `mainnet`. Local env always takes precedence over `openclaw.json`.
81
+
82
+ Provide only `AGENT_WALLET_BOOT_KEY` to the runtime. Provision `master_key`, `approval_secret`, and any signer `private_key` into `sealed_keys.json`, not `openclaw.json`.
83
+
84
+ Important:
85
+
86
+ - For a local official OpenClaw install, `userId` should represent the wallet owner for that agent install.
87
+ - The public OpenClaw plugin docs do not document a per-request end-user identifier in `registerTool(...).execute(...)`, so dynamic multi-user wallet selection is intentionally kept in the Python/runtime layer, not inside the TypeScript plugin itself.
88
+ - Helper scripts in `agent-wallet/scripts/` are generic patch/finalize utilities and no longer assume a specific local username, path, or temporary master key.
89
+ - The OpenClaw plugin API in this repo exposes tool registration, not host password prompts. EVM wallet create/unlock still is not a public agent tool, but the runtime can now auto-create or auto-unlock the local EVM wallet during `set_wallet_backend` or EVM tool calls when `sealed_keys.json` contains the local EVM vault password.
90
+ - The EVM flow also only supports local service URLs (`127.0.0.1` / `localhost` / `::1`) and uses a bearer token loaded from `~/.openclaw/wdk-evm-wallet/local-auth-token`.
91
+ - The installer now provisions a sealed local EVM vault password under `sealed_keys.json` by default, and host-side EVM setup helpers refresh that sealed value whenever the operator enters a new password.
92
+ - The EVM tool surface is intentionally narrow: Velora and Uniswap swap quote/execute, Aave V3 account/reserve/position flows, native transfers, ERC-20 transfers, fee quotes, and receipt lookup only. No arbitrary calldata, standalone approvals, or generic contract execution are exposed to the agent.
93
+ - Velora swap and Aave V3 support are currently limited to `ethereum` and `base`. Test carefully because the upstream WDK protocol packages are still beta.
94
+ - Agents can call `set_wallet_backend` to switch the active wallet for the current OpenClaw plugin session between Solana and EVM. This does not edit `openclaw.json`; plugin config remains the startup default.
95
+ - EVM core read and transfer tools accept an optional per-call `network` override for `ethereum`, `base`, or `robinhood`; Velora/Aave remain limited to Ethereum/Base, while Uniswap supports all three.
96
+ - Agents can also call `set_evm_network` to select the active EVM network for the current OpenClaw plugin session. After that, EVM tools default to the selected network unless a specific call passes its own `network` value. Do not edit code, plugin config, or environment variables just to switch between Base, Ethereum, and Robinhood.
97
+ - `get_wallet_balance` returns an enriched wallet overview for Solana and EVM: native balance, discovered token balances, per-asset USD values when pricing is available, and `total_value_usd`.
98
+ - Solana wallet overview uses Solana RPC only for balance and token-account discovery. Token prices come from Jupiter, not RPC, and internal transfer/staking checks continue to use native-only balance reads.
99
+ - Optional Jupiter overrides are available via `jupiterBaseUrl`, `jupiterUltraBaseUrl`, `jupiterPriceBaseUrl`, `jupiterPortfolioBaseUrl`, and `jupiterApiKey`.
100
+ - Optional Kamino overrides are available via `kaminoBaseUrl` and `kaminoProgramId`.
101
+ - Jupiter `Portfolio` implementation remains in the backend, but those agent-facing tools are temporarily disabled for now.
102
+ - Mainnet wallets are pinned by address. If a pinned mainnet wallet file disappears, the runtime refuses to silently create a replacement wallet.
103
+
104
+ ## OpenClaw UX
105
+
106
+ The intended user-facing flow inside OpenClaw is:
107
+
108
+ 1. Read first:
109
+ use wallet address, balance, portfolio, validator list, or stake account inspection tools.
110
+ 2. Preview next:
111
+ transfers, swaps, Aave position changes, staking, stake deactivation, and stake withdrawals should start in `preview`.
112
+ 3. Prepare only with intent:
113
+ `prepare` is for explicit execution planning intent and returns no signed transaction bytes.
114
+ 4. Execute only after chat confirmation:
115
+ after the user explicitly confirms the shown preview/prepare summary in chat, call `execute` with the same semantic params. The OpenClaw extension handles the internal execution authorization automatically and binds it to the cached operation.
116
+ 5. On mainnet, restate the network, asset, amount, and destination, validator, or stake account before execute.
117
+
118
+ For staking specifically, the normal agent flow should be:
119
+
120
+ 1. `get_solana_staking_validators`
121
+ 2. `stake_sol_native` in `preview`
122
+ 3. `stake_sol_native` in `execute`
123
+ 4. `get_solana_stake_account`
124
+ 5. later, `deactivate_solana_stake` and `withdraw_solana_stake`
125
+
126
+ ## Switching networks
127
+
128
+ The extension is already network-aware:
129
+
130
+ - `plugins.entries.agent-wallet.config.network` selects `mainnet` for Solana or the supported EVM networks
131
+ - Solana mainnet wallets keep the same per-user file layout
132
+ - switching the configured backend network does not merge balances across chains
133
+
134
+ Recommended local switch helper:
135
+
136
+ ```bash
137
+ python agent-wallet/scripts/switch_openclaw_wallet_network.py --network mainnet
138
+ ```
139
+
140
+ Use `--show-only` first if you want to inspect the target wallet path before changing the config.
141
+
142
+ ## Private card storage
143
+
144
+ The `cards` skill uses the existing x402 tools. The Python runtime encrypts
145
+ Laso responses before returning a vault reference, status and masked last4.
146
+ No PAN, CVV or issuer token is returned to the extension. Installation and
147
+ updates provision a card vault automatically on macOS; the backend also handles
148
+ missing vaults for custom runtime user IDs before card payment.
149
+
150
+ The private key is held in macOS login Keychain with system authentication,
151
+ separately from the wallet boot-key store. Use `wallet vault list`,
152
+ `wallet vault refresh <reference>` and `wallet vault reveal <reference>` in
153
+ your own terminal. The CLI reads the configured user ID; `--user-id` overrides
154
+ it. macOS displays its own password dialog. Never pass passwords through plugin
155
+ configuration or chat. Existing password vaults need one-time migration via
156
+ `wallet vault migrate`. Managed Kernel checkout is available; local Chrome autofill remains separate.
157
+
158
+ Agent tools `list_saved_cards`, `get_saved_card_status` and `refresh_saved_card`
159
+ forward to Python for a masked catalog and free pending-issuance retrieval.
160
+ They take only local references/pagination, never user IDs, issuer credentials,
161
+ URLs or headers. Pending retrieval uses backend-encrypted working credentials;
162
+ card data is encrypted for the owner and is never returned to the extension.
163
+ These are provider reads with local cache updates and no spending or signing.
164
+ The Python bundle, Codex MCP bridge and OpenClaw schemas expose the same tools.
165
+
166
+ ### Private card use
167
+
168
+ `use_saved_card` previews an exact HTTPS request with card-field placeholders
169
+ and can combine Laso issuance and use under one normal host confirmation.
170
+ Execute with its `operation_id`. `continue_vault_operation` resumes an already
171
+ authorized delayed task without a second approval or owner unlock;
172
+ `get_vault_operation` reads its cached state. The fixed executor substitutes
173
+ fields internally and returns HTTP status only. It never exposes PAN/CVV or
174
+ raw provider output and never automatically repeats an uncertain payment.
175
+
176
+ Runtime-encrypted `.use` card capsules enable this path without a Keychain
177
+ prompt per use. They are decryptable by the wallet runtime, including after
178
+ issuance; this is a different boundary from the owner-authenticated reveal CLI.
179
+ Authorization lasts 48 hours and binds the exact request/card/wallet. This
180
+ supports private HTTPS use and managed Kernel checkout; local Chrome autofill remains separate.
181
+
182
+ ### Kernel browser connection
183
+
184
+ Run `wallet vault kernel-connect` in your own terminal and paste the dashboard
185
+ API key at the hidden prompt. The key is saved in the encrypted runtime bundle,
186
+ never in plugin config or chat. `wallet vault kernel-status` reports configuration;
187
+ `wallet vault kernel-disconnect` removes the saved key.
188
+
189
+ `kernel_browser` prepares a billable cloud checkout with public form data.
190
+ `use_saved_card(checkout=...)` binds the browser, exact page, USD total, field
191
+ selectors and submit action to the existing host confirmation. It can issue a
192
+ card in that same task. The backend fills privately, locks observations and
193
+ closes the session after one attempt. Kernel and the merchant process the real
194
+ card data; the model receives only safe status. No local browser installation
195
+ is needed. See [the vault guide](../../../agent-wallet/CARD_VAULT.md) for limits and cleanup behavior.