@agentlayer.tech/wallet 0.1.0

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 (96) hide show
  1. package/.openclaw/AGENTS.md +98 -0
  2. package/.openclaw/extensions/agent-wallet/README.md +127 -0
  3. package/.openclaw/extensions/agent-wallet/index.ts +1520 -0
  4. package/.openclaw/extensions/agent-wallet/openclaw.plugin.json +184 -0
  5. package/.openclaw/extensions/agent-wallet/package.json +11 -0
  6. package/.openclaw/extensions/agent-wallet/skills/wallet-operator/SKILL.md +20 -0
  7. package/CHANGELOG.md +42 -0
  8. package/LICENSE +104 -0
  9. package/README.md +332 -0
  10. package/RELEASING.md +204 -0
  11. package/agent-wallet/.env.example +62 -0
  12. package/agent-wallet/AGENTS.md +129 -0
  13. package/agent-wallet/README.md +527 -0
  14. package/agent-wallet/agent_wallet/__init__.py +11 -0
  15. package/agent-wallet/agent_wallet/approval.py +161 -0
  16. package/agent-wallet/agent_wallet/bootstrap.py +178 -0
  17. package/agent-wallet/agent_wallet/btc_user_wallets.py +217 -0
  18. package/agent-wallet/agent_wallet/config.py +382 -0
  19. package/agent-wallet/agent_wallet/encrypted_storage.py +161 -0
  20. package/agent-wallet/agent_wallet/evm_user_wallets.py +370 -0
  21. package/agent-wallet/agent_wallet/exceptions.py +9 -0
  22. package/agent-wallet/agent_wallet/file_ops.py +34 -0
  23. package/agent-wallet/agent_wallet/http_client.py +25 -0
  24. package/agent-wallet/agent_wallet/models.py +66 -0
  25. package/agent-wallet/agent_wallet/nonce_registry.py +59 -0
  26. package/agent-wallet/agent_wallet/openclaw_adapter.py +5128 -0
  27. package/agent-wallet/agent_wallet/openclaw_cli.py +626 -0
  28. package/agent-wallet/agent_wallet/openclaw_runtime.py +272 -0
  29. package/agent-wallet/agent_wallet/plugin_bundle.py +42 -0
  30. package/agent-wallet/agent_wallet/providers/__init__.py +1 -0
  31. package/agent-wallet/agent_wallet/providers/bags.py +259 -0
  32. package/agent-wallet/agent_wallet/providers/evm_portfolio.py +470 -0
  33. package/agent-wallet/agent_wallet/providers/jupiter.py +567 -0
  34. package/agent-wallet/agent_wallet/providers/kamino.py +215 -0
  35. package/agent-wallet/agent_wallet/providers/lifi.py +277 -0
  36. package/agent-wallet/agent_wallet/providers/solana_rpc.py +470 -0
  37. package/agent-wallet/agent_wallet/providers/wdk_btc_local.py +114 -0
  38. package/agent-wallet/agent_wallet/providers/wdk_evm_local.py +205 -0
  39. package/agent-wallet/agent_wallet/sealed_keys.py +61 -0
  40. package/agent-wallet/agent_wallet/solana_stake.py +103 -0
  41. package/agent-wallet/agent_wallet/solana_tx.py +93 -0
  42. package/agent-wallet/agent_wallet/spending_limits.py +101 -0
  43. package/agent-wallet/agent_wallet/transaction_policy.py +518 -0
  44. package/agent-wallet/agent_wallet/user_wallets.py +355 -0
  45. package/agent-wallet/agent_wallet/validation.py +31 -0
  46. package/agent-wallet/agent_wallet/wallet_layer/__init__.py +1 -0
  47. package/agent-wallet/agent_wallet/wallet_layer/base.py +808 -0
  48. package/agent-wallet/agent_wallet/wallet_layer/base58.py +44 -0
  49. package/agent-wallet/agent_wallet/wallet_layer/factory.py +102 -0
  50. package/agent-wallet/agent_wallet/wallet_layer/solana.py +4252 -0
  51. package/agent-wallet/agent_wallet/wallet_layer/wdk_btc.py +272 -0
  52. package/agent-wallet/agent_wallet/wallet_layer/wdk_evm.py +1628 -0
  53. package/agent-wallet/examples/bootstrap_wallet.py +21 -0
  54. package/agent-wallet/examples/openclaw_runtime_onboarding.py +28 -0
  55. package/agent-wallet/examples/openclaw_user_wallet_example.py +31 -0
  56. package/agent-wallet/examples/openclaw_wallet_adapter_example.py +33 -0
  57. package/agent-wallet/openclaw.plugin.json +138 -0
  58. package/agent-wallet/pyproject.toml +31 -0
  59. package/agent-wallet/scripts/bootstrap_openclaw_btc.py +278 -0
  60. package/agent-wallet/scripts/build_release_bundle.py +188 -0
  61. package/agent-wallet/scripts/finalize_openclaw_local_wallet_config.py +121 -0
  62. package/agent-wallet/scripts/install_agent_wallet.py +505 -0
  63. package/agent-wallet/scripts/install_openclaw_local_config.py +226 -0
  64. package/agent-wallet/scripts/install_openclaw_sealed_keys.py +105 -0
  65. package/agent-wallet/scripts/manage_openclaw_btc_wallet.py +244 -0
  66. package/agent-wallet/scripts/reveal_btc_seed.sh +130 -0
  67. package/agent-wallet/scripts/security_utils.py +37 -0
  68. package/agent-wallet/scripts/setup_btc_wallet.sh +146 -0
  69. package/agent-wallet/scripts/switch_openclaw_wallet_network.py +106 -0
  70. package/agent-wallet/skills/wallet-operator/SKILL.md +128 -0
  71. package/bin/openclaw-agent-wallet.mjs +487 -0
  72. package/install-from-github.sh +134 -0
  73. package/package.json +61 -0
  74. package/setup.sh +40 -0
  75. package/wdk-btc-wallet/README.md +325 -0
  76. package/wdk-btc-wallet/bootstrap.sh +22 -0
  77. package/wdk-btc-wallet/package-lock.json +1839 -0
  78. package/wdk-btc-wallet/package.json +18 -0
  79. package/wdk-btc-wallet/run-local.sh +21 -0
  80. package/wdk-btc-wallet/src/config.js +160 -0
  81. package/wdk-btc-wallet/src/json.js +35 -0
  82. package/wdk-btc-wallet/src/local_vault.js +432 -0
  83. package/wdk-btc-wallet/src/network_state.js +84 -0
  84. package/wdk-btc-wallet/src/server.js +257 -0
  85. package/wdk-btc-wallet/src/wdk_btc_wallet.js +332 -0
  86. package/wdk-evm-wallet/README.md +183 -0
  87. package/wdk-evm-wallet/bootstrap.sh +8 -0
  88. package/wdk-evm-wallet/package-lock.json +2340 -0
  89. package/wdk-evm-wallet/package.json +23 -0
  90. package/wdk-evm-wallet/run-local.sh +12 -0
  91. package/wdk-evm-wallet/src/config.js +274 -0
  92. package/wdk-evm-wallet/src/json.js +35 -0
  93. package/wdk-evm-wallet/src/local_vault.js +430 -0
  94. package/wdk-evm-wallet/src/network_state.js +92 -0
  95. package/wdk-evm-wallet/src/server.js +575 -0
  96. package/wdk-evm-wallet/src/wdk_evm_wallet.js +4981 -0
