@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.
- package/.openclaw/AGENTS.md +98 -0
- package/.openclaw/extensions/agent-wallet/README.md +127 -0
- package/.openclaw/extensions/agent-wallet/index.ts +1520 -0
- package/.openclaw/extensions/agent-wallet/openclaw.plugin.json +184 -0
- package/.openclaw/extensions/agent-wallet/package.json +11 -0
- package/.openclaw/extensions/agent-wallet/skills/wallet-operator/SKILL.md +20 -0
- package/CHANGELOG.md +42 -0
- package/LICENSE +104 -0
- package/README.md +332 -0
- package/RELEASING.md +204 -0
- package/agent-wallet/.env.example +62 -0
- package/agent-wallet/AGENTS.md +129 -0
- package/agent-wallet/README.md +527 -0
- package/agent-wallet/agent_wallet/__init__.py +11 -0
- package/agent-wallet/agent_wallet/approval.py +161 -0
- package/agent-wallet/agent_wallet/bootstrap.py +178 -0
- package/agent-wallet/agent_wallet/btc_user_wallets.py +217 -0
- package/agent-wallet/agent_wallet/config.py +382 -0
- package/agent-wallet/agent_wallet/encrypted_storage.py +161 -0
- package/agent-wallet/agent_wallet/evm_user_wallets.py +370 -0
- package/agent-wallet/agent_wallet/exceptions.py +9 -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/models.py +66 -0
- package/agent-wallet/agent_wallet/nonce_registry.py +59 -0
- package/agent-wallet/agent_wallet/openclaw_adapter.py +5128 -0
- package/agent-wallet/agent_wallet/openclaw_cli.py +626 -0
- package/agent-wallet/agent_wallet/openclaw_runtime.py +272 -0
- package/agent-wallet/agent_wallet/plugin_bundle.py +42 -0
- package/agent-wallet/agent_wallet/providers/__init__.py +1 -0
- package/agent-wallet/agent_wallet/providers/bags.py +259 -0
- package/agent-wallet/agent_wallet/providers/evm_portfolio.py +470 -0
- package/agent-wallet/agent_wallet/providers/jupiter.py +567 -0
- package/agent-wallet/agent_wallet/providers/kamino.py +215 -0
- package/agent-wallet/agent_wallet/providers/lifi.py +277 -0
- package/agent-wallet/agent_wallet/providers/solana_rpc.py +470 -0
- package/agent-wallet/agent_wallet/providers/wdk_btc_local.py +114 -0
- package/agent-wallet/agent_wallet/providers/wdk_evm_local.py +205 -0
- package/agent-wallet/agent_wallet/sealed_keys.py +61 -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 +101 -0
- package/agent-wallet/agent_wallet/transaction_policy.py +518 -0
- package/agent-wallet/agent_wallet/user_wallets.py +355 -0
- package/agent-wallet/agent_wallet/validation.py +31 -0
- package/agent-wallet/agent_wallet/wallet_layer/__init__.py +1 -0
- package/agent-wallet/agent_wallet/wallet_layer/base.py +808 -0
- package/agent-wallet/agent_wallet/wallet_layer/base58.py +44 -0
- package/agent-wallet/agent_wallet/wallet_layer/factory.py +102 -0
- package/agent-wallet/agent_wallet/wallet_layer/solana.py +4252 -0
- package/agent-wallet/agent_wallet/wallet_layer/wdk_btc.py +272 -0
- package/agent-wallet/agent_wallet/wallet_layer/wdk_evm.py +1628 -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 +138 -0
- package/agent-wallet/pyproject.toml +31 -0
- package/agent-wallet/scripts/bootstrap_openclaw_btc.py +278 -0
- package/agent-wallet/scripts/build_release_bundle.py +188 -0
- package/agent-wallet/scripts/finalize_openclaw_local_wallet_config.py +121 -0
- package/agent-wallet/scripts/install_agent_wallet.py +505 -0
- package/agent-wallet/scripts/install_openclaw_local_config.py +226 -0
- package/agent-wallet/scripts/install_openclaw_sealed_keys.py +105 -0
- package/agent-wallet/scripts/manage_openclaw_btc_wallet.py +244 -0
- package/agent-wallet/scripts/reveal_btc_seed.sh +130 -0
- package/agent-wallet/scripts/security_utils.py +37 -0
- package/agent-wallet/scripts/setup_btc_wallet.sh +146 -0
- package/agent-wallet/scripts/switch_openclaw_wallet_network.py +106 -0
- package/agent-wallet/skills/wallet-operator/SKILL.md +128 -0
- package/bin/openclaw-agent-wallet.mjs +487 -0
- package/install-from-github.sh +134 -0
- package/package.json +61 -0
- package/setup.sh +40 -0
- package/wdk-btc-wallet/README.md +325 -0
- package/wdk-btc-wallet/bootstrap.sh +22 -0
- package/wdk-btc-wallet/package-lock.json +1839 -0
- package/wdk-btc-wallet/package.json +18 -0
- package/wdk-btc-wallet/run-local.sh +21 -0
- package/wdk-btc-wallet/src/config.js +160 -0
- package/wdk-btc-wallet/src/json.js +35 -0
- package/wdk-btc-wallet/src/local_vault.js +432 -0
- package/wdk-btc-wallet/src/network_state.js +84 -0
- package/wdk-btc-wallet/src/server.js +257 -0
- package/wdk-btc-wallet/src/wdk_btc_wallet.js +332 -0
- package/wdk-evm-wallet/README.md +183 -0
- package/wdk-evm-wallet/bootstrap.sh +8 -0
- package/wdk-evm-wallet/package-lock.json +2340 -0
- package/wdk-evm-wallet/package.json +23 -0
- package/wdk-evm-wallet/run-local.sh +12 -0
- package/wdk-evm-wallet/src/config.js +274 -0
- package/wdk-evm-wallet/src/json.js +35 -0
- package/wdk-evm-wallet/src/local_vault.js +430 -0
- package/wdk-evm-wallet/src/network_state.js +92 -0
- package/wdk-evm-wallet/src/server.js +575 -0
- package/wdk-evm-wallet/src/wdk_evm_wallet.js +4981 -0
package/README.md
ADDED
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+

