@agentlayer.tech/wallet 0.1.89 → 0.1.91
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/extensions/agent-wallet/dist/index.js +5 -5
- package/.openclaw/extensions/agent-wallet/index.ts +5 -5
- package/.openclaw/extensions/agent-wallet/openclaw.plugin.json +1 -1
- package/.openclaw/extensions/agent-wallet/package.json +1 -1
- package/CHANGELOG.md +14 -0
- package/README.md +46 -23
- package/VERSION +1 -1
- package/agent-wallet/README.md +26 -1
- package/agent-wallet/UPGRADE_COMPATIBILITY.md +2 -1
- package/agent-wallet/agent_wallet/__init__.py +1 -1
- package/agent-wallet/agent_wallet/autonomous_permissions.py +43 -1
- package/agent-wallet/agent_wallet/openclaw_adapter.py +604 -375
- package/agent-wallet/agent_wallet/providers/x402.py +84 -0
- package/agent-wallet/openclaw.plugin.json +1 -1
- package/agent-wallet/pyproject.toml +1 -1
- package/agent-wallet/scripts/install_agent_wallet.py +197 -11
- package/agent-wallet/scripts/install_openclaw_local_config.py +4 -1
- package/agent-wallet/scripts/install_openclaw_sealed_keys.py +6 -2
- package/bin/lib/host-detection.mjs +236 -0
- package/bin/lib/integrations.mjs +69 -5
- package/bin/openclaw-agent-wallet.mjs +398 -28
- package/claude-code/plugins/agent-wallet/.claude-plugin/plugin.json +1 -1
- package/claude-code/plugins/agent-wallet/README.md +3 -1
- package/claude-code/plugins/agent-wallet/commands/agentlayer-autonomous-approve.md +7 -8
- package/claude-code/plugins/agent-wallet/commands/agentlayer-autonomous-revoke.md +2 -2
- package/claude-code/plugins/agent-wallet/commands/wallet-base.md +38 -15
- package/codex/plugins/agent-wallet/.codex-plugin/plugin.json +1 -1
- package/codex/plugins/agent-wallet/README.md +11 -6
- package/codex/plugins/agent-wallet/skills/wallet-base/SKILL.md +56 -0
- package/hermes/plugins/agent_wallet/plugin.yaml +1 -1
- package/package.json +8 -3
- package/wdk-btc-wallet/package.json +1 -1
- package/wdk-evm-wallet/package.json +1 -1
|
@@ -724,17 +724,17 @@ const walletSessionToolDefinitions = [
|
|
|
724
724
|
},
|
|
725
725
|
{
|
|
726
726
|
name: "agentlayer_autonomous_status",
|
|
727
|
-
description: "Return AgentLayer high-trust autonomous permission status
|
|
727
|
+
description: "Return AgentLayer high-trust autonomous permission status. The autonomous permission group covers every wallet write tool (transfers, bridges, Solana swaps, staking, x402 payments, generic contract calls, Base swaps, and EVM DeFi management), not just base_swaps/defi_tools.",
|
|
728
728
|
parameters: { type: "object", properties: {}, additionalProperties: false },
|
|
729
729
|
},
|
|
730
730
|
{
|
|
731
731
|
name: "agentlayer_autonomous_approve",
|
|
732
732
|
description:
|
|
733
|
-
"Enable high-trust autonomous
|
|
733
|
+
"Enable the high-trust autonomous permission group. The scope parameter accepts \"all\" (recommended); base_swaps and defi_tools are deprecated aliases with identical effect. This covers every wallet write tool -- transfers, bridges, Solana swaps, staking, x402 payments, generic contract calls, Base Velora/Uniswap swap execute calls, and supported EVM DeFi management tools -- until revoked.",
|
|
734
734
|
parameters: {
|
|
735
735
|
type: "object",
|
|
736
736
|
properties: {
|
|
737
|
-
scope: { type: "string", enum: ["base_swaps", "defi_tools"], description: "
|
|
737
|
+
scope: { type: "string", enum: ["all", "base_swaps", "defi_tools"], description: "Scope to enable. Use \"all\" (recommended) -- base_swaps and defi_tools are deprecated aliases that enable the exact same full autonomous permission group." },
|
|
738
738
|
purpose: { type: "string" },
|
|
739
739
|
user_intent: { type: "boolean" },
|
|
740
740
|
},
|
|
@@ -744,11 +744,11 @@ const walletSessionToolDefinitions = [
|
|
|
744
744
|
},
|
|
745
745
|
{
|
|
746
746
|
name: "agentlayer_autonomous_revoke",
|
|
747
|
-
description: "Disable the full high-trust autonomous permission group. The scope parameter
|
|
747
|
+
description: "Disable the full high-trust autonomous permission group. The scope parameter accepts \"all\" (recommended); base_swaps and defi_tools are deprecated aliases that revoke the same full group.",
|
|
748
748
|
parameters: {
|
|
749
749
|
type: "object",
|
|
750
750
|
properties: {
|
|
751
|
-
scope: { type: "string", enum: ["base_swaps", "defi_tools"], description: "
|
|
751
|
+
scope: { type: "string", enum: ["all", "base_swaps", "defi_tools"], description: "Scope to revoke. Use \"all\" (recommended) -- base_swaps and defi_tools are deprecated aliases that revoke the exact same full autonomous permission group." },
|
|
752
752
|
},
|
|
753
753
|
required: ["scope"],
|
|
754
754
|
additionalProperties: false,
|
|
@@ -724,17 +724,17 @@ const walletSessionToolDefinitions = [
|
|
|
724
724
|
},
|
|
725
725
|
{
|
|
726
726
|
name: "agentlayer_autonomous_status",
|
|
727
|
-
description: "Return AgentLayer high-trust autonomous permission status
|
|
727
|
+
description: "Return AgentLayer high-trust autonomous permission status. The autonomous permission group covers every wallet write tool (transfers, bridges, Solana swaps, staking, x402 payments, generic contract calls, Base swaps, and EVM DeFi management), not just base_swaps/defi_tools.",
|
|
728
728
|
parameters: { type: "object", properties: {}, additionalProperties: false },
|
|
729
729
|
},
|
|
730
730
|
{
|
|
731
731
|
name: "agentlayer_autonomous_approve",
|
|
732
732
|
description:
|
|
733
|
-
"Enable high-trust autonomous
|
|
733
|
+
"Enable the high-trust autonomous permission group. The scope parameter accepts \"all\" (recommended); base_swaps and defi_tools are deprecated aliases with identical effect. This covers every wallet write tool -- transfers, bridges, Solana swaps, staking, x402 payments, generic contract calls, Base Velora/Uniswap swap execute calls, and supported EVM DeFi management tools -- until revoked.",
|
|
734
734
|
parameters: {
|
|
735
735
|
type: "object",
|
|
736
736
|
properties: {
|
|
737
|
-
scope: { type: "string", enum: ["base_swaps", "defi_tools"], description: "
|
|
737
|
+
scope: { type: "string", enum: ["all", "base_swaps", "defi_tools"], description: "Scope to enable. Use \"all\" (recommended) -- base_swaps and defi_tools are deprecated aliases that enable the exact same full autonomous permission group." },
|
|
738
738
|
purpose: { type: "string" },
|
|
739
739
|
user_intent: { type: "boolean" },
|
|
740
740
|
},
|
|
@@ -744,11 +744,11 @@ const walletSessionToolDefinitions = [
|
|
|
744
744
|
},
|
|
745
745
|
{
|
|
746
746
|
name: "agentlayer_autonomous_revoke",
|
|
747
|
-
description: "Disable the full high-trust autonomous permission group. The scope parameter
|
|
747
|
+
description: "Disable the full high-trust autonomous permission group. The scope parameter accepts \"all\" (recommended); base_swaps and defi_tools are deprecated aliases that revoke the same full group.",
|
|
748
748
|
parameters: {
|
|
749
749
|
type: "object",
|
|
750
750
|
properties: {
|
|
751
|
-
scope: { type: "string", enum: ["base_swaps", "defi_tools"], description: "
|
|
751
|
+
scope: { type: "string", enum: ["all", "base_swaps", "defi_tools"], description: "Scope to revoke. Use \"all\" (recommended) -- base_swaps and defi_tools are deprecated aliases that revoke the exact same full autonomous permission group." },
|
|
752
752
|
},
|
|
753
753
|
required: ["scope"],
|
|
754
754
|
additionalProperties: false,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "agent-wallet",
|
|
3
3
|
"name": "Agent Wallet",
|
|
4
4
|
"description": "Official OpenClaw plugin bridge for the agent-wallet backends, including Solana, local BTC, and local EVM.",
|
|
5
|
-
"version": "0.1.
|
|
5
|
+
"version": "0.1.91",
|
|
6
6
|
"contracts": {
|
|
7
7
|
"tools": [
|
|
8
8
|
"agentlayer_autonomous_approve",
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
- Added a universal npm installer for OpenClaw, Codex, Claude Code, and Hermes.
|
|
6
|
+
`wallet install` now detects installed agent frameworks, supports explicit
|
|
7
|
+
`--hosts`, `--exclude`, and `--runtime-only` selection, and exposes
|
|
8
|
+
`wallet detect --json`. Runtime updates remain managed-only, so discovering a
|
|
9
|
+
new framework later does not silently enroll it. OpenClaw config creation is
|
|
10
|
+
now a host-specific step; wallet files and sealed secrets remain in their
|
|
11
|
+
existing `~/.openclaw` locations and are not replaced during updates.
|
|
12
|
+
|
|
13
|
+
- Confirmed the native OS keystore as the default boot-key backend. `auto`
|
|
14
|
+
prefers macOS Keychain, Windows DPAPI, or Linux Secret Service and uses the
|
|
15
|
+
local `0600` file only as a fallback. The npm installer now warns macOS users
|
|
16
|
+
that the system may request Keychain confirmation; this does not rotate or
|
|
17
|
+
migrate the boot key during ordinary updates.
|
|
18
|
+
|
|
5
19
|
- Hardened Morpho EVM operations with a 30% gas-limit buffer calculated from
|
|
6
20
|
the exact final calldata immediately before sending. Morpho vault and market
|
|
7
21
|
writes now wait for their final on-chain receipt and report reverts instead
|
package/README.md
CHANGED
|
@@ -6,23 +6,32 @@
|
|
|
6
6
|
[](https://nodejs.org/)
|
|
7
7
|
[](https://docs.agent-layer.tech/)
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Install AgentLayer for the agent frameworks already present on the machine:
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
12
|
npx @agentlayer.tech/wallet install --yes
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
The installer detects OpenClaw, Codex, Claude Code, and Hermes, installs the
|
|
16
|
+
shared local runtime once, and connects every detected host. Without `--yes`,
|
|
17
|
+
an interactive terminal asks about each detected host.
|
|
18
|
+
|
|
19
|
+
To choose hosts explicitly:
|
|
16
20
|
|
|
17
21
|
```bash
|
|
18
|
-
npx @agentlayer.tech/wallet install --yes
|
|
22
|
+
npx @agentlayer.tech/wallet install --yes --hosts codex,claude-code
|
|
23
|
+
npx @agentlayer.tech/wallet install --yes --hosts detected --exclude hermes
|
|
24
|
+
npx @agentlayer.tech/wallet install --yes --runtime-only
|
|
25
|
+
npx @agentlayer.tech/wallet detect --json
|
|
19
26
|
```
|
|
20
27
|
|
|
21
|
-
|
|
28
|
+
The legacy `wallet codex install`, `wallet claude-code install`, and
|
|
29
|
+
`wallet hermes install` commands remain supported as explicit repair/install
|
|
30
|
+
commands.
|
|
22
31
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
32
|
+
On a machine with an existing AgentLayer runtime, a plain `wallet install`
|
|
33
|
+
touches only already-managed hosts. To enroll a framework installed later, run
|
|
34
|
+
`wallet install --yes --hosts detected` or name it explicitly.
|
|
26
35
|
|
|
27
36
|
Or install entirely from inside the Claude Code CLI, via the plugin marketplace
|
|
28
37
|
(no terminal/npx needed) — two commands, then restart:
|
|
@@ -32,13 +41,6 @@ Or install entirely from inside the Claude Code CLI, via the plugin marketplace
|
|
|
32
41
|
/plugin install agent-wallet@agentlayer
|
|
33
42
|
```
|
|
34
43
|
|
|
35
|
-
For Hermes:
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
npx @agentlayer.tech/wallet install --yes && npx @agentlayer.tech/wallet hermes install --yes
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
|
|
42
44
|
AgentLayer is a beta local-first wallet and finance stack for agents.
|
|
43
45
|
|
|
44
46
|
The repository includes:
|
|
@@ -72,7 +74,7 @@ System prerequisites:
|
|
|
72
74
|
- `node` `24.x`
|
|
73
75
|
- `npm`
|
|
74
76
|
|
|
75
|
-
Install the local runtime:
|
|
77
|
+
Install the local runtime and connect detected agent frameworks:
|
|
76
78
|
|
|
77
79
|
```bash
|
|
78
80
|
npx @agentlayer.tech/wallet install --yes
|
|
@@ -102,13 +104,26 @@ The CLI uses a versioned runtime layout:
|
|
|
102
104
|
~/.openclaw/agent-wallet-runtime/current # symlink → active release
|
|
103
105
|
```
|
|
104
106
|
|
|
105
|
-
|
|
107
|
+
`~/.openclaw` remains the shared AgentLayer runtime root even when OpenClaw is
|
|
108
|
+
not installed. A Codex-only or Claude-only install creates the runtime there
|
|
109
|
+
but does not create or patch `openclaw.json`.
|
|
110
|
+
|
|
111
|
+
On first install, `--yes` generates local runtime secrets. The installer stores
|
|
112
|
+
`master_key` and `approval_secret` in `~/.openclaw/sealed_keys.json`. The boot
|
|
113
|
+
key needed to unlock that sealed bundle uses `AGENT_WALLET_KEYSTORE_BACKEND=auto`
|
|
114
|
+
by default: it prefers the native OS keystore and falls back to a local `0600`
|
|
115
|
+
file only when the native backend is unavailable. On macOS this means the login
|
|
116
|
+
Keychain (`service=ai.agentlayer.wallet`, `account=boot_key`). macOS may show a
|
|
117
|
+
Keychain access or password confirmation depending on the current Keychain
|
|
118
|
+
state; approve it only when you initiated the AgentLayer install or update.
|
|
119
|
+
Existing installs keep the same boot-key value during upgrades.
|
|
106
120
|
|
|
107
121
|
Useful CLI commands (require the global install above):
|
|
108
122
|
|
|
109
123
|
```bash
|
|
110
124
|
wallet status # show active runtime version and health
|
|
111
125
|
wallet doctor # diagnose common config problems
|
|
126
|
+
wallet detect --json # show detected and already-managed hosts
|
|
112
127
|
wallet update --yes # upgrade to the latest published version
|
|
113
128
|
wallet update --yes --dry-run # preview the upgrade without applying it
|
|
114
129
|
wallet rollback # revert to the previous release
|
|
@@ -116,7 +131,14 @@ wallet hermes install --yes # (re)connect Hermes to the current runtime
|
|
|
116
131
|
wallet codex install --yes # (re)connect Codex to the current runtime
|
|
117
132
|
```
|
|
118
133
|
|
|
119
|
-
`wallet update --yes` fetches the latest npm package, installs it under
|
|
134
|
+
`wallet update --yes` fetches the latest npm package, installs it under
|
|
135
|
+
`releases/<version>`, and flips the `current` symlink. Updates repair only hosts
|
|
136
|
+
already recorded as AgentLayer-managed; a newly detected framework is never
|
|
137
|
+
silently enrolled during update. Python and Node dependency snapshots are
|
|
138
|
+
reused when the dependency fingerprint has not changed, so subsequent updates
|
|
139
|
+
are fast. All frameworks that read from `current/` (Claude Code, Codex, Hermes)
|
|
140
|
+
pick up the new code automatically on their next session start; OpenClaw
|
|
141
|
+
requires a gateway restart to reload its TypeScript extension.
|
|
120
142
|
|
|
121
143
|
## Native OpenClaw plugin installs
|
|
122
144
|
|
|
@@ -280,10 +302,10 @@ For the default Solana flow, run the installer directly:
|
|
|
280
302
|
npx @agentlayer.tech/wallet install --yes
|
|
281
303
|
```
|
|
282
304
|
|
|
283
|
-
That installs the runtime,
|
|
305
|
+
That installs the runtime, connects each detected framework, generates local
|
|
284
306
|
runtime secrets when missing, and creates the first encrypted per-user Solana
|
|
285
|
-
mainnet wallet.
|
|
286
|
-
not the private key.
|
|
307
|
+
mainnet wallet. `openclaw.json` is patched only when OpenClaw is selected. The
|
|
308
|
+
agent receives the public address and guarded wallet tools, not the private key.
|
|
287
309
|
|
|
288
310
|
BTC and EVM are separate host-side setup flows.
|
|
289
311
|
|
|
@@ -377,10 +399,11 @@ The installer then:
|
|
|
377
399
|
- creates `agent-wallet/.env` from `agent-wallet/.env.example` if it does not exist
|
|
378
400
|
- creates `agent-wallet/.runtime-venv` and installs the Python backend
|
|
379
401
|
- installs Node dependencies for `wdk-btc-wallet`, `wdk-evm-wallet`, and `flash-sdk-bridge`
|
|
380
|
-
- creates a minimal `~/.openclaw/openclaw.json` if one does not exist
|
|
381
402
|
- if the required secrets are already present, writes or updates `~/.openclaw/sealed_keys.json`
|
|
382
|
-
-
|
|
383
|
-
-
|
|
403
|
+
- detects OpenClaw, Codex, Claude Code, and Hermes before changing host config
|
|
404
|
+
- connects the selected hosts to `agent-wallet-runtime/current`
|
|
405
|
+
- creates or patches `~/.openclaw/openclaw.json` only when OpenClaw is selected
|
|
406
|
+
- records non-secret ownership metadata so later updates repair only managed hosts
|
|
384
407
|
|
|
385
408
|
When the installer reaches the final config step, the default plugin config is:
|
|
386
409
|
|
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.1.
|
|
1
|
+
0.1.91
|
package/agent-wallet/README.md
CHANGED
|
@@ -138,7 +138,20 @@ If you want a simpler local setup flow, use the installer:
|
|
|
138
138
|
sh ../setup.sh
|
|
139
139
|
```
|
|
140
140
|
|
|
141
|
-
|
|
141
|
+
The public npm entrypoint is a universal host orchestrator:
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
npx @agentlayer.tech/wallet install --yes
|
|
145
|
+
npx @agentlayer.tech/wallet install --yes --hosts codex,claude-code
|
|
146
|
+
npx @agentlayer.tech/wallet detect --json
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
It detects OpenClaw, Codex, Claude Code, and Hermes before installation. The
|
|
150
|
+
direct `setup.sh`/Python path retains its OpenClaw-oriented default for
|
|
151
|
+
backward compatibility; the npm CLI passes `--no-configure-openclaw` and lets
|
|
152
|
+
the selected OpenClaw host adapter own `openclaw.json`.
|
|
153
|
+
|
|
154
|
+
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.
|
|
142
155
|
|
|
143
156
|
By default it will:
|
|
144
157
|
|
|
@@ -562,6 +575,18 @@ That native plugin package is additive. Keep the existing runtime installer for
|
|
|
562
575
|
npx @agentlayer.tech/wallet install --yes
|
|
563
576
|
```
|
|
564
577
|
|
|
578
|
+
To bind a welcome invite from `https://www.agent-layer.tech/onboard` to the
|
|
579
|
+
local Base address during installation:
|
|
580
|
+
|
|
581
|
+
```bash
|
|
582
|
+
npx @agentlayer.tech/wallet install --yes --invite alw_...
|
|
583
|
+
```
|
|
584
|
+
|
|
585
|
+
The installer sends only the one-time invite and the public EVM address to the
|
|
586
|
+
AgentLayer onboarding API. It never sends a private key, seed, wallet password,
|
|
587
|
+
local user ID, or telemetry install ID. A network or EVM provisioning failure
|
|
588
|
+
does not consume the invite and does not roll back the wallet installation.
|
|
589
|
+
|
|
565
590
|
The ClawHub plugin package auto-checks `~/.openclaw/agent-wallet-runtime/current/agent-wallet` before it falls back to a local workspace checkout.
|
|
566
591
|
|
|
567
592
|
Public-safe helper scripts are available in `agent-wallet/scripts/`:
|
|
@@ -20,8 +20,9 @@ Raising the floor requires all of the following:
|
|
|
20
20
|
|
|
21
21
|
| Path | Purpose | Removal condition |
|
|
22
22
|
|---|---|---|
|
|
23
|
-
| JavaScript boot-key fallback | Updates runtimes that predate the verified Python installer resolver. | The supported floor includes `resolve_boot_key_for_installer
|
|
23
|
+
| 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. |
|
|
24
24
|
| Directory runtime-pointer migration | Converts pre-versioned `current/` directories into release entries. | The supported floor guarantees symlink-based runtime pointers. |
|
|
25
|
+
| 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. |
|
|
25
26
|
| Hermes legacy adoption | Recognizes an AgentLayer plugin installed before the ownership registry. | The supported floor guarantees an `integrations.json` Hermes ownership entry. |
|
|
26
27
|
| Codex legacy adoption | Recognizes a matching local marketplace registration and AgentLayer manifest. | The supported floor guarantees an `integrations.json` Codex ownership entry. |
|
|
27
28
|
| 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. |
|
|
@@ -34,7 +34,13 @@ DEFI_TOOLS = frozenset(
|
|
|
34
34
|
}
|
|
35
35
|
)
|
|
36
36
|
DEFI_TOOLS_ISSUER = "autonomous-permission:defi-tools"
|
|
37
|
-
|
|
37
|
+
ALL_TOOLS_ISSUER = "autonomous-permission:all-tools"
|
|
38
|
+
#: Canonical scope name -- the group covers every wallet write tool (see
|
|
39
|
+
#: authorize_operation), not just Base swaps or EVM DeFi. base_swaps/
|
|
40
|
+
#: defi_tools remain accepted as deprecated aliases with identical effect,
|
|
41
|
+
#: for backward compatibility with existing callers.
|
|
42
|
+
ALL_SCOPE = "all"
|
|
43
|
+
SUPPORTED_SCOPES = frozenset({ALL_SCOPE, BASE_SWAP_SCOPE, DEFI_TOOLS_SCOPE})
|
|
38
44
|
_PERMISSIONS_FILENAME = "autonomous_permissions.json"
|
|
39
45
|
|
|
40
46
|
|
|
@@ -213,6 +219,42 @@ def authorize_base_swap(*, tool_name: str, network: str, summary: dict[str, Any]
|
|
|
213
219
|
)
|
|
214
220
|
|
|
215
221
|
|
|
222
|
+
def is_autonomous_approved() -> bool:
|
|
223
|
+
"""Whether the combined high-trust autonomous permission group is active.
|
|
224
|
+
|
|
225
|
+
Same underlying flag as :func:`is_base_swap_approved` /
|
|
226
|
+
:func:`is_defi_tools_approved`; exposed under a name that doesn't imply a
|
|
227
|
+
narrower scope, for callers that gate every wallet tool rather than just
|
|
228
|
+
Base swaps or EVM DeFi tools.
|
|
229
|
+
"""
|
|
230
|
+
return bool(status()["active"])
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
def authorize_operation(*, tool_name: str, network: str, summary: dict[str, Any]) -> str:
|
|
234
|
+
"""Issue an internal approval token for any wallet tool/network once the
|
|
235
|
+
combined high-trust autonomous permission group is enabled.
|
|
236
|
+
|
|
237
|
+
Unlike :func:`authorize_base_swap` / :func:`authorize_defi_tool`, this has
|
|
238
|
+
no per-tool or per-network allow-list -- the group toggle enabled by
|
|
239
|
+
``agentlayer_autonomous_approve`` is the only gate. Callers are expected to
|
|
240
|
+
have already built ``summary`` from a live preview/quote, matching every
|
|
241
|
+
other execute path's binding contract.
|
|
242
|
+
"""
|
|
243
|
+
if not is_autonomous_approved():
|
|
244
|
+
raise WalletBackendError(
|
|
245
|
+
"Autonomous execution is not enabled. Ask the user to run "
|
|
246
|
+
"agentlayer_autonomous_approve first."
|
|
247
|
+
)
|
|
248
|
+
return issue_approval_token(
|
|
249
|
+
tool_name=str(tool_name),
|
|
250
|
+
network=str(network or "").strip().lower(),
|
|
251
|
+
summary=summary,
|
|
252
|
+
mainnet_confirmed=True,
|
|
253
|
+
ttl_seconds=120,
|
|
254
|
+
issued_by=ALL_TOOLS_ISSUER,
|
|
255
|
+
)
|
|
256
|
+
|
|
257
|
+
|
|
216
258
|
def authorize_defi_tool(*, tool_name: str, network: str, summary: dict[str, Any]) -> str:
|
|
217
259
|
"""Issue an internal approval token for one exact EVM DeFi operation."""
|
|
218
260
|
normalized_network = str(network or "").strip().lower()
|