@agentlayer.tech/wallet 0.1.53 → 0.1.55
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/openclaw.plugin.json +1 -1
- package/.openclaw/extensions/agent-wallet/package.json +1 -1
- package/CHANGELOG.md +12 -0
- package/README.md +14 -12
- package/VERSION +1 -1
- package/agent-wallet/agent_wallet/__init__.py +1 -1
- package/agent-wallet/openclaw.plugin.json +1 -1
- package/agent-wallet/pyproject.toml +1 -1
- package/claude-code/plugins/agent-wallet/.claude-plugin/plugin.json +1 -1
- package/claude-code/plugins/agent-wallet/README.md +9 -3
- package/claude-code/plugins/agent-wallet/commands/agentlayer-autonomous-approve.md +17 -2
- package/claude-code/plugins/agent-wallet/commands/agentlayer-autonomous-revoke.md +1 -0
- package/claude-code/plugins/agent-wallet/commands/wallet-base.md +37 -0
- package/claude-code/plugins/agent-wallet/commands/wallet-ethereum.md +37 -0
- package/claude-code/plugins/agent-wallet/commands/wallet-evm.md +38 -0
- package/claude-code/plugins/agent-wallet/commands/wallet-sol.md +36 -0
- package/codex/plugins/agent-wallet/.codex-plugin/plugin.json +1 -1
- package/codex/plugins/agent-wallet/server.py +75 -3
- package/hermes/plugins/agent_wallet/plugin.yaml +1 -1
- package/package.json +1 -1
- package/wdk-btc-wallet/package.json +1 -1
- package/wdk-evm-wallet/package.json +1 -1
|
@@ -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.55",
|
|
6
6
|
"contracts": {
|
|
7
7
|
"tools": [
|
|
8
8
|
"agentlayer_autonomous_approve",
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## v0.1.54 - 2026-06-29
|
|
6
|
+
|
|
7
|
+
- Fixed Claude Code autonomous-mode slash command activation so
|
|
8
|
+
`/agentlayer-autonomous-approve` no longer relies on the model treating the
|
|
9
|
+
slash invocation itself as sufficient consent. The command now uses an
|
|
10
|
+
explicit in-command confirmation step before enabling the standing
|
|
11
|
+
permission, and both autonomous toggle commands are marked manual-only in the
|
|
12
|
+
Claude Code command metadata.
|
|
13
|
+
- `claude-code/plugins/agent-wallet/commands/agentlayer-autonomous-approve.md`
|
|
14
|
+
- `claude-code/plugins/agent-wallet/commands/agentlayer-autonomous-revoke.md`
|
|
15
|
+
- `claude-code/plugins/agent-wallet/README.md`
|
|
16
|
+
|
|
5
17
|
## v0.1.53 - 2026-06-26
|
|
6
18
|
|
|
7
19
|
- Fixed Morpho vault and market quote (preview) requests timing out under the
|
package/README.md
CHANGED
|
@@ -86,35 +86,37 @@ openclaw plugins install clawhub:@agentlayertech/agent-wallet-plugin
|
|
|
86
86
|
|
|
87
87
|
The ClawHub package does not replace the npm installer. `npx @agentlayer.tech/wallet install --yes` installs the local runtime, Python backend, and helper services. ClawHub only installs the OpenClaw plugin surface that points at that runtime.
|
|
88
88
|
|
|
89
|
-
Or install the CLI globally:
|
|
89
|
+
Or install the CLI globally for shorter commands:
|
|
90
90
|
|
|
91
91
|
```bash
|
|
92
92
|
npm install -g @agentlayer.tech/wallet
|
|
93
93
|
wallet install --yes
|
|
94
94
|
```
|
|
95
95
|
|
|
96
|
+
> **Why install globally?** Without the global install, `wallet` is not in your `PATH` and commands like `wallet update --yes` return `zsh: command not found: wallet`. The global install adds the `wallet` binary once; after that all `wallet <cmd>` shortcuts work. If you skip the global install, prefix every command with `npx @agentlayer.tech/wallet` instead (see the Updating section below).
|
|
97
|
+
|
|
96
98
|
The CLI uses a versioned runtime layout:
|
|
97
99
|
|
|
98
100
|
```bash
|
|
99
|
-
~/.openclaw/agent-wallet-runtime/releases/<version>
|
|
100
|
-
~/.openclaw/agent-wallet-runtime/current
|
|
101
|
+
~/.openclaw/agent-wallet-runtime/releases/<version> # immutable per-version snapshots
|
|
102
|
+
~/.openclaw/agent-wallet-runtime/current # symlink → active release
|
|
101
103
|
```
|
|
102
104
|
|
|
103
105
|
On first install, `--yes` generates local runtime secrets. 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 runtime `.env`.
|
|
104
106
|
|
|
105
|
-
Useful
|
|
107
|
+
Useful CLI commands (require the global install above):
|
|
106
108
|
|
|
107
109
|
```bash
|
|
108
|
-
wallet status
|
|
109
|
-
wallet doctor
|
|
110
|
-
wallet
|
|
111
|
-
wallet
|
|
112
|
-
wallet
|
|
113
|
-
wallet
|
|
114
|
-
wallet
|
|
110
|
+
wallet status # show active runtime version and health
|
|
111
|
+
wallet doctor # diagnose common config problems
|
|
112
|
+
wallet update --yes # upgrade to the latest published version
|
|
113
|
+
wallet update --yes --dry-run # preview the upgrade without applying it
|
|
114
|
+
wallet rollback # revert to the previous release
|
|
115
|
+
wallet hermes install --yes # (re)connect Hermes to the current runtime
|
|
116
|
+
wallet codex install --yes # (re)connect Codex to the current runtime
|
|
115
117
|
```
|
|
116
118
|
|
|
117
|
-
`wallet update --yes`
|
|
119
|
+
`wallet update --yes` fetches the latest npm package, installs it under `releases/<version>`, and flips the `current` symlink. Python and Node dependency snapshots are reused when the dependency fingerprint has not changed, so subsequent updates are fast. All frameworks that read from `current/` (Claude Code, Codex, Hermes) pick up the new code automatically on their next session start; OpenClaw requires a gateway restart to reload its TypeScript extension.
|
|
118
120
|
|
|
119
121
|
## Native OpenClaw plugin installs
|
|
120
122
|
|
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.1.
|
|
1
|
+
0.1.55
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "agent-wallet",
|
|
3
3
|
"name": "Agent Wallet",
|
|
4
4
|
"description": "Plugin-friendly wallet backend for OpenClaw agents with safe wallet tools and runtime instructions across Solana, local BTC, and local EVM.",
|
|
5
|
-
"version": "0.1.
|
|
5
|
+
"version": "0.1.55",
|
|
6
6
|
"skills": ["skills/wallet-operator"],
|
|
7
7
|
"configSchema": {
|
|
8
8
|
"type": "object",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-wallet",
|
|
3
3
|
"displayName": "Agent Wallet",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.55",
|
|
5
5
|
"description": "Claude Code bridge for the existing AgentLayer wallet runtime. Connects to Solana, Bitcoin, and EVM wallets without creating a new one.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "AgentLayer"
|
|
@@ -51,11 +51,17 @@ no-op once the backend is healthy.
|
|
|
51
51
|
- `/wallet-setup` — install (or repair) the backend explicitly instead of
|
|
52
52
|
waiting for the hook (requires `/reload-plugins` first so the command is
|
|
53
53
|
registered).
|
|
54
|
+
- `/wallet-sol` — print the current Solana wallet overview directly in chat.
|
|
55
|
+
- `/wallet-evm` — print the wallet overview for the current/default EVM network
|
|
56
|
+
directly in chat.
|
|
57
|
+
- `/wallet-base` — print the Base EVM wallet overview directly in chat.
|
|
58
|
+
- `/wallet-ethereum` — print the Ethereum EVM wallet overview directly in chat.
|
|
54
59
|
- `/agentlayer-autonomous-approve` — enable high-trust autonomous Base swaps
|
|
55
60
|
(`swap_evm_tokens` / `swap_evm_uniswap_tokens` on Base only) without
|
|
56
|
-
per-transaction approvals.
|
|
57
|
-
|
|
58
|
-
|
|
61
|
+
per-transaction approvals. In Claude Code this command now asks for an
|
|
62
|
+
explicit in-command confirmation before enabling the standing permission.
|
|
63
|
+
- `/agentlayer-autonomous-revoke` — disable the combined autonomous permission
|
|
64
|
+
group for Base swaps and supported EVM DeFi tools.
|
|
59
65
|
- `AGENT_WALLET_AUTO_BOOTSTRAP=0` — opt out of the auto-install: the
|
|
60
66
|
`SessionStart` hook then only reminds you to run `/wallet-setup` instead of
|
|
61
67
|
installing the backend itself.
|
|
@@ -1,11 +1,24 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: Enable AgentLayer autonomous Base swaps and EVM DeFi tools without per-transaction approvals.
|
|
3
|
-
allowed-tools: mcp__agent_wallet__agentlayer_autonomous_approve, mcp__agent_wallet__agentlayer_autonomous_status
|
|
3
|
+
allowed-tools: AskUserQuestion, mcp__agent_wallet__agentlayer_autonomous_approve, mcp__agent_wallet__agentlayer_autonomous_status
|
|
4
|
+
disable-model-invocation: true
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
Enable the high-trust autonomous AgentLayer permission group.
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
First call `agentlayer_autonomous_status`.
|
|
10
|
+
|
|
11
|
+
If both `base_swaps` and `defi_tools` are already enabled, report that the combined autonomous permission group is already active and remind the user that `/agentlayer-autonomous-revoke` disables it.
|
|
12
|
+
|
|
13
|
+
Otherwise, use `AskUserQuestion` to confirm:
|
|
14
|
+
|
|
15
|
+
- header: `Autonomy`
|
|
16
|
+
- question: `Enable AgentLayer autonomous Base swaps and EVM DeFi tools without per-transaction approvals?`
|
|
17
|
+
- options:
|
|
18
|
+
- `Enable` — `Turns on the combined autonomous permission group until revoked.`
|
|
19
|
+
- `Cancel` — `Leaves per-transaction approvals in place and does not change permissions.`
|
|
20
|
+
|
|
21
|
+
Only if the user selects `Enable`, call `agentlayer_autonomous_approve` with:
|
|
9
22
|
|
|
10
23
|
```json
|
|
11
24
|
{
|
|
@@ -17,6 +30,8 @@ Call `agentlayer_autonomous_approve` with:
|
|
|
17
30
|
|
|
18
31
|
Then call `agentlayer_autonomous_status` and report whether both `base_swaps` and `defi_tools` are enabled.
|
|
19
32
|
|
|
33
|
+
If the user selects `Cancel`, do not call any write tool. State that autonomous permissions were not changed.
|
|
34
|
+
|
|
20
35
|
Be explicit in the response:
|
|
21
36
|
|
|
22
37
|
- This removes per-transaction approvals for Base Velora/Uniswap swap execute calls and supported EVM DeFi management tools.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: Disable AgentLayer autonomous Base swaps and EVM DeFi tools.
|
|
3
3
|
allowed-tools: mcp__agent_wallet__agentlayer_autonomous_revoke, mcp__agent_wallet__agentlayer_autonomous_status
|
|
4
|
+
disable-model-invocation: true
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
Disable the full high-trust autonomous AgentLayer permission group.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Show the connected EVM wallet overview for Base directly in chat.
|
|
3
|
+
allowed-tools: mcp__agent_wallet__get_wallet_overview
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Show the connected EVM wallet overview for Base directly in chat.
|
|
8
|
+
|
|
9
|
+
1. Call `get_wallet_overview` with:
|
|
10
|
+
|
|
11
|
+
```json
|
|
12
|
+
{
|
|
13
|
+
"backend": "evm",
|
|
14
|
+
"network": "base"
|
|
15
|
+
}
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
2. Format the response as a compact wallet report:
|
|
19
|
+
|
|
20
|
+
- state the wallet as `EVM (Base)`
|
|
21
|
+
- include `chain`, `network` (or `requested_network`), `address`, and `total_value_usd` when present
|
|
22
|
+
- render a Markdown table with columns: `Asset | Type | Amount | USD Value`
|
|
23
|
+
- use `assets` when present
|
|
24
|
+
- for each asset row, prefer:
|
|
25
|
+
- asset label: `symbol`, then `token_address`, then `asset_type`
|
|
26
|
+
- amount: `amount_ui`, then `balance_ui`, then `balance_native`, then `amount_raw`
|
|
27
|
+
- usd value: `value_usd`, then `balance_usd`
|
|
28
|
+
- omit zero-value rows only when both the amount and USD value are clearly zero
|
|
29
|
+
- if no asset rows are available, still report the native balance summary in prose
|
|
30
|
+
|
|
31
|
+
3. After the table, add one short metadata line with any available sources:
|
|
32
|
+
|
|
33
|
+
- `source`
|
|
34
|
+
- `token_discovery_source`
|
|
35
|
+
- `pricing_source`
|
|
36
|
+
|
|
37
|
+
4. Do not suggest transfers, swaps, or other write actions unless the user explicitly asks for them.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Show the connected EVM wallet overview for Ethereum directly in chat.
|
|
3
|
+
allowed-tools: mcp__agent_wallet__get_wallet_overview
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Show the connected EVM wallet overview for Ethereum directly in chat.
|
|
8
|
+
|
|
9
|
+
1. Call `get_wallet_overview` with:
|
|
10
|
+
|
|
11
|
+
```json
|
|
12
|
+
{
|
|
13
|
+
"backend": "evm",
|
|
14
|
+
"network": "ethereum"
|
|
15
|
+
}
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
2. Format the response as a compact wallet report:
|
|
19
|
+
|
|
20
|
+
- state the wallet as `EVM (Ethereum)`
|
|
21
|
+
- include `chain`, `network` (or `requested_network`), `address`, and `total_value_usd` when present
|
|
22
|
+
- render a Markdown table with columns: `Asset | Type | Amount | USD Value`
|
|
23
|
+
- use `assets` when present
|
|
24
|
+
- for each asset row, prefer:
|
|
25
|
+
- asset label: `symbol`, then `token_address`, then `asset_type`
|
|
26
|
+
- amount: `amount_ui`, then `balance_ui`, then `balance_native`, then `amount_raw`
|
|
27
|
+
- usd value: `value_usd`, then `balance_usd`
|
|
28
|
+
- omit zero-value rows only when both the amount and USD value are clearly zero
|
|
29
|
+
- if no asset rows are available, still report the native balance summary in prose
|
|
30
|
+
|
|
31
|
+
3. After the table, add one short metadata line with any available sources:
|
|
32
|
+
|
|
33
|
+
- `source`
|
|
34
|
+
- `token_discovery_source`
|
|
35
|
+
- `pricing_source`
|
|
36
|
+
|
|
37
|
+
4. Do not suggest transfers, swaps, or other write actions unless the user explicitly asks for them.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Show the connected EVM wallet overview for the current/default EVM network directly in chat.
|
|
3
|
+
allowed-tools: mcp__agent_wallet__get_wallet_overview
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Show the connected EVM wallet overview directly in chat.
|
|
8
|
+
|
|
9
|
+
1. Call `get_wallet_overview` with:
|
|
10
|
+
|
|
11
|
+
```json
|
|
12
|
+
{
|
|
13
|
+
"backend": "evm"
|
|
14
|
+
}
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
2. Format the response as a compact wallet report:
|
|
18
|
+
|
|
19
|
+
- state the wallet as `EVM`
|
|
20
|
+
- include `chain`, the active/default EVM network (`network` or `requested_network`), `address`, and `total_value_usd` when present
|
|
21
|
+
- render a Markdown table with columns: `Asset | Type | Amount | USD Value`
|
|
22
|
+
- use `assets` when present
|
|
23
|
+
- for each asset row, prefer:
|
|
24
|
+
- asset label: `symbol`, then `token_address`, then `asset_type`
|
|
25
|
+
- amount: `amount_ui`, then `balance_ui`, then `balance_native`, then `amount_raw`
|
|
26
|
+
- usd value: `value_usd`, then `balance_usd`
|
|
27
|
+
- omit zero-value rows only when both the amount and USD value are clearly zero
|
|
28
|
+
- if no asset rows are available, still report the native balance summary in prose
|
|
29
|
+
|
|
30
|
+
3. After the table, add one short metadata line with any available sources:
|
|
31
|
+
|
|
32
|
+
- `source`
|
|
33
|
+
- `token_discovery_source`
|
|
34
|
+
- `pricing_source`
|
|
35
|
+
|
|
36
|
+
4. Be explicit that this command shows one EVM network at a time: the active/default network returned in the overview payload.
|
|
37
|
+
|
|
38
|
+
5. Do not suggest transfers, swaps, or other write actions unless the user explicitly asks for them.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Show the connected Solana wallet overview directly in chat.
|
|
3
|
+
allowed-tools: mcp__agent_wallet__get_wallet_overview
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Show the connected Solana wallet overview directly in chat.
|
|
8
|
+
|
|
9
|
+
1. Call `get_wallet_overview` with:
|
|
10
|
+
|
|
11
|
+
```json
|
|
12
|
+
{
|
|
13
|
+
"backend": "solana"
|
|
14
|
+
}
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
2. Format the response as a compact wallet report:
|
|
18
|
+
|
|
19
|
+
- state the wallet as `Solana`
|
|
20
|
+
- include `chain`, `network` (or `requested_network` when `network` is absent), `address`, and `total_value_usd` when present
|
|
21
|
+
- render a Markdown table with columns: `Asset | Type | Amount | USD Value`
|
|
22
|
+
- use `assets` when present
|
|
23
|
+
- for each asset row, prefer:
|
|
24
|
+
- asset label: `symbol`, then `mint`, then `token_address`, then `asset_type`
|
|
25
|
+
- amount: `amount_ui`, then `balance_ui`, then `balance_native`, then `amount_raw`
|
|
26
|
+
- usd value: `value_usd`, then `balance_usd`
|
|
27
|
+
- omit zero-value rows only when both the amount and USD value are clearly zero
|
|
28
|
+
- if no asset rows are available, still report the native balance summary in prose
|
|
29
|
+
|
|
30
|
+
3. After the table, add one short metadata line with any available sources:
|
|
31
|
+
|
|
32
|
+
- `source`
|
|
33
|
+
- `token_discovery_source`
|
|
34
|
+
- `pricing_source`
|
|
35
|
+
|
|
36
|
+
4. Do not suggest transfers, swaps, or other write actions unless the user explicitly asks for them.
|
|
@@ -361,6 +361,15 @@ def _normalize_selectable_evm_network(value: Any) -> str:
|
|
|
361
361
|
return network
|
|
362
362
|
|
|
363
363
|
|
|
364
|
+
def _implied_evm_network_from_backend_alias(value: Any) -> str | None:
|
|
365
|
+
normalized = str(value or "").strip().lower()
|
|
366
|
+
if normalized in {"base", "base-mainnet"}:
|
|
367
|
+
return "base"
|
|
368
|
+
if normalized in {"ethereum", "eth", "mainnet", "eth-mainnet"}:
|
|
369
|
+
return "ethereum"
|
|
370
|
+
return None
|
|
371
|
+
|
|
372
|
+
|
|
364
373
|
def _normalize_solana_network(value: Any) -> str | None:
|
|
365
374
|
network = str(value or "").strip().lower()
|
|
366
375
|
if not network:
|
|
@@ -492,12 +501,17 @@ def _reject_secret_config_json(config: dict[str, Any]) -> None:
|
|
|
492
501
|
|
|
493
502
|
|
|
494
503
|
def _base_config(args: dict[str, Any], *, tool_name: str = "") -> dict[str, Any]:
|
|
504
|
+
requested_backend = args.get("backend")
|
|
495
505
|
backend = (
|
|
496
|
-
_normalize_wallet_backend(
|
|
497
|
-
if
|
|
506
|
+
_normalize_wallet_backend(requested_backend)
|
|
507
|
+
if requested_backend is not None
|
|
498
508
|
else _active_backend_for_tool(tool_name)
|
|
499
509
|
)
|
|
500
510
|
config = _effective_config_for_backend(backend)
|
|
511
|
+
if backend == "wdk_evm_local":
|
|
512
|
+
implied_evm_network = _implied_evm_network_from_backend_alias(requested_backend)
|
|
513
|
+
if implied_evm_network and args.get("network") is None:
|
|
514
|
+
config["network"] = implied_evm_network
|
|
501
515
|
if "config" in args:
|
|
502
516
|
extra = args.get("config")
|
|
503
517
|
if not isinstance(extra, dict):
|
|
@@ -807,6 +821,33 @@ def _sanitize_schema(schema: dict[str, Any]) -> dict[str, Any]:
|
|
|
807
821
|
|
|
808
822
|
def _manual_tool_definitions() -> list[dict[str, Any]]:
|
|
809
823
|
return [
|
|
824
|
+
{
|
|
825
|
+
"name": "get_wallet_overview",
|
|
826
|
+
"description": (
|
|
827
|
+
"Get a one-off wallet overview for a requested backend/network without changing the "
|
|
828
|
+
"active Codex wallet session. Returns the same enriched balance payload used by "
|
|
829
|
+
"get_wallet_balance."
|
|
830
|
+
),
|
|
831
|
+
"input_schema": {
|
|
832
|
+
"type": "object",
|
|
833
|
+
"properties": {
|
|
834
|
+
"backend": {
|
|
835
|
+
"type": "string",
|
|
836
|
+
"description": "solana, evm, base, ethereum, btc, or bitcoin.",
|
|
837
|
+
},
|
|
838
|
+
"network": {
|
|
839
|
+
"type": "string",
|
|
840
|
+
"description": "Optional network override. Use base or ethereum for EVM.",
|
|
841
|
+
},
|
|
842
|
+
"address": {
|
|
843
|
+
"type": "string",
|
|
844
|
+
"description": "Optional wallet address override.",
|
|
845
|
+
},
|
|
846
|
+
},
|
|
847
|
+
"additionalProperties": False,
|
|
848
|
+
},
|
|
849
|
+
"read_only": True,
|
|
850
|
+
},
|
|
810
851
|
{
|
|
811
852
|
"name": "get_active_wallet_backend",
|
|
812
853
|
"description": (
|
|
@@ -909,7 +950,13 @@ async def _handle_set_wallet_backend(params: dict[str, Any]) -> dict[str, Any]:
|
|
|
909
950
|
# globals after the validating wallet call succeeds, so a failed switch never
|
|
910
951
|
# leaves a stale backend paired with a freshly mutated network selection.
|
|
911
952
|
if backend == "wdk_evm_local":
|
|
912
|
-
implied =
|
|
953
|
+
implied = (
|
|
954
|
+
params.get("network")
|
|
955
|
+
or _implied_evm_network_from_backend_alias(requested)
|
|
956
|
+
or selected_evm_network
|
|
957
|
+
or _default_evm_network()
|
|
958
|
+
or "ethereum"
|
|
959
|
+
)
|
|
913
960
|
resolved_network = _normalize_selectable_evm_network(implied)
|
|
914
961
|
elif backend == "wdk_btc_local":
|
|
915
962
|
resolved_network = _normalize_btc_network(
|
|
@@ -978,6 +1025,29 @@ async def _handle_set_evm_network(params: dict[str, Any]) -> dict[str, Any]:
|
|
|
978
1025
|
}
|
|
979
1026
|
|
|
980
1027
|
|
|
1028
|
+
async def _handle_get_wallet_overview(params: dict[str, Any]) -> dict[str, Any]:
|
|
1029
|
+
config = _base_config(params, tool_name="get_wallet_balance")
|
|
1030
|
+
backend = _normalize_wallet_backend(config.get("backend"))
|
|
1031
|
+
|
|
1032
|
+
effective_params: dict[str, Any] = {}
|
|
1033
|
+
if params.get("address") is not None:
|
|
1034
|
+
effective_params["address"] = params.get("address")
|
|
1035
|
+
|
|
1036
|
+
payload = await asyncio.to_thread(_invoke_tool, "get_wallet_balance", effective_params, config)
|
|
1037
|
+
if payload.get("ok") is False:
|
|
1038
|
+
raise RuntimeError(str(payload.get("error") or "get_wallet_overview failed"))
|
|
1039
|
+
data = payload.get("data", {})
|
|
1040
|
+
if not isinstance(data, dict):
|
|
1041
|
+
return {
|
|
1042
|
+
"requested_backend": _backend_label(backend),
|
|
1043
|
+
"requested_network": config.get("network"),
|
|
1044
|
+
"data": data,
|
|
1045
|
+
}
|
|
1046
|
+
data.setdefault("requested_backend", _backend_label(backend))
|
|
1047
|
+
data.setdefault("requested_network", config.get("network"))
|
|
1048
|
+
return data
|
|
1049
|
+
|
|
1050
|
+
|
|
981
1051
|
def _invoke_wallet_tool_blocking(
|
|
982
1052
|
tool_name: str,
|
|
983
1053
|
config: dict[str, Any],
|
|
@@ -1068,6 +1138,8 @@ def build_server():
|
|
|
1068
1138
|
|
|
1069
1139
|
async def _dispatch(tool_name: str, params: dict[str, Any] | None = None) -> dict[str, Any]:
|
|
1070
1140
|
params = params or {}
|
|
1141
|
+
if tool_name == "get_wallet_overview":
|
|
1142
|
+
return await _handle_get_wallet_overview(params)
|
|
1071
1143
|
if tool_name == "get_active_wallet_backend":
|
|
1072
1144
|
return await _handle_get_active_wallet_backend()
|
|
1073
1145
|
if tool_name == "set_wallet_backend":
|
package/package.json
CHANGED