@@ -0,0 +1,184 @@
1
+ {
2
+ "id": "agent-wallet",
3
+ "name": "Agent Wallet",
4
+ "description": "Official OpenClaw plugin bridge for the agent-wallet backends, including Solana, local BTC, and local EVM.",
5
+ "version": "0.1.0",
6
+ "skills": ["skills/wallet-operator"],
7
+ "configSchema": {
8
+ "type": "object",
9
+ "additionalProperties": false,
10
+ "properties": {
11
+ "userId": {
12
+ "type": "string",
13
+ "description": "Stable wallet owner identifier for this OpenClaw agent install."
14
+ },
15
+ "backend": {
16
+ "type": "string",
17
+ "description": "Wallet backend identifier. Supported values: solana_local, wdk_btc_local, wdk_evm_local."
18
+ },
19
+ "network": {
20
+ "type": "string",
21
+ "description": "Backend network selector. Solana uses mainnet/devnet/testnet. BTC uses bitcoin/testnet/regtest. EVM uses ethereum/sepolia/base/base-sepolia."
22
+ },
23
+ "wdkBtcServiceUrl": {
24
+ "type": "string",
25
+ "description": "Base URL for the localhost-only wdk-btc-wallet HTTP service when backend=wdk_btc_local."
26
+ },
27
+ "wdkBtcWalletId": {
28
+ "type": "string",
29
+ "description": "Optional direct walletId override from the local wdk-btc-wallet vault. If omitted, agent-wallet will look for a user-bound BTC wallet under ~/.openclaw/users/<user>/wallets/."
30
+ },
31
+ "wdkBtcAccountIndex": {
32
+ "type": "integer",
33
+ "description": "Optional BTC account index to expose to the agent. Defaults to 0."
34
+ },
35
+ "wdkEvmServiceUrl": {
36
+ "type": "string",
37
+ "description": "Base URL for the localhost-only wdk-evm-wallet HTTP service when backend=wdk_evm_local."
38
+ },
39
+ "wdkEvmWalletId": {
40
+ "type": "string",
41
+ "description": "Optional direct walletId override from the local wdk-evm-wallet vault. If omitted, agent-wallet will look for a user-bound EVM wallet under ~/.openclaw/users/<user>/wallets/."
42
+ },
43
+ "wdkEvmAccountIndex": {
44
+ "type": "integer",
45
+ "description": "Optional EVM account index to expose to the agent. Defaults to 0."
46
+ },
47
+ "rpcUrl": {
48
+ "type": "string",
49
+ "description": "Optional local fallback Solana RPC URL. Deployment env SOLANA_RPC_URL wins if set."
50
+ },
51
+ "rpcUrls": {
52
+ "type": "array",
53
+ "items": { "type": "string" },
54
+ "description": "Optional local fallback ordered list of Solana RPC URLs. Deployment env SOLANA_RPC_URLS wins if set."
55
+ },
56
+ "rpcProviderMode": {
57
+ "type": "string",
58
+ "description": "RPC mode: auto, user_direct, or shared_proxy. In auto mode, user RPC keys/URLs win; otherwise the shared provider gateway is used when configured."
59
+ },
60
+ "providerGatewayUrl": {
61
+ "type": "string",
62
+ "description": "Optional override for the shared provider gateway base URL. If omitted, the hosted OpenClaw gateway default is used for onboarding-friendly mainnet RPC and Bags launch/fees flows."
63
+ },
64
+ "providerGatewayRpcProvider": {
65
+ "type": "string",
66
+ "description": "Optional shared RPC upstream selection for the provider gateway: auto, shared, helius, or alchemy."
67
+ },
68
+ "swapProvider": {
69
+ "type": "string",
70
+ "description": "Optional Solana swap routing preference: auto or jupiter. Bags launch and fee flows still use the provider gateway separately, but token swaps stay Jupiter-first."
71
+ },
72
+ "heliusApiKey": {
73
+ "type": "string",
74
+ "description": "Optional user-owned Helius API key. If set, direct user RPC wins over shared proxy mode.",
75
+ "uiHints": {
76
+ "sensitive": true
77
+ }
78
+ },
79
+ "alchemyApiKey": {
80
+ "type": "string",
81
+ "description": "Optional user-owned Alchemy API key. If set, direct user RPC wins over shared proxy mode.",
82
+ "uiHints": {
83
+ "sensitive": true
84
+ }
85
+ },
86
+ "publicKey": {
87
+ "type": "string",
88
+ "description": "Read-only wallet public key."
89
+ },
90
+ "privateKey": {
91
+ "type": "string",
92
+ "description": "Deprecated insecure config path. Inject signing key material via environment variables or encrypted per-user wallets instead.",
93
+ "uiHints": {
94
+ "sensitive": true
95
+ }
96
+ },
97
+ "keypairPath": {
98
+ "type": "string",
99
+ "description": "Path to a Solana CLI JSON keypair file or encrypted wallet file."
100
+ },
101
+ "autoCreateWallet": {
102
+ "type": "boolean",
103
+ "description": "Create a wallet automatically on first use if none exists."
104
+ },
105
+ "signOnly": {
106
+ "type": "boolean",
107
+ "description": "If true, signing is allowed but broadcast should not happen automatically."
108
+ },
109
+ "masterKey": {
110
+ "type": "string",
111
+ "description": "Deprecated insecure config path. Inject the wallet master secret via environment or a secret manager instead.",
112
+ "uiHints": {
113
+ "sensitive": true
114
+ }
115
+ },
116
+ "approvalSecret": {
117
+ "type": "string",
118
+ "description": "Deprecated insecure config path. Inject the approval secret via environment or a secret manager instead.",
119
+ "uiHints": {
120
+ "sensitive": true
121
+ }
122
+ },
123
+ "encryptUserWallets": {
124
+ "type": "boolean",
125
+ "description": "If true, per-user wallets are encrypted at rest."
126
+ },
127
+ "migratePlaintextUserWallets": {
128
+ "type": "boolean",
129
+ "description": "If true, legacy plaintext wallets are migrated in place after successful load."
130
+ },
131
+ "refuseMainnetWalletRecreation": {
132
+ "type": "boolean",
133
+ "description": "If true, refuse to silently create a new mainnet wallet when a pinned address already exists."
134
+ },
135
+ "openclawHome": {
136
+ "type": "string",
137
+ "description": "Optional OpenClaw home directory for wallet state."
138
+ },
139
+ "pythonBin": {
140
+ "type": "string",
141
+ "description": "Python interpreter used to invoke the agent-wallet bridge CLI."
142
+ },
143
+ "packageRoot": {
144
+ "type": "string",
145
+ "description": "Absolute path to the local agent-wallet Python package root."
146
+ },
147
+ "jupiterBaseUrl": {
148
+ "type": "string",
149
+ "description": "Optional Jupiter Swap API base URL."
150
+ },
151
+ "jupiterUltraBaseUrl": {
152
+ "type": "string",
153
+ "description": "Optional Jupiter Ultra API base URL."
154
+ },
155
+ "jupiterPriceBaseUrl": {
156
+ "type": "string",
157
+ "description": "Optional Jupiter Price API base URL."
158
+ },
159
+ "jupiterPortfolioBaseUrl": {
160
+ "type": "string",
161
+ "description": "Optional Jupiter Portfolio API base URL."
162
+ },
163
+ "jupiterLendBaseUrl": {
164
+ "type": "string",
165
+ "description": "Optional Jupiter Lend API base URL."
166
+ },
167
+ "jupiterApiKey": {
168
+ "type": "string",
169
+ "description": "Optional Jupiter API key.",
170
+ "uiHints": {
171
+ "sensitive": true
172
+ }
173
+ },
174
+ "kaminoBaseUrl": {
175
+ "type": "string",
176
+ "description": "Optional Kamino REST API base URL."
177
+ },
178
+ "kaminoProgramId": {
179
+ "type": "string",
180
+ "description": "Optional Kamino lending program id."
181
+ }
182
+ }
183
+ }
184
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "agent-wallet",
3
+ "version": "0.1.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "openclaw": {
7
+ "extensions": [
8
+ "./index.ts"
9
+ ]
10
+ }
11
+ }
@@ -0,0 +1,20 @@
1
+ # Wallet Operator
2
+
3
+ Use wallet tools only when the user explicitly asks for wallet information, signing, transfers, swaps, or lending/yield actions.
4
+
5
+ Safety rules:
6
+
7
+ - Prefer read-only tools first.
8
+ - Jupiter Portfolio tools are temporarily disabled. Do not suggest or call them until they are re-enabled.
9
+ - Use Jupiter Earn read tools before Jupiter Earn writes when the user needs lending/yield context.
10
+ - Use Kamino market/reserve reads before Kamino writes when the user needs lending context.
11
+ - Use Aave account reads before Aave writes when the user needs EVM lending context.
12
+ - For transfers, native staking, swaps, Aave writes, Jupiter Earn writes, and Kamino writes, use `preview` before `prepare` or `execute`.
13
+ - Use `prepare` only when the user clearly intends to produce an execution plan.
14
+ - Use `execute` only after the host issues an `approval_token` bound to the exact previewed operation.
15
+ - On `mainnet`, require an approval token that includes explicit mainnet confirmation before any execution.
16
+ - Before any `mainnet` execute, restate the network, operation type, asset, amount, and destination, validator, or stake account.
17
+ - If a preview or prepare result includes `confirmation_summary` or `mainnet_warning`, surface that summary before asking for confirmation.
18
+ - Never claim funds moved unless the tool returns a confirmed transaction result.
19
+ - If the wallet is configured as `signOnly`, describe `prepare` output as an execution plan only, not a signed transaction.
20
+ - Use native staking read tools first when the user asks about validators, stake accounts, deactivation, or withdrawals.
package/CHANGELOG.md ADDED
@@ -0,0 +1,42 @@
1
+ # Changelog
2
+
3
+ ## Unreleased
4
+
5
+ - Replaced the repo license with `PolyForm Small Business 1.0.0`.
6
+ - Clarified in `README.md` that individuals can audit, fork, run, and modify
7
+ the code for themselves, and that company use follows the PolyForm small
8
+ business limits.
9
+ - Removed direct Mayan swap routing from `agent-wallet`, `.openclaw`, and
10
+ `wdk-evm-wallet`; cross-chain swaps now stay on LI.FI/Jupiter-backed paths
11
+ with Mayan denied as a LI.FI bridge.
12
+
13
+ ## v0.1.0-beta.2 - 2026-03-31
14
+
15
+ Second public beta release that expands the stack beyond the initial MCP, wallet, and AgentLayer bridge scope.
16
+
17
+ ### Added
18
+
19
+ - `wdk-btc-wallet/`: separate BTC-only wallet service built on top of Tether WDK for local Bitcoin wallet operations.
20
+ - `provider-gateway/`: non-custodial shared provider access layer for hosted Solana RPC defaults, Bags launch and fees, and Jupiter Earn.
21
+ - `docs/`: Starlight-based documentation app for AgentLayer onboarding, architecture, and capability docs.
22
+
23
+ ### Notes
24
+
25
+ - `mcp-server/`, `agent-wallet/`, and `.openclaw/extensions/agent-wallet/` remain part of the beta stack from `v0.1.0-beta.1`.
26
+ - This is still a beta release intended for testing, onboarding, and early integration work.
27
+ - Mainnet use should remain explicit, operator-approved, and cautious.
28
+
29
+ ## v0.1.0-beta.1 - 2026-03-21
30
+
31
+ First public beta centered on the repo's three primary deliverables: `mcp-server`, `agent-wallet`, and the AgentLayer bridge in `.openclaw/extensions/agent-wallet`.
32
+
33
+ ### Added
34
+
35
+ - `mcp-server/`: finance and crypto MCP server with market, DeFi, on-chain, and agent identity tooling.
36
+ - `agent-wallet/`: Python wallet backend for local Solana wallet operations with guarded read, preview, prepare, and execute flows.
37
+ - `.openclaw/extensions/agent-wallet/`: repo-shipped AgentLayer extension bridge that forwards tool execution into the Python wallet backend.
38
+
39
+ ### Notes
40
+
41
+ - This is a beta release intended for testing and early integration work.
42
+ - Mainnet use should remain explicit, operator-approved, and cautious.
package/LICENSE ADDED
@@ -0,0 +1,104 @@
1
+ PolyForm Small Business License 1.0.0
2
+
3
+ https://polyformproject.org/licenses/small-business/1.0.0
4
+
5
+ Required Notice: Copyright (c) 2026 lopushok9
6
+
7
+ Acceptance
8
+
9
+ In order to get any license under these terms, you must agree to them as both
10
+ strict obligations and conditions to all your licenses.
11
+
12
+ Copyright License
13
+
14
+ The licensor grants you a copyright license for the software to do everything
15
+ you might do with the software that would otherwise infringe the licensor's
16
+ copyright in it for any permitted purpose. However, you may only distribute
17
+ the software according to Distribution License and make changes or new works
18
+ based on the software according to Changes and New Works License.
19
+
20
+ Distribution License
21
+
22
+ The licensor grants you an additional copyright license to distribute copies of
23
+ the software. Your license to distribute covers distributing the software with
24
+ changes and new works permitted by Changes and New Works License.
25
+
26
+ Notices
27
+
28
+ You must ensure that anyone who gets a copy of any part of the software from
29
+ you also gets a copy of these terms or the URL for them above, as well as
30
+ copies of any plain-text lines beginning with "Required Notice:" that the
31
+ licensor provided with the software.
32
+
33
+ Changes and New Works License
34
+
35
+ The licensor grants you an additional copyright license to make changes and new
36
+ works based on the software for any permitted purpose.
37
+
38
+ Patent License
39
+
40
+ The licensor grants you a patent license for the software that covers patent
41
+ claims the licensor can license, or becomes able to license, that you would
42
+ infringe by using the software.
43
+
44
+ Fair Use
45
+
46
+ You may have "fair use" rights for the software under the law. These terms do
47
+ not limit them.
48
+
49
+ Small Business
50
+
51
+ Use of the software for the benefit of your company is use for a permitted
52
+ purpose if your company has fewer than 100 total individuals working as
53
+ employees and independent contractors, and less than 1,000,000 USD (2019)
54
+ total revenue in the prior tax year. Adjust this revenue threshold for
55
+ inflation according to the United States Bureau of Labor Statistics' consumer
56
+ price index for all urban consumers, U.S. city average, for all items, not
57
+ seasonally adjusted, with 1982-1984=100 reference base.
58
+
59
+ No Other Rights
60
+
61
+ These terms do not allow you to sublicense or transfer any of your licenses to
62
+ anyone else, or prevent the licensor from granting licenses to anyone else.
63
+ These terms do not imply any other licenses.
64
+
65
+ Patent Defense
66
+
67
+ If you make any written claim that the software infringes or contributes to
68
+ infringement of any patent, your patent license for the software granted under
69
+ these terms ends immediately. If your company makes such a claim, your patent
70
+ license ends immediately for work on behalf of your company.
71
+
72
+ Violations
73
+
74
+ The first time you are notified in writing that you have violated any of these
75
+ terms, or done anything with the software not covered by your licenses, your
76
+ licenses can nonetheless continue if you come into full compliance with these
77
+ terms, and take practical steps to correct past violations, within 32 days of
78
+ receiving notice. Otherwise, all your licenses end immediately.
79
+
80
+ No Liability
81
+
82
+ As far as the law allows, the software comes as is, without any warranty or
83
+ condition, and the licensor will not be liable to you for any damages arising
84
+ out of these terms or the use or nature of the software, under any kind of
85
+ legal claim.
86
+
87
+ Definitions
88
+
89
+ The licensor is the individual or entity offering these terms, and the
90
+ software is the software the licensor makes available under these terms.
91
+
92
+ You refers to the individual or entity agreeing to these terms.
93
+
94
+ Your company is any legal entity, sole proprietorship, or other kind of
95
+ organization that you work for, plus all organizations that have control over,
96
+ are under the control of, or are under common control with that organization.
97
+ Control means ownership of substantially all the assets of an entity, or the
98
+ power to direct its management and policies by vote, contract, or otherwise.
99
+ Control can be direct or indirect.
100
+
101
+ Your licenses are all the licenses granted to you for the software under these
102
+ terms.
103
+
104
+ Use means anything you do with the software requiring one of your licenses.