|
|
2
|
+
|
|
3
|
+
# AgentLayer
|
|
4
|
+
|
|
5
|
+
AgentLayer is a beta local-first wallet and finance stack for agents.
|
|
6
|
+
|
|
7
|
+
The repository includes:
|
|
8
|
+
|
|
9
|
+
- `agent-wallet/` - the main wallet backend for AgentLayer
|
|
10
|
+
- `.openclaw/` - the local AgentLayer bridge layer
|
|
11
|
+
- `wdk-btc-wallet/` - the local Bitcoin wallet service
|
|
12
|
+
- `wdk-evm-wallet/` - the local EVM wallet service
|
|
13
|
+
- `provider-gateway/` - shared provider access for Solana RPC, Bags, and related finance reads
|
|
14
|
+
- `mcp-server/` - the finance and crypto MCP layer
|
|
15
|
+
|
|
16
|
+
The goal is simple:
|
|
17
|
+
|
|
18
|
+
- keep wallet secrets local
|
|
19
|
+
- let agents use constrained wallet capabilities
|
|
20
|
+
- support real onchain flows without giving agents direct key ownership
|
|
21
|
+
|
|
22
|
+
## Beta
|
|
23
|
+
|
|
24
|
+
This project is in beta.
|
|
25
|
+
|
|
26
|
+
Do not treat it as a finished production wallet stack. Test every flow before relying on it.
|
|
27
|
+
|
|
28
|
+
## Quick install
|
|
29
|
+
|
|
30
|
+
System prerequisites:
|
|
31
|
+
|
|
32
|
+
- `python3`
|
|
33
|
+
- `node`
|
|
34
|
+
- `npm`
|
|
35
|
+
|
|
36
|
+
Install from the latest GitHub release bundle:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
curl -fsSL https://raw.githubusercontent.com/lopushok9/Agent-Layer/main/install-from-github.sh | sh
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Install through npm:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
npx @agentlayer.tech/wallet install --yes
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Or install the CLI globally first:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
npm install -g @agentlayer.tech/wallet
|
|
52
|
+
openclaw-agent-wallet install --yes
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
The npm CLI runs the same bundled installer, but uses a versioned runtime layout:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
~/.openclaw/agent-wallet-runtime/releases/<version>
|
|
59
|
+
~/.openclaw/agent-wallet-runtime/current
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
`--yes` generates local runtime secrets when this is the first install. The installer stores `master_key` and `approval_secret` in `~/.openclaw/sealed_keys.json`; only the boot key needed to unlock that sealed bundle is written to the installed runtime `.env`.
|
|
63
|
+
|
|
64
|
+
Useful npm CLI commands:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
openclaw-agent-wallet status
|
|
68
|
+
openclaw-agent-wallet doctor
|
|
69
|
+
openclaw-agent-wallet update --yes
|
|
70
|
+
openclaw-agent-wallet rollback
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Install from a local clone:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
sh ./setup.sh
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
If you want the installer to finish the OpenClaw plugin wiring in the same pass, provide the runtime secrets before running it:
|
|
80
|
+
|
|
81
|
+
Solana:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
export AGENT_WALLET_BOOT_KEY="$(openssl rand -base64 32)"
|
|
85
|
+
export AGENT_WALLET_MASTER_KEY="$(openssl rand -base64 32)"
|
|
86
|
+
export AGENT_WALLET_APPROVAL_SECRET="$(openssl rand -base64 32)"
|
|
87
|
+
```
|
|
88
|
+
Bitcoin:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
sh agent-wallet/scripts/setup_btc_wallet.sh
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
EVM:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
cd wdk-evm-wallet && sh run-local.sh
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Create a local EVM wallet binding for an OpenClaw user:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
printf '%s\n' 'your-local-evm-password' | \
|
|
104
|
+
agent-wallet/.venv/bin/python -m agent_wallet.openclaw_cli evm-wallet-create \
|
|
105
|
+
--user-id your-user-id \
|
|
106
|
+
--password-stdin \
|
|
107
|
+
--config-json '{"backend":"wdk_evm_local","network":"base","wdkEvmServiceUrl":"http://127.0.0.1:8081"}'
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Unlock an existing EVM wallet binding:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
printf '%s\n' 'your-local-evm-password' | \
|
|
114
|
+
agent-wallet/.venv/bin/python -m agent_wallet.openclaw_cli evm-wallet-unlock \
|
|
115
|
+
--user-id your-user-id \
|
|
116
|
+
--password-stdin \
|
|
117
|
+
--config-json '{"backend":"wdk_evm_local","network":"base","wdkEvmServiceUrl":"http://127.0.0.1:8081"}'
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
That generates three fresh local secrets in the current shell session. If you prefer Python instead of `openssl`:
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
python3 -c "import secrets; print(secrets.token_urlsafe(32))"
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Run it three times and assign the outputs to:
|
|
127
|
+
|
|
128
|
+
- `AGENT_WALLET_BOOT_KEY`
|
|
129
|
+
- `AGENT_WALLET_MASTER_KEY`
|
|
130
|
+
- `AGENT_WALLET_APPROVAL_SECRET`
|
|
131
|
+
|
|
132
|
+
Without those secrets, the installer still lays down the runtime and installs dependencies, but it stops short of the final hardened OpenClaw config step and prints the exact `next_configure_command` you should run after secrets are available.
|
|
133
|
+
|
|
134
|
+
## Connect the MCP server
|
|
135
|
+
|
|
136
|
+
```json
|
|
137
|
+
{
|
|
138
|
+
"mcpServers": {
|
|
139
|
+
"agent-layer": {
|
|
140
|
+
"url": "https://agent-layer-production-852f.up.railway.app/mcp"
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
## What you get after install
|
|
147
|
+
|
|
148
|
+
If you install from GitHub release, the bundle is extracted under:
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
~/.openclaw/agent-wallet-runtime/current
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
The installer then does the following:
|
|
155
|
+
|
|
156
|
+
- creates `agent-wallet/.env` from `agent-wallet/.env.example` if it does not exist
|
|
157
|
+
- creates `agent-wallet/.venv` and installs the Python backend with `pip install -e`
|
|
158
|
+
- installs Node dependencies for `wdk-btc-wallet` and `wdk-evm-wallet`
|
|
159
|
+
- creates a minimal `~/.openclaw/openclaw.json` if one does not exist
|
|
160
|
+
- if the required secrets are already present, writes or updates `~/.openclaw/sealed_keys.json`
|
|
161
|
+
- if the required secrets are already present, patches `~/.openclaw/openclaw.json` to load the `agent-wallet` extension and point it at the installed runtime
|
|
162
|
+
|
|
163
|
+
When the installer reaches the final config step, the default plugin config is:
|
|
164
|
+
|
|
165
|
+
- `backend=solana_local`
|
|
166
|
+
- `network=devnet`
|
|
167
|
+
|
|
168
|
+
## What is not done automatically
|
|
169
|
+
|
|
170
|
+
The installer does not:
|
|
171
|
+
|
|
172
|
+
- create a BTC wallet
|
|
173
|
+
- unlock a BTC wallet
|
|
174
|
+
- create an EVM wallet
|
|
175
|
+
- unlock an EVM wallet
|
|
176
|
+
- start the local `wdk-btc-wallet` service
|
|
177
|
+
- start the local `wdk-evm-wallet` service
|
|
178
|
+
- expose seed phrases to the agent
|
|
179
|
+
- install `python3`, `node`, or `npm` for you
|
|
180
|
+
|
|
181
|
+
For Solana specifically, install alone does not make signed transactions available. You still need a readable wallet identity:
|
|
182
|
+
|
|
183
|
+
- read-only mode: `SOLANA_AGENT_PUBLIC_KEY`
|
|
184
|
+
- signing mode: a sealed `private_key` or `SOLANA_AGENT_KEYPAIR_PATH`
|
|
185
|
+
|
|
186
|
+
## BTC setup
|
|
187
|
+
|
|
188
|
+
The BTC path already has a one-command host bootstrap wrapper:
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
sh agent-wallet/scripts/setup_btc_wallet.sh
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
That flow:
|
|
195
|
+
|
|
196
|
+
- prompts for `user-id`
|
|
197
|
+
- prompts for `mainnet`, `testnet`, or `regtest`
|
|
198
|
+
- defaults to `http://127.0.0.1:8080`
|
|
199
|
+
- can auto-start `wdk-btc-wallet/run-local.sh` if the local service is not already healthy
|
|
200
|
+
- creates or unlocks the local BTC wallet binding
|
|
201
|
+
- patches OpenClaw config to `backend=wdk_btc_local`
|
|
202
|
+
|
|
203
|
+
BTC setup only supports localhost service URLs. The local BTC service is protected by a bearer token stored at:
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
~/.openclaw/wdk-btc-wallet/local-auth-token
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
If you need to reveal the BTC seed phrase later, that remains a host-side step:
|
|
210
|
+
|
|
211
|
+
```bash
|
|
212
|
+
sh agent-wallet/scripts/reveal_btc_seed.sh
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
## EVM setup
|
|
216
|
+
|
|
217
|
+
The EVM runtime is installed by `setup.sh`, but the host-side wallet onboarding is still a manual CLI flow.
|
|
218
|
+
|
|
219
|
+
Start the local EVM service:
|
|
220
|
+
|
|
221
|
+
```bash
|
|
222
|
+
cd wdk-evm-wallet && sh run-local.sh
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
Create a local EVM wallet binding for an OpenClaw user:
|
|
226
|
+
|
|
227
|
+
```bash
|
|
228
|
+
printf '%s\n' 'your-local-evm-password' | \
|
|
229
|
+
agent-wallet/.venv/bin/python -m agent_wallet.openclaw_cli evm-wallet-create \
|
|
230
|
+
--user-id your-user-id \
|
|
231
|
+
--password-stdin \
|
|
232
|
+
--config-json '{"backend":"wdk_evm_local","network":"base","wdkEvmServiceUrl":"http://127.0.0.1:8081"}'
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
Unlock an existing EVM wallet binding:
|
|
236
|
+
|
|
237
|
+
```bash
|
|
238
|
+
printf '%s\n' 'your-local-evm-password' | \
|
|
239
|
+
agent-wallet/.venv/bin/python -m agent_wallet.openclaw_cli evm-wallet-unlock \
|
|
240
|
+
--user-id your-user-id \
|
|
241
|
+
--password-stdin \
|
|
242
|
+
--config-json '{"backend":"wdk_evm_local","network":"base","wdkEvmServiceUrl":"http://127.0.0.1:8081"}'
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
Then switch the OpenClaw plugin config to the EVM backend:
|
|
246
|
+
|
|
247
|
+
```bash
|
|
248
|
+
AGENT_WALLET_BOOT_KEY='...' \
|
|
249
|
+
agent-wallet/.venv/bin/python agent-wallet/scripts/install_openclaw_local_config.py \
|
|
250
|
+
--backend wdk_evm_local \
|
|
251
|
+
--network base \
|
|
252
|
+
--user-id your-user-id \
|
|
253
|
+
--package-root agent-wallet \
|
|
254
|
+
--extension-path .openclaw/extensions/agent-wallet \
|
|
255
|
+
--python-bin agent-wallet/.venv/bin/python
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
That final config step assumes `~/.openclaw/sealed_keys.json` already exists. The normal path is to let the main installer create it by running install with `AGENT_WALLET_BOOT_KEY`, `AGENT_WALLET_MASTER_KEY`, and `AGENT_WALLET_APPROVAL_SECRET` available.
|
|
259
|
+
|
|
260
|
+
Important EVM notes:
|
|
261
|
+
|
|
262
|
+
- only localhost service URLs are supported for the OpenClaw EVM flow
|
|
263
|
+
- the local EVM service uses a bearer token at `~/.openclaw/wdk-evm-wallet/local-auth-token`
|
|
264
|
+
- the agent-facing EVM surface is intentionally narrow: balances, fee rates, receipts, transfers, Velora swaps, Aave V3 account/reserve/position flows, and Lido staking/withdrawal flows
|
|
265
|
+
- Velora swap and Aave V3 support are currently limited to `ethereum` and `base`
|
|
266
|
+
- Lido support is currently limited to `ethereum` and exposes read-only staking APR data from Lido's public API in the overview response
|
|
267
|
+
|
|
268
|
+
## Solana notes
|
|
269
|
+
|
|
270
|
+
The installer defaults the plugin to `solana_local` on `devnet`.
|
|
271
|
+
|
|
272
|
+
The Solana runtime uses hardened local secrets:
|
|
273
|
+
|
|
274
|
+
- `AGENT_WALLET_BOOT_KEY` is required by the runtime
|
|
275
|
+
- `master_key` and `approval_secret` should live in `~/.openclaw/sealed_keys.json`
|
|
276
|
+
- `AGENT_WALLET_MASTER_KEY` and `AGENT_WALLET_APPROVAL_SECRET` are provisioning inputs for installer/admin flows, not long-term runtime env
|
|
277
|
+
|
|
278
|
+
Read-only Solana mode:
|
|
279
|
+
|
|
280
|
+
```bash
|
|
281
|
+
export SOLANA_AGENT_PUBLIC_KEY='...'
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
Signing Solana mode can use either:
|
|
285
|
+
|
|
286
|
+
- a sealed `private_key` stored in `sealed_keys.json`
|
|
287
|
+
- `SOLANA_AGENT_KEYPAIR_PATH`
|
|
288
|
+
|
|
289
|
+
The default shared path already includes:
|
|
290
|
+
|
|
291
|
+
- hosted provider-gateway defaults
|
|
292
|
+
- shared Solana RPC path unless you override it
|
|
293
|
+
|
|
294
|
+
You only need to bring your own RPC if you want to override the default route. Supported override paths are:
|
|
295
|
+
|
|
296
|
+
- `SOLANA_RPC_URL`
|
|
297
|
+
- `SOLANA_RPC_URLS`
|
|
298
|
+
- `ALCHEMY_API_KEY`
|
|
299
|
+
- `HELIUS_API_KEY`
|
|
300
|
+
|
|
301
|
+
Automatic local Solana wallet creation exists, but it is off by default:
|
|
302
|
+
|
|
303
|
+
```bash
|
|
304
|
+
SOLANA_AUTO_CREATE_WALLET=false
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
## Security model
|
|
308
|
+
|
|
309
|
+
The core rule is:
|
|
310
|
+
|
|
311
|
+
the agent gets wallet capabilities, not wallet ownership.
|
|
312
|
+
|
|
313
|
+
That means:
|
|
314
|
+
|
|
315
|
+
- secret material stays local
|
|
316
|
+
- signing stays in the wallet layer
|
|
317
|
+
- risky writes require approval
|
|
318
|
+
- BTC and EVM password-gated wallet operations remain host-side
|
|
319
|
+
|
|
320
|
+
## License and community use
|
|
321
|
+
|
|
322
|
+
This repository is public and source-available under the `PolyForm Small Business License 1.0.0`.
|
|
323
|
+
|
|
324
|
+
If you are an individual developer, researcher, student, security reviewer, or hobbyist, you can:
|
|
325
|
+
|
|
326
|
+
- read and audit the code
|
|
327
|
+
- fork the repo
|
|
328
|
+
- run it locally
|
|
329
|
+
- modify it for yourself
|
|
330
|
+
- open issues and send pull requests
|
|
331
|
+
|
|
332
|
+
If you are using the project for a company, the license allows use for small businesses covered by the PolyForm thresholds. If you need rights beyond that, reach out for a separate commercial license.
|
package/RELEASING.md
ADDED
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
# Releasing
|
|
2
|
+
|
|
3
|
+
## npm installer package
|
|
4
|
+
|
|
5
|
+
The production installer is published as:
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
@agentlayer.tech/wallet
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Expected user install path:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npx @agentlayer.tech/wallet install --yes
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
The npm package ships source and installer scripts only. It must not ship local
|
|
18
|
+
state such as `node_modules/`, `.venv/`, `__pycache__/`, wallet files, or
|
|
19
|
+
OpenClaw secrets.
|
|
20
|
+
|
|
21
|
+
Before publishing a tag, verify locally:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm run check
|
|
25
|
+
python3 agent-wallet/tests/smoke_npm_installer.py
|
|
26
|
+
python3 agent-wallet/tests/smoke_install_agent_wallet.py
|
|
27
|
+
npm --cache /tmp/npm-cache pack --dry-run
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
The GitHub workflow `.github/workflows/npm-installer.yml` verifies the package
|
|
31
|
+
on pull requests and publishes tagged releases to npm. Repository secrets must
|
|
32
|
+
include:
|
|
33
|
+
|
|
34
|
+
```text
|
|
35
|
+
NPM_TOKEN
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Publish stable releases from version tags:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
git tag v0.1.0
|
|
42
|
+
git push origin v0.1.0
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
The workflow runs:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
npm publish --access public --provenance
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
For pre-release channels, publish manually or extend the workflow with npm
|
|
52
|
+
dist-tags:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
npm publish --access public --tag beta
|
|
56
|
+
npm dist-tag add @agentlayer.tech/wallet@0.1.0-beta.1 beta
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Runtime updates are versioned under:
|
|
60
|
+
|
|
61
|
+
```text
|
|
62
|
+
~/.openclaw/agent-wallet-runtime/releases/<version>
|
|
63
|
+
~/.openclaw/agent-wallet-runtime/current
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
The CLI switches `current` only after a successful install/update. `rollback`
|
|
67
|
+
switches `current` back to the recorded previous runtime or to a specific
|
|
68
|
+
installed version.
|
|
69
|
+
|
|
70
|
+
This repository's `v0.1.0-beta.2` public release should be framed around six repo-owned deliverables:
|
|
71
|
+
|
|
72
|
+
1. `mcp-server/` - the finance and crypto MCP server
|
|
73
|
+
2. `agent-wallet/` - the Python wallet backend
|
|
74
|
+
3. `.openclaw/extensions/agent-wallet/` - the repo-shipped OpenClaw extension bridge
|
|
75
|
+
4. `wdk-btc-wallet/` - the BTC-only wallet service built on Tether WDK
|
|
76
|
+
5. `provider-gateway/` - the shared non-custodial provider access layer
|
|
77
|
+
6. `docs/` - the Starlight-based documentation site
|
|
78
|
+
|
|
79
|
+
### Release title
|
|
80
|
+
|
|
81
|
+
```text
|
|
82
|
+
AgentLayer Beta v0.1.0-beta.2
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Release body
|
|
86
|
+
|
|
87
|
+
```md
|
|
88
|
+
This is the second public beta release of the OpenClaw finance stack.
|
|
89
|
+
|
|
90
|
+
This release keeps the original beta foundation and adds three new repo-owned components:
|
|
91
|
+
|
|
92
|
+
- `mcp-server/` - finance and crypto MCP server
|
|
93
|
+
- `agent-wallet/` - Python wallet backend
|
|
94
|
+
- `.openclaw/extensions/agent-wallet/` - OpenClaw extension bridge for the wallet backend
|
|
95
|
+
- `wdk-btc-wallet/` - BTC-only wallet service for local Bitcoin operations
|
|
96
|
+
- `provider-gateway/` - shared provider access for hosted Solana RPC defaults, Bags, and Jupiter Earn
|
|
97
|
+
- `docs/` - documentation app for setup, architecture, and capability reference
|
|
98
|
+
|
|
99
|
+
## Highlights
|
|
100
|
+
|
|
101
|
+
- Expands the beta stack with a dedicated local BTC wallet service
|
|
102
|
+
- Adds a non-custodial shared provider gateway for Solana RPC, Bags, and Jupiter Earn
|
|
103
|
+
- Adds a separate documentation app for onboarding and reference material
|
|
104
|
+
- Keeps the MCP server, wallet backend, and OpenClaw extension bridge as the core beta foundation
|
|
105
|
+
|
|
106
|
+
## Included in this release
|
|
107
|
+
|
|
108
|
+
### New in `v0.1.0-beta.2`
|
|
109
|
+
|
|
110
|
+
#### `wdk-btc-wallet/`
|
|
111
|
+
|
|
112
|
+
- Separate BTC-only wallet service built on top of Tether WDK
|
|
113
|
+
- Local encrypted wallet vault, localhost-only HTTP surface, and local bearer-token auth
|
|
114
|
+
- Covers Bitcoin network selection, wallet lifecycle, balances, transfers, fees, and spendability
|
|
115
|
+
|
|
116
|
+
#### `provider-gateway/`
|
|
117
|
+
|
|
118
|
+
- Shared non-custodial provider layer for onboarding-friendly defaults
|
|
119
|
+
- Hosted Solana RPC gateway with method allowlist
|
|
120
|
+
- Shared Bags launch and fees access plus shared Jupiter Earn relay
|
|
121
|
+
|
|
122
|
+
#### `docs/`
|
|
123
|
+
|
|
124
|
+
- Separate Starlight-based documentation app for AgentLayer
|
|
125
|
+
- Covers getting started, infrastructure boundaries, wallet architecture, and capabilities
|
|
126
|
+
- Gives the beta stack a repo-owned documentation surface for onboarding and review
|
|
127
|
+
|
|
128
|
+
### Existing beta foundation
|
|
129
|
+
|
|
130
|
+
#### `mcp-server/`
|
|
131
|
+
|
|
132
|
+
- MCP server for crypto, DeFi, gas, on-chain, and agent identity workflows
|
|
133
|
+
- Structured tools for market data, protocol analytics, and blockchain lookups
|
|
134
|
+
- Self-hostable base for OpenClaw or other MCP-compatible clients
|
|
135
|
+
|
|
136
|
+
#### `agent-wallet/`
|
|
137
|
+
|
|
138
|
+
- Local Solana wallet backend for OpenClaw-connected agents
|
|
139
|
+
- Read, preview, prepare, and approval-gated execute flows
|
|
140
|
+
- Local secret handling and explicit operator approval model for risky actions
|
|
141
|
+
|
|
142
|
+
#### `.openclaw/extensions/agent-wallet/`
|
|
143
|
+
|
|
144
|
+
- Thin TypeScript bridge from OpenClaw into the Python wallet backend
|
|
145
|
+
- Repo-tracked plugin manifest and config schema
|
|
146
|
+
- Keeps wallet policy and execution logic in Python while exposing a small operational tool surface to OpenClaw
|
|
147
|
+
|
|
148
|
+
## Beta notes
|
|
149
|
+
|
|
150
|
+
- This is a beta release and should not be treated as production-ready custody infrastructure
|
|
151
|
+
- Mainnet use should remain cautious, explicit, and operator-controlled
|
|
152
|
+
- Early feedback on usability, safety, and integration gaps is expected and welcome
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
## Suggested release note structure
|
|
156
|
+
|
|
157
|
+
### Highlights
|
|
158
|
+
|
|
159
|
+
- Expands the stack with `wdk-btc-wallet/`, `provider-gateway/`, and `docs/`
|
|
160
|
+
- Keeps `mcp-server/`, `agent-wallet/`, and `.openclaw/extensions/agent-wallet/` as the base beta foundation
|
|
161
|
+
- Beta release intended for testing, onboarding, and early adopters
|
|
162
|
+
|
|
163
|
+
### Included in this release
|
|
164
|
+
|
|
165
|
+
#### `wdk-btc-wallet/`
|
|
166
|
+
|
|
167
|
+
- Local BTC wallet service built on Tether WDK
|
|
168
|
+
- Wallet lifecycle, balances, fee rates, spendability, and transfer support
|
|
169
|
+
- Separate runtime from the existing Solana wallet backend
|
|
170
|
+
|
|
171
|
+
#### `provider-gateway/`
|
|
172
|
+
|
|
173
|
+
- Hosted Solana RPC defaults through a shared gateway
|
|
174
|
+
- Bags launch and fees provider access
|
|
175
|
+
- Jupiter Earn provider access
|
|
176
|
+
|
|
177
|
+
#### `docs/`
|
|
178
|
+
|
|
179
|
+
- Separate documentation app for setup and architecture reference
|
|
180
|
+
- Covers infrastructure and wallet capability docs
|
|
181
|
+
- Repo-owned docs surface for the public beta
|
|
182
|
+
|
|
183
|
+
#### `mcp-server/`
|
|
184
|
+
|
|
185
|
+
- MCP server for crypto, DeFi, and on-chain data workflows
|
|
186
|
+
- Read-oriented market, protocol, gas, and identity tooling
|
|
187
|
+
- Local/self-hostable deployment path
|
|
188
|
+
|
|
189
|
+
#### `agent-wallet/`
|
|
190
|
+
|
|
191
|
+
- Local Solana wallet backend for OpenClaw-connected agents
|
|
192
|
+
- Read, preview, prepare, and approved execute flows
|
|
193
|
+
- Encrypted local secret handling and explicit approval gating for risky actions
|
|
194
|
+
|
|
195
|
+
#### `.openclaw/extensions/agent-wallet/`
|
|
196
|
+
|
|
197
|
+
- Thin TypeScript bridge from OpenClaw into the Python wallet backend
|
|
198
|
+
- Plugin manifest and config schema tracked in the repo
|
|
199
|
+
- Repo-local extension package for OpenClaw integration
|
|
200
|
+
|
|
201
|
+
### Beta notes
|
|
202
|
+
|
|
203
|
+
- This is a beta release and should not be presented as production-ready custody infrastructure
|
|
204
|
+
- Mainnet usage should remain cautious and operator-controlled
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# --- OpenClaw Agent Wallet ---
|
|
2
|
+
|
|
3
|
+
# Backend selection
|
|
4
|
+
AGENT_WALLET_BACKEND=none
|
|
5
|
+
AGENT_WALLET_SIGN_ONLY=false
|
|
6
|
+
AGENT_WALLET_BOOT_KEY=
|
|
7
|
+
# Runtime secrets are loaded only from ~/.openclaw/sealed_keys.json via AGENT_WALLET_BOOT_KEY.
|
|
8
|
+
# Per-user HKDF derivation and encrypted user-wallet storage are mandatory.
|
|
9
|
+
AGENT_WALLET_PER_USER_KEY_DERIVATION=true
|
|
10
|
+
AGENT_WALLET_ENCRYPT_USER_WALLETS=true
|
|
11
|
+
AGENT_WALLET_MIGRATE_PLAINTEXT_USER_WALLETS=true
|
|
12
|
+
AGENT_WALLET_REFUSE_MAINNET_WALLET_RECREATION=true
|
|
13
|
+
AGENT_WALLET_REQUIRE_ENCRYPTED_MAINNET=true
|
|
14
|
+
AGENT_WALLET_MAX_PER_TX_SOL=0
|
|
15
|
+
AGENT_WALLET_MAX_HOURLY_SOL=0
|
|
16
|
+
AGENT_WALLET_MAX_DAILY_SOL=0
|
|
17
|
+
AGENT_WALLET_MAX_TXS_PER_MINUTE=0
|
|
18
|
+
|
|
19
|
+
# Solana backend
|
|
20
|
+
SOLANA_NETWORK=mainnet
|
|
21
|
+
SOLANA_RPC_URL=
|
|
22
|
+
SOLANA_RPC_URLS=
|
|
23
|
+
SOLANA_RPC_PROVIDER_MODE=auto
|
|
24
|
+
# Optional deployment shortcut: if SOLANA_RPC_URL(S) are empty, agent-wallet
|
|
25
|
+
# auto-derives a Solana Alchemy or Helius RPC from this key on mainnet/devnet.
|
|
26
|
+
ALCHEMY_API_KEY=
|
|
27
|
+
HELIUS_API_KEY=
|
|
28
|
+
PROVIDER_GATEWAY_URL=https://agent-layer-production.up.railway.app
|
|
29
|
+
PROVIDER_GATEWAY_BEARER_TOKEN=
|
|
30
|
+
PROVIDER_GATEWAY_RPC_PROVIDER=auto
|
|
31
|
+
# Swap routing stays Jupiter-first. Bags is used separately for launch/fees via provider-gateway.
|
|
32
|
+
SOLANA_SWAP_PROVIDER=auto
|
|
33
|
+
SOLANA_COMMITMENT=confirmed
|
|
34
|
+
SOLANA_AUTO_CREATE_WALLET=false
|
|
35
|
+
|
|
36
|
+
# Read-only mode
|
|
37
|
+
SOLANA_AGENT_PUBLIC_KEY=
|
|
38
|
+
|
|
39
|
+
# Signing mode: use a sealed `private_key` entry or a file path
|
|
40
|
+
SOLANA_AGENT_KEYPAIR_PATH=
|
|
41
|
+
|
|
42
|
+
# Jupiter swap routing
|
|
43
|
+
JUPITER_API_BASE_URL=https://lite-api.jup.ag/swap/v1
|
|
44
|
+
JUPITER_ULTRA_API_BASE_URL=https://lite-api.jup.ag/ultra/v1
|
|
45
|
+
JUPITER_PRICE_API_BASE_URL=https://lite-api.jup.ag/price/v3
|
|
46
|
+
JUPITER_PORTFOLIO_API_BASE_URL=https://api.jup.ag/portfolio/v1
|
|
47
|
+
JUPITER_LEND_API_BASE_URL=https://api.jup.ag/lend/v1
|
|
48
|
+
JUPITER_API_KEY=
|
|
49
|
+
|
|
50
|
+
# LI.FI cross-chain routing. API key is optional for basic read-only quote/status calls.
|
|
51
|
+
# Keep Mayan denied here so LI.FI cannot route through that bridge.
|
|
52
|
+
LIFI_API_BASE_URL=https://li.quest/v1
|
|
53
|
+
LIFI_API_KEY=
|
|
54
|
+
LIFI_INTEGRATOR=openclaw
|
|
55
|
+
LIFI_DEFAULT_DENY_BRIDGES=mayan
|
|
56
|
+
|
|
57
|
+
# Kamino REST lending
|
|
58
|
+
KAMINO_API_BASE_URL=https://api.kamino.finance
|
|
59
|
+
KAMINO_PROGRAM_ID=KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD
|
|
60
|
+
|
|
61
|
+
# Shared HTTP timeout
|
|
62
|
+
HTTP_TIMEOUT=10.0
|