@agentlayer.tech/wallet 0.1.52 → 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/dist/index.js +154 -0
- package/.openclaw/extensions/agent-wallet/index.ts +19 -9
- package/.openclaw/extensions/agent-wallet/openclaw.plugin.json +1 -1
- package/.openclaw/extensions/agent-wallet/package.json +1 -1
- package/CHANGELOG.md +13 -1
- package/README.md +14 -12
- package/VERSION +1 -1
- package/agent-wallet/agent_wallet/__init__.py +1 -1
- package/agent-wallet/agent_wallet/autonomous_permissions.py +110 -17
- package/agent-wallet/agent_wallet/openclaw_adapter.py +221 -109
- package/agent-wallet/agent_wallet/openclaw_cli.py +6 -5
- 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 +24 -8
- package/claude-code/plugins/agent-wallet/commands/agentlayer-autonomous-revoke.md +4 -3
- 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 +90 -7
- 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
|
@@ -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,24 +1,40 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Enable AgentLayer autonomous Base swaps without per-transaction approvals.
|
|
3
|
-
allowed-tools: mcp__agent_wallet__agentlayer_autonomous_approve, mcp__agent_wallet__agentlayer_autonomous_status
|
|
2
|
+
description: Enable AgentLayer autonomous Base swaps and EVM DeFi tools without per-transaction approvals.
|
|
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
|
-
Enable high-trust autonomous
|
|
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
|
{
|
|
12
25
|
"scope": "base_swaps",
|
|
13
|
-
"purpose": "User requested autonomous Base swaps from Claude Code.",
|
|
26
|
+
"purpose": "User requested autonomous Base swaps and EVM DeFi tools from Claude Code.",
|
|
14
27
|
"user_intent": true
|
|
15
28
|
}
|
|
16
29
|
```
|
|
17
30
|
|
|
18
|
-
Then call `agentlayer_autonomous_status` and report whether `base_swaps`
|
|
31
|
+
Then call `agentlayer_autonomous_status` and report whether both `base_swaps` and `defi_tools` are enabled.
|
|
32
|
+
|
|
33
|
+
If the user selects `Cancel`, do not call any write tool. State that autonomous permissions were not changed.
|
|
19
34
|
|
|
20
35
|
Be explicit in the response:
|
|
21
36
|
|
|
22
|
-
- This
|
|
23
|
-
-
|
|
37
|
+
- This removes per-transaction approvals for Base Velora/Uniswap swap execute calls and supported EVM DeFi management tools.
|
|
38
|
+
- The `scope=base_swaps` argument is a compatibility value; this command enables the combined autonomous permission group.
|
|
39
|
+
- It does not authorize transfers, bridges, Solana swaps, or generic contract calls.
|
|
24
40
|
- The user can run `/agentlayer-autonomous-revoke` to disable it.
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Disable AgentLayer autonomous Base swaps.
|
|
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
|
-
Disable high-trust autonomous
|
|
7
|
+
Disable the full high-trust autonomous AgentLayer permission group.
|
|
7
8
|
|
|
8
9
|
Call `agentlayer_autonomous_revoke` with:
|
|
9
10
|
|
|
@@ -13,4 +14,4 @@ Call `agentlayer_autonomous_revoke` with:
|
|
|
13
14
|
}
|
|
14
15
|
```
|
|
15
16
|
|
|
16
|
-
Then call `agentlayer_autonomous_status` and report whether `base_swaps`
|
|
17
|
+
Then call `agentlayer_autonomous_status` and report whether both `base_swaps` and `defi_tools` are disabled.
|
|
@@ -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.
|
|
@@ -60,6 +60,13 @@ PREVIEW_BOUND_SWAP_TOOLS = {
|
|
|
60
60
|
"flash_trade_close_position",
|
|
61
61
|
}
|
|
62
62
|
AUTONOMOUS_BASE_SWAP_TOOLS = {"swap_evm_tokens", "swap_evm_uniswap_tokens"}
|
|
63
|
+
AUTONOMOUS_DEFI_TOOLS = {
|
|
64
|
+
"manage_evm_aave_position",
|
|
65
|
+
"manage_evm_lido_position",
|
|
66
|
+
"manage_evm_lido_withdrawal",
|
|
67
|
+
"manage_evm_morpho_market_position",
|
|
68
|
+
"manage_evm_morpho_vault_position",
|
|
69
|
+
}
|
|
63
70
|
APPROVAL_PREVIEW_TOOL_ALIASES = {
|
|
64
71
|
"x402_pay_request": "x402_preview_request",
|
|
65
72
|
}
|
|
@@ -354,6 +361,15 @@ def _normalize_selectable_evm_network(value: Any) -> str:
|
|
|
354
361
|
return network
|
|
355
362
|
|
|
356
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
|
+
|
|
357
373
|
def _normalize_solana_network(value: Any) -> str | None:
|
|
358
374
|
network = str(value or "").strip().lower()
|
|
359
375
|
if not network:
|
|
@@ -485,12 +501,17 @@ def _reject_secret_config_json(config: dict[str, Any]) -> None:
|
|
|
485
501
|
|
|
486
502
|
|
|
487
503
|
def _base_config(args: dict[str, Any], *, tool_name: str = "") -> dict[str, Any]:
|
|
504
|
+
requested_backend = args.get("backend")
|
|
488
505
|
backend = (
|
|
489
|
-
_normalize_wallet_backend(
|
|
490
|
-
if
|
|
506
|
+
_normalize_wallet_backend(requested_backend)
|
|
507
|
+
if requested_backend is not None
|
|
491
508
|
else _active_backend_for_tool(tool_name)
|
|
492
509
|
)
|
|
493
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
|
|
494
515
|
if "config" in args:
|
|
495
516
|
extra = args.get("config")
|
|
496
517
|
if not isinstance(extra, dict):
|
|
@@ -643,19 +664,23 @@ def _requires_approved_preview_payload(tool_name: str, params: dict[str, Any]) -
|
|
|
643
664
|
return tool_name in PREVIEW_BOUND_SWAP_TOOLS
|
|
644
665
|
|
|
645
666
|
|
|
646
|
-
def
|
|
667
|
+
def _should_let_backend_authorize_autonomous_execution(
|
|
647
668
|
tool_name: str,
|
|
648
669
|
params: dict[str, Any],
|
|
649
670
|
config: dict[str, Any],
|
|
650
671
|
) -> bool:
|
|
651
|
-
|
|
672
|
+
is_base_swap_tool = tool_name in AUTONOMOUS_BASE_SWAP_TOOLS
|
|
673
|
+
is_defi_tool = tool_name in AUTONOMOUS_DEFI_TOOLS
|
|
674
|
+
if not is_base_swap_tool and not is_defi_tool:
|
|
652
675
|
return False
|
|
653
676
|
if str(params.get("mode") or "") != "execute":
|
|
654
677
|
return False
|
|
655
678
|
if str(params.get("approval_token") or "").strip():
|
|
656
679
|
return False
|
|
657
680
|
network = str(params.get("network") or config.get("network") or selected_evm_network or "").strip().lower()
|
|
658
|
-
|
|
681
|
+
if is_base_swap_tool:
|
|
682
|
+
return network == "base"
|
|
683
|
+
return network in {"base", "ethereum"}
|
|
659
684
|
|
|
660
685
|
|
|
661
686
|
def _looks_like_approval_context_error(message: str) -> bool:
|
|
@@ -712,7 +737,7 @@ def _attach_approval_for_execute(
|
|
|
712
737
|
effective_params["_approved_preview"] = cached_preview
|
|
713
738
|
if effective_params.get("approval_token"):
|
|
714
739
|
return None
|
|
715
|
-
if
|
|
740
|
+
if _should_let_backend_authorize_autonomous_execution(tool_name, effective_params, config):
|
|
716
741
|
return None
|
|
717
742
|
raise RuntimeError(APPROVAL_CONTEXT_MISSING_MESSAGE)
|
|
718
743
|
|
|
@@ -796,6 +821,33 @@ def _sanitize_schema(schema: dict[str, Any]) -> dict[str, Any]:
|
|
|
796
821
|
|
|
797
822
|
def _manual_tool_definitions() -> list[dict[str, Any]]:
|
|
798
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
|
+
},
|
|
799
851
|
{
|
|
800
852
|
"name": "get_active_wallet_backend",
|
|
801
853
|
"description": (
|
|
@@ -898,7 +950,13 @@ async def _handle_set_wallet_backend(params: dict[str, Any]) -> dict[str, Any]:
|
|
|
898
950
|
# globals after the validating wallet call succeeds, so a failed switch never
|
|
899
951
|
# leaves a stale backend paired with a freshly mutated network selection.
|
|
900
952
|
if backend == "wdk_evm_local":
|
|
901
|
-
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
|
+
)
|
|
902
960
|
resolved_network = _normalize_selectable_evm_network(implied)
|
|
903
961
|
elif backend == "wdk_btc_local":
|
|
904
962
|
resolved_network = _normalize_btc_network(
|
|
@@ -967,6 +1025,29 @@ async def _handle_set_evm_network(params: dict[str, Any]) -> dict[str, Any]:
|
|
|
967
1025
|
}
|
|
968
1026
|
|
|
969
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
|
+
|
|
970
1051
|
def _invoke_wallet_tool_blocking(
|
|
971
1052
|
tool_name: str,
|
|
972
1053
|
config: dict[str, Any],
|
|
@@ -1057,6 +1138,8 @@ def build_server():
|
|
|
1057
1138
|
|
|
1058
1139
|
async def _dispatch(tool_name: str, params: dict[str, Any] | None = None) -> dict[str, Any]:
|
|
1059
1140
|
params = params or {}
|
|
1141
|
+
if tool_name == "get_wallet_overview":
|
|
1142
|
+
return await _handle_get_wallet_overview(params)
|
|
1060
1143
|
if tool_name == "get_active_wallet_backend":
|
|
1061
1144
|
return await _handle_get_active_wallet_backend()
|
|
1062
1145
|
if tool_name == "set_wallet_backend":
|
package/package.json
CHANGED