From 925c4a1b9900e4953e22f696674469ee80542e82 Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Wed, 11 Nov 2026 00:41:35 +0300 Subject: [PATCH 01/19] feat(wallet): expose SPL token balances via wallet.token_balances and wallet_balances Adapt the module's new NativeWalletTokenBalances member (tinywallet contract 1.15) as the wallet.token_balances RPC and fold its rows into the wallet_balances agent tool as {native, tokens}; a failed token read keeps the native rows and reports tokensError. Moves the tinywallet gitlink to the tinywallet PR commit; the module pin still has to move to a release that serves the member. Co-authored-by: Medulla --- crates/openhuman-core/src/web3/README.md | 2 +- .../openhuman-core/src/web3/wallet/README.md | 4 +-- .../src/web3/wallet/automation_tools.rs | 26 +++++++++++++--- .../src/web3/wallet/automation_tools_tests.rs | 31 +++++++++++++++++++ .../src/web3/wallet/execution.rs | 22 ++++++++++++- crates/openhuman-core/src/web3/wallet/mod.rs | 7 +++-- .../openhuman-core/src/web3/wallet/schemas.rs | 25 +++++++++++++++ .../src/web3/wallet/schemas_tests.rs | 4 +-- docs/gitbooks/en/features/wallet.md | 2 +- vendor/tinywallet | 2 +- 10 files changed, 109 insertions(+), 16 deletions(-) diff --git a/crates/openhuman-core/src/web3/README.md b/crates/openhuman-core/src/web3/README.md index 9f70ade29f3..ffee120db39 100644 --- a/crates/openhuman-core/src/web3/README.md +++ b/crates/openhuman-core/src/web3/README.md @@ -91,7 +91,7 @@ Namespace names are wire contracts. | `web3_swap` | `quote`, `execute`, `routes` | | `web3_bridge` | `quote`, `execute` | | `web3_dapp` | `call`, `execute` | -| [`wallet`](./wallet/README.md) | `setup`, `status`, `reveal_recovery_phrase`, `balances`, `chain_status`, `network_defaults`, `supported_assets`, `encode_erc20_transfer`, `prepare_transfer`, `execute_prepared`, `tx_status`, `tx_receipt`, `lookup_tx`, `policy_get`, `policy_update`, `ledger_list` | +| [`wallet`](./wallet/README.md) | `setup`, `status`, `reveal_recovery_phrase`, `balances`, `token_balances`, `chain_status`, `network_defaults`, `supported_assets`, `encode_erc20_transfer`, `prepare_transfer`, `execute_prepared`, `tx_status`, `tx_receipt`, `lookup_tx`, `policy_get`, `policy_update`, `ledger_list` | | [`x402`](./x402/README.md) | `get_summary`, `list_payments`, `update_budget` | The existing Wallet/Web3/x402 agent declarations come from `tinywallet-bus`; diff --git a/crates/openhuman-core/src/web3/wallet/README.md b/crates/openhuman-core/src/web3/wallet/README.md index a907da3c19c..77e77c29248 100644 --- a/crates/openhuman-core/src/web3/wallet/README.md +++ b/crates/openhuman-core/src/web3/wallet/README.md @@ -42,7 +42,7 @@ changing the facade. | Function | Purpose | | --- | --- | | `status`, `setup`, `reveal_recovery_phrase` | Onboarding, public account metadata, encrypted phrase custody, and explicit reveal. | -| `balances`, `chain_status`, `network_defaults`, `supported_assets` | Read module-owned provider and network data. | +| `balances`, `token_balances`, `chain_status`, `network_defaults`, `supported_assets` | Read module-owned provider and network data (`token_balances`: catalogued SPL tokens such as USDC, contract 1.15). | | `encode_erc20_transfer` | Request standard EVM transfer calldata from the module. | | `prepare_transfer`, `execute_prepared` | Prepare a module-owned quote, then explicitly confirm and execute it (through the spend policy, as an interactive execute). | | `policy_get`, `policy_update` | Read and persist the `[wallet_policy]` spend policy. | @@ -61,7 +61,7 @@ The six established wallet tools are declared in `tinywallet-bus` and adapted in `tools.rs`: `wallet_status`, `wallet_chain_status`, `wallet_prepare_transfer`, `wallet_tx_status`, `wallet_tx_receipt`, and `wallet_lookup_tx`. `automation_tools.rs` adds two policy-bound tools: -`wallet_balances` (the module's native balances) and `wallet_execute_prepared` +`wallet_balances` (the module's native and token balances) and `wallet_execute_prepared` (an execute through the spend policy below). ## Spend policy and ledger diff --git a/crates/openhuman-core/src/web3/wallet/automation_tools.rs b/crates/openhuman-core/src/web3/wallet/automation_tools.rs index 2bdb2055aa9..886d5c00c2f 100644 --- a/crates/openhuman-core/src/web3/wallet/automation_tools.rs +++ b/crates/openhuman-core/src/web3/wallet/automation_tools.rs @@ -45,7 +45,8 @@ impl Tool for WalletBalancesTool { } fn description(&self) -> &'static str { - "Read the wallet's live balances: one row per account and network with the asset symbol, \ + "Read the wallet's live balances: `native` (one row per account and network) and `tokens` \ + (catalogued tokens such as USDC on Solana, with their mint), each with the asset symbol, \ decimals, raw atomic amount and formatted amount. A row whose providerStatus is not \ 'ready' could not be read and shows zero." } @@ -66,15 +67,30 @@ impl Tool for WalletBalancesTool { context: Option<&dyn tinytools::ToolRunContext>, ) -> anyhow::Result { let ctx = crate::agent::tinyagents::host::run_context::dispatch_ctx_for_tool(context); - match super::balances(&ctx).await { - Ok(outcome) => Ok(ToolResult::success(serde_json::to_string_pretty( - &outcome.value, - )?)), + let native = super::balances(&ctx).await.map(|outcome| outcome.value); + let tokens = super::token_balances(&ctx) + .await + .map(|outcome| outcome.value); + match combine_balances(native, tokens) { + Ok(value) => Ok(ToolResult::success(serde_json::to_string_pretty(&value)?)), Err(error) => Ok(ToolResult::error(error)), } } } +/// The `wallet_balances` result: native rows and token rows. A failed token +/// read does not hide the native balances; it is reported beside them. +pub(crate) fn combine_balances( + native: Result, String>, + tokens: Result, String>, +) -> Result { + let native = native?; + Ok(match tokens { + Ok(tokens) => json!({"native": native, "tokens": tokens}), + Err(error) => json!({"native": native, "tokens": [], "tokensError": error}), + }) +} + /// Execute a prepared transfer under the spend policy. #[derive(Debug, Default)] pub struct WalletExecutePreparedTool; diff --git a/crates/openhuman-core/src/web3/wallet/automation_tools_tests.rs b/crates/openhuman-core/src/web3/wallet/automation_tools_tests.rs index 0d66e281b39..df151c9c458 100644 --- a/crates/openhuman-core/src/web3/wallet/automation_tools_tests.rs +++ b/crates/openhuman-core/src/web3/wallet/automation_tools_tests.rs @@ -71,3 +71,34 @@ fn balance_tool_is_a_read() { assert_eq!(tool.permission_level(), PermissionLevel::ReadOnly); assert_eq!(automation_tools().len(), 2); } + +fn token_row(raw: &str) -> super::super::TokenBalanceInfo { + super::super::TokenBalanceInfo { + chain: tinywallet_bus::wire::WalletChain::Solana, + evm_network: None, + address: "Owner".into(), + asset_symbol: "USDC".into(), + token_address: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v".into(), + decimals: 6, + raw: raw.into(), + formatted: "1.500000".into(), + provider_status: super::super::ProviderStatus::Ready, + } +} + +#[test] +fn balances_tool_returns_native_and_token_rows_together() { + let value = combine_balances(Ok(Vec::new()), Ok(vec![token_row("1500000")])).unwrap(); + assert_eq!(value["native"], json!([])); + assert_eq!(value["tokens"][0]["assetSymbol"], "USDC"); + assert_eq!(value["tokens"][0]["raw"], "1500000"); + assert!(value.get("tokensError").is_none()); +} + +#[test] +fn a_failed_token_read_keeps_the_native_balances_and_says_why() { + let value = combine_balances(Ok(Vec::new()), Err("module too old".into())).unwrap(); + assert_eq!(value["tokens"], json!([])); + assert_eq!(value["tokensError"], "module too old"); + assert!(combine_balances(Err("not configured".into()), Ok(Vec::new())).is_err()); +} diff --git a/crates/openhuman-core/src/web3/wallet/execution.rs b/crates/openhuman-core/src/web3/wallet/execution.rs index aa415ded2a7..dd30b712820 100644 --- a/crates/openhuman-core/src/web3/wallet/execution.rs +++ b/crates/openhuman-core/src/web3/wallet/execution.rs @@ -11,7 +11,7 @@ use tinywallet_bus::wire::{NativeWalletServiceRequest, NativeWalletTransactionRe pub use tinywallet_bus::wire::{ BalanceInfo, ChainStatus, ExecutePreparedParams, ExecutionResult, PrepareTransferParams, PreparedKind, PreparedStatus, PreparedTransaction, ProviderStatus, SupportedAsset, - TxLookupInfo, TxReceiptInfo, TxState, TxStatusInfo, + TokenBalanceInfo, TxLookupInfo, TxReceiptInfo, TxState, TxStatusInfo, }; use tinywallet_bus::wire::{EvmNetwork, WalletNetworkDefaults}; @@ -96,6 +96,26 @@ pub async fn balances(ctx: &DispatchCtx) -> Result>, St )) } +/// Live balances of the catalogued tokens (the cluster's USDC SPL mint on +/// Solana), read by the module (`NativeWalletTokenBalances`, contract 1.15). +pub async fn token_balances(ctx: &DispatchCtx) -> Result>, String> { + let config = ctx.load_config().await?; + let result = wallet_service::with_native_wallet(ctx, &config, |service| async { + wallet_module::call( + &config, + methods::NATIVE_WALLET_TOKEN_BALANCES, + NativeWalletServiceRequest { service }, + ) + .await + }) + .await + .map_err(|error| error.to_string())?; + Ok(Outcome::new( + result, + vec!["wallet token balances listed".to_string()], + )) +} + /// Validate a transfer and store a quote for it. pub async fn prepare_transfer( ctx: &DispatchCtx, diff --git a/crates/openhuman-core/src/web3/wallet/mod.rs b/crates/openhuman-core/src/web3/wallet/mod.rs index 9515299aac8..85a580ffa3e 100644 --- a/crates/openhuman-core/src/web3/wallet/mod.rs +++ b/crates/openhuman-core/src/web3/wallet/mod.rs @@ -68,9 +68,10 @@ pub use endpoints::solana_cluster; pub use execution::{ balances, chain_status, execute_prepared, execute_prepared_as, lookup_tx, network_defaults as wallet_network_defaults, prepare_transfer, prepared_quotes_for_test, - supported_assets, tx_receipt, tx_status, BalanceInfo, ChainStatus, ExecutePreparedParams, - ExecutionResult, PrepareTransferParams, PreparedKind, PreparedStatus, PreparedTransaction, - ProviderStatus, SupportedAsset, TxLookupInfo, TxReceiptInfo, TxState, TxStatusInfo, + supported_assets, token_balances, tx_receipt, tx_status, BalanceInfo, ChainStatus, + ExecutePreparedParams, ExecutionResult, PrepareTransferParams, PreparedKind, PreparedStatus, + PreparedTransaction, ProviderStatus, SupportedAsset, TokenBalanceInfo, TxLookupInfo, + TxReceiptInfo, TxState, TxStatusInfo, }; #[cfg(feature = "web3")] pub use ops::{ diff --git a/crates/openhuman-core/src/web3/wallet/schemas.rs b/crates/openhuman-core/src/web3/wallet/schemas.rs index d5f486e95c4..f22bc1dc27c 100644 --- a/crates/openhuman-core/src/web3/wallet/schemas.rs +++ b/crates/openhuman-core/src/web3/wallet/schemas.rs @@ -85,6 +85,7 @@ pub fn all_wallet_controller_schemas() -> Vec { wallet_schemas("generate_mnemonic"), wallet_schemas("validate_mnemonic"), wallet_schemas("derive_recovery_material"), + wallet_schemas("token_balances"), wallet_schemas("policy_get"), wallet_schemas("policy_update"), wallet_schemas("ledger_list"), @@ -157,6 +158,10 @@ pub fn all_wallet_registered_controllers() -> Vec { schema: wallet_schemas("derive_recovery_material"), handler: handle_derive_recovery_material, }, + RegisteredController { + schema: wallet_schemas("token_balances"), + handler: handle_token_balances, + }, RegisteredController { schema: wallet_schemas("policy_get"), handler: handle_policy_get, @@ -428,6 +433,18 @@ pub fn wallet_schemas(function: &str) -> ControllerSchema { required: true, }], }, + "token_balances" => ControllerSchema { + namespace: "wallet", + function: "token_balances", + description: "List catalogued token balances for the wallet accounts: today the configured Solana cluster's USDC SPL mint, summed over the owner's token accounts. A row whose providerStatus is missing could not be read and shows zero.", + inputs: vec![], + outputs: vec![FieldSchema { + name: "result", + ty: TypeSchema::Json, + comment: "Array of {chain, evmNetwork?, address, assetSymbol, tokenAddress, decimals, raw, formatted, providerStatus}.", + required: true, + }], + }, "policy_get" => ControllerSchema { namespace: "wallet", function: "policy_get", @@ -635,6 +652,14 @@ fn handle_derive_recovery_material( }) } +fn handle_token_balances(ctx: DispatchCtx, _params: Map) -> ControllerFuture { + Box::pin(async move { + crate::web3::wallet::token_balances(&ctx) + .await? + .into_cli_compatible_json() + }) +} + fn handle_policy_get(ctx: DispatchCtx, _params: Map) -> ControllerFuture { Box::pin(async move { super::policy_ops::policy_get(&ctx) diff --git a/crates/openhuman-core/src/web3/wallet/schemas_tests.rs b/crates/openhuman-core/src/web3/wallet/schemas_tests.rs index 0795d82a780..f3ab812ac63 100644 --- a/crates/openhuman-core/src/web3/wallet/schemas_tests.rs +++ b/crates/openhuman-core/src/web3/wallet/schemas_tests.rs @@ -6,8 +6,8 @@ use crate::core::all::{ #[test] fn wallet_schema_wire_contracts_are_preserved() { - assert_eq!(all_wallet_controller_schemas().len(), 19); - assert_eq!(all_wallet_registered_controllers().len(), 19); + assert_eq!(all_wallet_controller_schemas().len(), 20); + assert_eq!(all_wallet_registered_controllers().len(), 20); assert_schema_controller_parity( &all_wallet_controller_schemas(), &all_wallet_registered_controllers(), diff --git a/docs/gitbooks/en/features/wallet.md b/docs/gitbooks/en/features/wallet.md index 83ed9d8b7cc..0d3e0f21f85 100644 --- a/docs/gitbooks/en/features/wallet.md +++ b/docs/gitbooks/en/features/wallet.md @@ -83,7 +83,7 @@ The agent reaches the wallet through eight tools: | --- | --- | | `wallet_status` | Onboarding status and account addresses. | | `wallet_chain_status` | Per-chain readiness and active RPC. | -| `wallet_balances` | Live balances per account and network. | +| `wallet_balances` | Live native and token (USDC on Solana) balances. | | `wallet_prepare_transfer` | Build a validated, fee-estimated quote. | | `wallet_execute_prepared` | Execute a prepared quote, only within the spend policy. | | `wallet_tx_status` | Transaction lifecycle state by hash. | diff --git a/vendor/tinywallet b/vendor/tinywallet index 30e92e630c5..f1be2d7ab2e 160000 --- a/vendor/tinywallet +++ b/vendor/tinywallet @@ -1 +1 @@ -Subproject commit 30e92e630c5130a486e0dd8bbac64330a48f3470 +Subproject commit f1be2d7ab2e0c58a71e0be4f8d2daf5384920d35 From 5ddcf31af3acf446c734408fad7e5ba0b94e0d2f Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Wed, 11 Nov 2026 01:59:29 +0300 Subject: [PATCH 02/19] chore(wallet): bump tinywallet module to 0.29.0 Update the tinywallet module record to version 0.29.0, refreshing the release URL, archive names and per-platform SHA-256 checksums, and advance the vendored submodule to the matching revision. Auto-committed-on: macbook Co-authored-by: Medulla --- .../modules/registry/records_docs_wallet.rs | 72 +++++++++---------- vendor/tinywallet | 2 +- 2 files changed, 37 insertions(+), 37 deletions(-) diff --git a/crates/openhuman-core/src/modules/registry/records_docs_wallet.rs b/crates/openhuman-core/src/modules/registry/records_docs_wallet.rs index 8aff0ca9c48..1fbc3e776ee 100644 --- a/crates/openhuman-core/src/modules/registry/records_docs_wallet.rs +++ b/crates/openhuman-core/src/modules/registry/records_docs_wallet.rs @@ -125,109 +125,109 @@ pub(crate) const TINYWALLET: ModuleRecord = ModuleRecord { description: "Transaction building and assembly for Bitcoin, EVM, Solana and Tron", bus_name: tinywallet_bus::names::BUS_NAME, object_path: tinywallet_bus::names::OBJECT_PATH, - version: "0.28.0", - release_url: "https://github.com/tinyhumansai/tinywallet/releases/tag/v0.28.0", + version: "0.29.0", + release_url: "https://github.com/tinyhumansai/tinywallet/releases/tag/v0.29.0", assets: &[ PlatformAsset { host_key: "archlinux-arm64", - archive: "tinywallet-module-0.28.0-archlinux-arm64.tar.gz", - sha256: "da90ff7b53c2a229896d5a4ab0e3121727488f37a78551b3207a9c78bc4a09a6", + archive: "tinywallet-module-0.29.0-archlinux-arm64.tar.gz", + sha256: "90d8cb352a9d6b6403549f053446139c0361d36354ca7c37e0bc0296eb544cae", library_sha256: None, }, PlatformAsset { host_key: "archlinux-x86_64", - archive: "tinywallet-module-0.28.0-archlinux-x86_64.tar.gz", - sha256: "1e80c400e50643d938e25b45aa0327de170f66f39fe65645a9d5ccb31b5f4a88", + archive: "tinywallet-module-0.29.0-archlinux-x86_64.tar.gz", + sha256: "8e9bc6e2d443807cbbb1759cb85896abbcc0d3294a0ec58007fe0c56aecb5a25", library_sha256: None, }, PlatformAsset { host_key: "fedora-43-arm64", - archive: "tinywallet-module-0.28.0-fedora-43-arm64.tar.gz", - sha256: "fb2b630ae47e64bd10a975861e647a939bfaa55b664c8f0706cd096779d62c3b", + archive: "tinywallet-module-0.29.0-fedora-43-arm64.tar.gz", + sha256: "71e8ec37af5be258c111169e441fed5f4a46d9b3934c477569ec1185ec7ceba5", library_sha256: None, }, PlatformAsset { host_key: "fedora-43-x86_64", - archive: "tinywallet-module-0.28.0-fedora-43-x86_64.tar.gz", - sha256: "84cc92b8775d26def86ad5073ed7315a50aae4b5aa7134a1cf485b923a32c38b", + archive: "tinywallet-module-0.29.0-fedora-43-x86_64.tar.gz", + sha256: "3e7438212776adbe82a54a5c48ff744cd26ee73d0dee66bce7de42b968608a16", library_sha256: None, }, PlatformAsset { host_key: "fedora-44-arm64", - archive: "tinywallet-module-0.28.0-fedora-44-arm64.tar.gz", - sha256: "14a1f4a044a7e5b246aa2df7209c31c165bf1305b38d888a540c2e438c11e202", + archive: "tinywallet-module-0.29.0-fedora-44-arm64.tar.gz", + sha256: "7612aeeca130c741b38673279268494e0cf49891dd95574e14310e64634a6840", library_sha256: None, }, PlatformAsset { host_key: "fedora-44-x86_64", - archive: "tinywallet-module-0.28.0-fedora-44-x86_64.tar.gz", - sha256: "d550966866d4b3446abef6f3b19fcf6968d914579a445c8b08fff276465b9029", + archive: "tinywallet-module-0.29.0-fedora-44-x86_64.tar.gz", + sha256: "9807227a79989d6c17be18212462751e244fb1b5f2bbe1224e0054b3f37cc188", library_sha256: None, }, PlatformAsset { host_key: "macos-15-arm64", - archive: "tinywallet-module-0.28.0-macos-15-arm64.tar.gz", - sha256: "c8c791b7464f1db2c6395f286cf63727b24bacb7606e318bb7dad5fa120387e1", + archive: "tinywallet-module-0.29.0-macos-15-arm64.tar.gz", + sha256: "228b25d3ea7869436cf009bc228dc94f8f40fcf1d7ea81c622651c14b6bbc216", library_sha256: None, }, PlatformAsset { host_key: "macos-15-x86_64", - archive: "tinywallet-module-0.28.0-macos-15-x86_64.tar.gz", - sha256: "b72c5f5b979302599b3a4f85b6783bd753c119e23ade819c0b1edf9ffd01d729", + archive: "tinywallet-module-0.29.0-macos-15-x86_64.tar.gz", + sha256: "0b173d7ebed6ce23c7224a55a32c9b9716471a054119b02869abc2add15dc391", library_sha256: None, }, PlatformAsset { host_key: "macos-26-arm64", - archive: "tinywallet-module-0.28.0-macos-26-arm64.tar.gz", - sha256: "b8d189befa3358f854346f3903187ef23b990b71d314a4a58539531c9212ca82", + archive: "tinywallet-module-0.29.0-macos-26-arm64.tar.gz", + sha256: "61ee2de3ca95cea7f8253de3e47f4da9ae42bd4ac406c65374aaf4cd22b742f3", library_sha256: None, }, PlatformAsset { host_key: "macos-26-x86_64", - archive: "tinywallet-module-0.28.0-macos-26-x86_64.tar.gz", - sha256: "9eb8990e3401b8c6d30ca08a434c64f56ff82e6bc1b6e160d27aae4d30a8c24f", + archive: "tinywallet-module-0.29.0-macos-26-x86_64.tar.gz", + sha256: "5c7593c4bb15f806a83c25dee97e26bf86a73571046d6523164885804d0c9c7d", library_sha256: None, }, PlatformAsset { host_key: "ubuntu-22.04-arm64", - archive: "tinywallet-module-0.28.0-ubuntu-22.04-arm64.tar.gz", - sha256: "c753826827230d2ebcb044eeae91f96d1f08d945f1ef37b26030ae0e0843d60c", + archive: "tinywallet-module-0.29.0-ubuntu-22.04-arm64.tar.gz", + sha256: "54085d6e1391f98fb44b86735df0f147318502153c4d3e96c5586421835cb5aa", library_sha256: None, }, PlatformAsset { host_key: "ubuntu-22.04-x86_64", - archive: "tinywallet-module-0.28.0-ubuntu-22.04-x86_64.tar.gz", - sha256: "02cec7d7e33112266b988be1bab6213b71193f7a183db8783dba941e62ef7b46", + archive: "tinywallet-module-0.29.0-ubuntu-22.04-x86_64.tar.gz", + sha256: "4d2016fac3c2001dae9ff152dad91057741aa6c031093b10fce4a4f3e1654045", library_sha256: None, }, PlatformAsset { host_key: "ubuntu-24.04-arm64", - archive: "tinywallet-module-0.28.0-ubuntu-24.04-arm64.tar.gz", - sha256: "5b8dc519829098029609e224b95b2149a71cdaad240148e33c0abac71ec5dc07", + archive: "tinywallet-module-0.29.0-ubuntu-24.04-arm64.tar.gz", + sha256: "dedb29838c947d2da479c9998a38d772de875bd914eae0d0a8b81377bb7b894c", library_sha256: None, }, PlatformAsset { host_key: "ubuntu-24.04-x86_64", - archive: "tinywallet-module-0.28.0-ubuntu-24.04-x86_64.tar.gz", - sha256: "c2bb2acd7c15b061b66d564db738aa3eac6802544fba753a6715ade541faac86", + archive: "tinywallet-module-0.29.0-ubuntu-24.04-x86_64.tar.gz", + sha256: "74036ca124938a556687ff760d83fb3ad2eebb9e91a2a9cb93873a537f8e85a3", library_sha256: None, }, PlatformAsset { host_key: "windows-11-arm64", - archive: "tinywallet-module-0.28.0-windows-11-arm64.zip", - sha256: "02598b083ce4d7e66c6d295785b5b42535861614741b2371462847760bbd2823", + archive: "tinywallet-module-0.29.0-windows-11-arm64.zip", + sha256: "5fd451a1166e64af8f5936239f22ca88deadb6ff96058e7b9295887fa8315999", library_sha256: None, }, PlatformAsset { host_key: "windows-2022-x86_64", - archive: "tinywallet-module-0.28.0-windows-2022-x86_64.zip", - sha256: "fdf15c140e0de0492fb0fde449e38e8eef0653cc7af6ebbe71c56218f5d33c17", + archive: "tinywallet-module-0.29.0-windows-2022-x86_64.zip", + sha256: "b272c66ade706b7cb3c443fbd05c549abc2ef024f044b1cdfeba19f61367db78", library_sha256: None, }, PlatformAsset { host_key: "windows-2025-x86_64", - archive: "tinywallet-module-0.28.0-windows-2025-x86_64.zip", - sha256: "a89031486e2aeb8f2f96fc314a5a291ebc4364e3b34dcdcd6a010b1a939b365e", + archive: "tinywallet-module-0.29.0-windows-2025-x86_64.zip", + sha256: "2a6b49b81af30bbe6975c7274a9c2f8cef2a3bde10a3cebae1f4c8b9c1bf5333", library_sha256: None, }, ], diff --git a/vendor/tinywallet b/vendor/tinywallet index f1be2d7ab2e..522121a4512 160000 --- a/vendor/tinywallet +++ b/vendor/tinywallet @@ -1 +1 @@ -Subproject commit f1be2d7ab2e0c58a71e0be4f8d2daf5384920d35 +Subproject commit 522121a451241691bc5f2c8f8d63928b2f0d949f From 60179810a5d70c106a39792d8a64f62925d40a66 Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Wed, 11 Nov 2026 01:59:44 +0300 Subject: [PATCH 03/19] chore(wallet): update pinned library checksums to TinyWallet v0.29.0 Refresh the embedded library checksums for all 17 archives to match the registry-pinned TinyWallet v0.29.0 release, so each library is trusted only while its archive checksum remains pinned in the supplied ModuleRecord. Auto-committed-on: macbook Co-authored-by: Medulla --- crates/openhuman-core/src/modules/wallet.rs | 70 ++++++++++----------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/crates/openhuman-core/src/modules/wallet.rs b/crates/openhuman-core/src/modules/wallet.rs index a27f187dd3c..ad9da5490f7 100644 --- a/crates/openhuman-core/src/modules/wallet.rs +++ b/crates/openhuman-core/src/modules/wallet.rs @@ -378,93 +378,93 @@ async fn attested_proxy(config: &Config) -> Result Date: Wed, 11 Nov 2026 01:59:54 +0300 Subject: [PATCH 04/19] test(wallet): update pinned attestation digest to current release The expected digest for the current attested Linux release library was refreshed to match the newly published build, and the previous digest was added to the list of values that must not be accepted. Auto-committed-on: macbook Co-authored-by: Medulla --- crates/openhuman-core/src/modules/wallet_tests.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/openhuman-core/src/modules/wallet_tests.rs b/crates/openhuman-core/src/modules/wallet_tests.rs index e9eba38984c..1e6383feba4 100644 --- a/crates/openhuman-core/src/modules/wallet_tests.rs +++ b/crates/openhuman-core/src/modules/wallet_tests.rs @@ -177,7 +177,7 @@ mod attestation_guard { fn the_current_attested_linux_release_library_is_accepted() { assert!(digest_is_pinned( record(), - "92d024c6be951824070c80fdcd44661e2f47a812fd82c247a16a810680075b31" + "ca77309f2d5cdb6d13e56cb7fc44145507a333f55c6a31729979a2782a4ab3ae" )); } @@ -191,6 +191,7 @@ mod attestation_guard { "1e38209820ffa41857adfc32c322871bee30eec6bfc02dfae46eb7d9f6013def", "fd310805c667794548fae37a7f9ceb324185c7a46b6eefc30a7ea82fc428c254", "8fee5f20bd58505eb2a291e565d9c83928f4418d5c114413baf55613e0120baf", + "ca77309f2d5cdb6d13e56cb7fc44145507a333f55c6a31729979a2782a4ab3ae", ] { assert!(!digest_is_pinned(record(), digest)); } @@ -202,7 +203,7 @@ mod attestation_guard { assets: &[], ..*record() }; - let current_library = "92d024c6be951824070c80fdcd44661e2f47a812fd82c247a16a810680075b31"; + let current_library = "ca77309f2d5cdb6d13e56cb7fc44145507a333f55c6a31729979a2782a4ab3ae"; assert!(digest_is_pinned(record(), current_library)); assert!(!digest_is_pinned(&unpinned_record, current_library)); } From 467c2e2b5049f652f348fd603879fb5db4cf3f9f Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Wed, 11 Nov 2026 02:00:02 +0300 Subject: [PATCH 05/19] test(wallet): update pinned digest fixture Replace one of the digests in the attestation guard test's list of non-pinned hashes so the fixture no longer collides with a pinned value. Auto-committed-on: macbook Co-authored-by: Medulla --- crates/openhuman-core/src/modules/wallet_tests.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/openhuman-core/src/modules/wallet_tests.rs b/crates/openhuman-core/src/modules/wallet_tests.rs index 1e6383feba4..73b0eab1f9b 100644 --- a/crates/openhuman-core/src/modules/wallet_tests.rs +++ b/crates/openhuman-core/src/modules/wallet_tests.rs @@ -191,7 +191,7 @@ mod attestation_guard { "1e38209820ffa41857adfc32c322871bee30eec6bfc02dfae46eb7d9f6013def", "fd310805c667794548fae37a7f9ceb324185c7a46b6eefc30a7ea82fc428c254", "8fee5f20bd58505eb2a291e565d9c83928f4418d5c114413baf55613e0120baf", - "ca77309f2d5cdb6d13e56cb7fc44145507a333f55c6a31729979a2782a4ab3ae", + "92d024c6be951824070c80fdcd44661e2f47a812fd82c247a16a810680075b31", ] { assert!(!digest_is_pinned(record(), digest)); } From 0f3a9ae612442598a02d15a5e38856999da08d7f Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Wed, 11 Nov 2026 02:00:25 +0300 Subject: [PATCH 06/19] test(registry): update tinywallet manifest expectations to v0.29.0 Bump the pinned version, contract version, release URL, artifact filenames, and checksums in the registry test to match the verified v0.29.0 release manifest. Auto-committed-on: macbook Co-authored-by: Medulla --- .../src/modules/registry_tests.rs | 76 +++++++++---------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/crates/openhuman-core/src/modules/registry_tests.rs b/crates/openhuman-core/src/modules/registry_tests.rs index 8ea7598ddfa..794e3ae3605 100644 --- a/crates/openhuman-core/src/modules/registry_tests.rs +++ b/crates/openhuman-core/src/modules/registry_tests.rs @@ -9,14 +9,14 @@ mod release_manifest_tests; #[test] #[cfg(feature = "web3")] -fn tinywallet_registry_matches_the_verified_v0280_release_manifest() { +fn tinywallet_registry_matches_the_verified_v0290_release_manifest() { let wallet = find("tinywallet").expect("compiled TinyWallet module"); - assert_eq!(wallet.version, "0.28.0"); + assert_eq!(wallet.version, "0.29.0"); #[cfg(feature = "web3")] - assert_eq!(tinywallet_bus::CONTRACT_VERSION, (1, 14)); + assert_eq!(tinywallet_bus::CONTRACT_VERSION, (1, 15)); assert_eq!( wallet.release_url, - "https://github.com/tinyhumansai/tinywallet/releases/tag/v0.28.0" + "https://github.com/tinyhumansai/tinywallet/releases/tag/v0.29.0" ); let mut actual = wallet @@ -28,88 +28,88 @@ fn tinywallet_registry_matches_the_verified_v0280_release_manifest() { let mut published = [ ( "archlinux-arm64", - "tinywallet-module-0.28.0-archlinux-arm64.tar.gz", - "da90ff7b53c2a229896d5a4ab0e3121727488f37a78551b3207a9c78bc4a09a6", + "tinywallet-module-0.29.0-archlinux-arm64.tar.gz", + "90d8cb352a9d6b6403549f053446139c0361d36354ca7c37e0bc0296eb544cae", ), ( "archlinux-x86_64", - "tinywallet-module-0.28.0-archlinux-x86_64.tar.gz", - "1e80c400e50643d938e25b45aa0327de170f66f39fe65645a9d5ccb31b5f4a88", + "tinywallet-module-0.29.0-archlinux-x86_64.tar.gz", + "8e9bc6e2d443807cbbb1759cb85896abbcc0d3294a0ec58007fe0c56aecb5a25", ), ( "fedora-43-arm64", - "tinywallet-module-0.28.0-fedora-43-arm64.tar.gz", - "fb2b630ae47e64bd10a975861e647a939bfaa55b664c8f0706cd096779d62c3b", + "tinywallet-module-0.29.0-fedora-43-arm64.tar.gz", + "71e8ec37af5be258c111169e441fed5f4a46d9b3934c477569ec1185ec7ceba5", ), ( "fedora-43-x86_64", - "tinywallet-module-0.28.0-fedora-43-x86_64.tar.gz", - "84cc92b8775d26def86ad5073ed7315a50aae4b5aa7134a1cf485b923a32c38b", + "tinywallet-module-0.29.0-fedora-43-x86_64.tar.gz", + "3e7438212776adbe82a54a5c48ff744cd26ee73d0dee66bce7de42b968608a16", ), ( "fedora-44-arm64", - "tinywallet-module-0.28.0-fedora-44-arm64.tar.gz", - "14a1f4a044a7e5b246aa2df7209c31c165bf1305b38d888a540c2e438c11e202", + "tinywallet-module-0.29.0-fedora-44-arm64.tar.gz", + "7612aeeca130c741b38673279268494e0cf49891dd95574e14310e64634a6840", ), ( "fedora-44-x86_64", - "tinywallet-module-0.28.0-fedora-44-x86_64.tar.gz", - "d550966866d4b3446abef6f3b19fcf6968d914579a445c8b08fff276465b9029", + "tinywallet-module-0.29.0-fedora-44-x86_64.tar.gz", + "9807227a79989d6c17be18212462751e244fb1b5f2bbe1224e0054b3f37cc188", ), ( "macos-15-arm64", - "tinywallet-module-0.28.0-macos-15-arm64.tar.gz", - "c8c791b7464f1db2c6395f286cf63727b24bacb7606e318bb7dad5fa120387e1", + "tinywallet-module-0.29.0-macos-15-arm64.tar.gz", + "228b25d3ea7869436cf009bc228dc94f8f40fcf1d7ea81c622651c14b6bbc216", ), ( "macos-15-x86_64", - "tinywallet-module-0.28.0-macos-15-x86_64.tar.gz", - "b72c5f5b979302599b3a4f85b6783bd753c119e23ade819c0b1edf9ffd01d729", + "tinywallet-module-0.29.0-macos-15-x86_64.tar.gz", + "0b173d7ebed6ce23c7224a55a32c9b9716471a054119b02869abc2add15dc391", ), ( "macos-26-arm64", - "tinywallet-module-0.28.0-macos-26-arm64.tar.gz", - "b8d189befa3358f854346f3903187ef23b990b71d314a4a58539531c9212ca82", + "tinywallet-module-0.29.0-macos-26-arm64.tar.gz", + "61ee2de3ca95cea7f8253de3e47f4da9ae42bd4ac406c65374aaf4cd22b742f3", ), ( "macos-26-x86_64", - "tinywallet-module-0.28.0-macos-26-x86_64.tar.gz", - "9eb8990e3401b8c6d30ca08a434c64f56ff82e6bc1b6e160d27aae4d30a8c24f", + "tinywallet-module-0.29.0-macos-26-x86_64.tar.gz", + "5c7593c4bb15f806a83c25dee97e26bf86a73571046d6523164885804d0c9c7d", ), ( "ubuntu-22.04-arm64", - "tinywallet-module-0.28.0-ubuntu-22.04-arm64.tar.gz", - "c753826827230d2ebcb044eeae91f96d1f08d945f1ef37b26030ae0e0843d60c", + "tinywallet-module-0.29.0-ubuntu-22.04-arm64.tar.gz", + "54085d6e1391f98fb44b86735df0f147318502153c4d3e96c5586421835cb5aa", ), ( "ubuntu-22.04-x86_64", - "tinywallet-module-0.28.0-ubuntu-22.04-x86_64.tar.gz", - "02cec7d7e33112266b988be1bab6213b71193f7a183db8783dba941e62ef7b46", + "tinywallet-module-0.29.0-ubuntu-22.04-x86_64.tar.gz", + "4d2016fac3c2001dae9ff152dad91057741aa6c031093b10fce4a4f3e1654045", ), ( "ubuntu-24.04-arm64", - "tinywallet-module-0.28.0-ubuntu-24.04-arm64.tar.gz", - "5b8dc519829098029609e224b95b2149a71cdaad240148e33c0abac71ec5dc07", + "tinywallet-module-0.29.0-ubuntu-24.04-arm64.tar.gz", + "dedb29838c947d2da479c9998a38d772de875bd914eae0d0a8b81377bb7b894c", ), ( "ubuntu-24.04-x86_64", - "tinywallet-module-0.28.0-ubuntu-24.04-x86_64.tar.gz", - "c2bb2acd7c15b061b66d564db738aa3eac6802544fba753a6715ade541faac86", + "tinywallet-module-0.29.0-ubuntu-24.04-x86_64.tar.gz", + "74036ca124938a556687ff760d83fb3ad2eebb9e91a2a9cb93873a537f8e85a3", ), ( "windows-11-arm64", - "tinywallet-module-0.28.0-windows-11-arm64.zip", - "02598b083ce4d7e66c6d295785b5b42535861614741b2371462847760bbd2823", + "tinywallet-module-0.29.0-windows-11-arm64.zip", + "5fd451a1166e64af8f5936239f22ca88deadb6ff96058e7b9295887fa8315999", ), ( "windows-2022-x86_64", - "tinywallet-module-0.28.0-windows-2022-x86_64.zip", - "fdf15c140e0de0492fb0fde449e38e8eef0653cc7af6ebbe71c56218f5d33c17", + "tinywallet-module-0.29.0-windows-2022-x86_64.zip", + "b272c66ade706b7cb3c443fbd05c549abc2ef024f044b1cdfeba19f61367db78", ), ( "windows-2025-x86_64", - "tinywallet-module-0.28.0-windows-2025-x86_64.zip", - "a89031486e2aeb8f2f96fc314a5a291ebc4364e3b34dcdcd6a010b1a939b365e", + "tinywallet-module-0.29.0-windows-2025-x86_64.zip", + "2a6b49b81af30bbe6975c7274a9c2f8cef2a3bde10a3cebae1f4c8b9c1bf5333", ), ]; actual.sort_unstable(); From 018fb2b34f79e62498ca8cd14e19a8f1973dabcf Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Wed, 11 Nov 2026 02:00:48 +0300 Subject: [PATCH 07/19] chore(deps): bump tinywallet crates to 0.29.0 Update the lockfiles to pick up the 0.29.0 release of the tinywallet crates, including tinywallet-bus in the openhuman-app lockfile. Auto-committed-on: macbook Co-authored-by: Medulla --- Cargo.lock | 12 ++++++------ crates/openhuman-app/Cargo.lock | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8775d95797c..2a80b6648c9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10718,7 +10718,7 @@ dependencies = [ [[package]] name = "tinywallet" -version = "0.28.0" +version = "0.29.0" dependencies = [ "bitcoin", "bs58", @@ -10740,7 +10740,7 @@ dependencies = [ [[package]] name = "tinywallet-bus" -version = "0.28.0" +version = "0.29.0" dependencies = [ "serde", "serde_json", @@ -10749,7 +10749,7 @@ dependencies = [ [[package]] name = "tinywallet-crypto" -version = "0.28.0" +version = "0.29.0" dependencies = [ "async-trait", "bech32 0.12.0", @@ -10765,7 +10765,7 @@ dependencies = [ [[package]] name = "tinywallet-module" -version = "0.28.0" +version = "0.29.0" dependencies = [ "async-trait", "bitcoin", @@ -10794,7 +10794,7 @@ dependencies = [ [[package]] name = "tinywallet-web3" -version = "0.28.0" +version = "0.29.0" dependencies = [ "async-trait", "base64 0.23.1", @@ -10813,7 +10813,7 @@ dependencies = [ [[package]] name = "tinywallet-x402" -version = "0.28.0" +version = "0.29.0" dependencies = [ "async-trait", "base64 0.23.1", diff --git a/crates/openhuman-app/Cargo.lock b/crates/openhuman-app/Cargo.lock index 51c40591394..62753fff337 100644 --- a/crates/openhuman-app/Cargo.lock +++ b/crates/openhuman-app/Cargo.lock @@ -8501,7 +8501,7 @@ dependencies = [ [[package]] name = "tinywallet-bus" -version = "0.28.0" +version = "0.29.0" dependencies = [ "serde", "serde_json", From 4434c4969893072658a328dfb6ec5d29edd29d5b Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Wed, 11 Nov 2026 02:00:57 +0300 Subject: [PATCH 08/19] chore(deps): bump tinysearch-bus to 0.5.7 Update the locked tinysearch-bus dependency from 0.5.6 to 0.5.7 in the app's Cargo.lock. Auto-committed-on: macbook Co-authored-by: Medulla --- crates/openhuman-app/Cargo.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/openhuman-app/Cargo.lock b/crates/openhuman-app/Cargo.lock index 62753fff337..22561d6808a 100644 --- a/crates/openhuman-app/Cargo.lock +++ b/crates/openhuman-app/Cargo.lock @@ -8215,7 +8215,7 @@ dependencies = [ [[package]] name = "tinysearch-bus" -version = "0.5.6" +version = "0.5.7" dependencies = [ "schemars 1.2.3", "serde", From ff9275874cca632e1f3220b0b1bd9d60ce746609 Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Wed, 11 Nov 2026 02:18:19 +0300 Subject: [PATCH 09/19] refactor(web3): extract balances tool result helper for testing Moved the wallet balances tool's response construction into a reusable balances_tool_result function so the success and error paths can be exercised directly. Tests now cover native rows alongside tokens, a failed token read that preserves native balances, and a failed native read that surfaces as a tool error. Auto-committed-on: macbook Co-authored-by: Medulla --- .../src/web3/wallet/automation_tools.rs | 17 +++++-- .../src/web3/wallet/automation_tools_tests.rs | 48 +++++++++++++++++-- 2 files changed, 57 insertions(+), 8 deletions(-) diff --git a/crates/openhuman-core/src/web3/wallet/automation_tools.rs b/crates/openhuman-core/src/web3/wallet/automation_tools.rs index 886d5c00c2f..dae0cc0f583 100644 --- a/crates/openhuman-core/src/web3/wallet/automation_tools.rs +++ b/crates/openhuman-core/src/web3/wallet/automation_tools.rs @@ -71,10 +71,19 @@ impl Tool for WalletBalancesTool { let tokens = super::token_balances(&ctx) .await .map(|outcome| outcome.value); - match combine_balances(native, tokens) { - Ok(value) => Ok(ToolResult::success(serde_json::to_string_pretty(&value)?)), - Err(error) => Ok(ToolResult::error(error)), - } + balances_tool_result(native, tokens) + } +} + +/// The tool's answer for the two reads: the combined JSON on success, a tool +/// error when the native read itself failed. +pub(crate) fn balances_tool_result( + native: Result, String>, + tokens: Result, String>, +) -> anyhow::Result { + match combine_balances(native, tokens) { + Ok(value) => Ok(ToolResult::success(serde_json::to_string_pretty(&value)?)), + Err(error) => Ok(ToolResult::error(error)), } } diff --git a/crates/openhuman-core/src/web3/wallet/automation_tools_tests.rs b/crates/openhuman-core/src/web3/wallet/automation_tools_tests.rs index df151c9c458..7f1771c2978 100644 --- a/crates/openhuman-core/src/web3/wallet/automation_tools_tests.rs +++ b/crates/openhuman-core/src/web3/wallet/automation_tools_tests.rs @@ -86,10 +86,41 @@ fn token_row(raw: &str) -> super::super::TokenBalanceInfo { } } +fn native_rows() -> Vec { + vec![ + super::super::BalanceInfo { + chain: tinywallet_bus::wire::WalletChain::Solana, + evm_network: None, + address: "Owner".into(), + asset_symbol: "SOL".into(), + decimals: 9, + raw: "2500000000".into(), + formatted: "2.500000000".into(), + provider_status: super::super::ProviderStatus::Ready, + }, + super::super::BalanceInfo { + chain: tinywallet_bus::wire::WalletChain::Evm, + evm_network: Some(tinywallet_bus::wire::EvmNetwork::Base), + address: "0xOwner".into(), + asset_symbol: "ETH".into(), + decimals: 18, + raw: "0".into(), + formatted: "0".into(), + provider_status: super::super::ProviderStatus::Missing, + }, + ] +} + +fn tool_json(result: &ToolResult) -> Value { + assert!(!result.is_error, "unexpected tool error: {}", result.output()); + serde_json::from_str(&result.output()).expect("the tool answers with JSON") +} + #[test] fn balances_tool_returns_native_and_token_rows_together() { - let value = combine_balances(Ok(Vec::new()), Ok(vec![token_row("1500000")])).unwrap(); - assert_eq!(value["native"], json!([])); + let result = balances_tool_result(Ok(native_rows()), Ok(vec![token_row("1500000")])).unwrap(); + let value = tool_json(&result); + assert_eq!(value["native"], json!(native_rows())); assert_eq!(value["tokens"][0]["assetSymbol"], "USDC"); assert_eq!(value["tokens"][0]["raw"], "1500000"); assert!(value.get("tokensError").is_none()); @@ -97,8 +128,17 @@ fn balances_tool_returns_native_and_token_rows_together() { #[test] fn a_failed_token_read_keeps_the_native_balances_and_says_why() { - let value = combine_balances(Ok(Vec::new()), Err("module too old".into())).unwrap(); + let result = balances_tool_result(Ok(native_rows()), Err("module too old".into())).unwrap(); + let value = tool_json(&result); + assert_eq!(value["native"], json!(native_rows())); assert_eq!(value["tokens"], json!([])); assert_eq!(value["tokensError"], "module too old"); - assert!(combine_balances(Err("not configured".into()), Ok(Vec::new())).is_err()); +} + +#[test] +fn a_failed_native_read_is_a_tool_error_even_when_tokens_were_read() { + let result = + balances_tool_result(Err("not configured".into()), Ok(vec![token_row("1")])).unwrap(); + assert!(result.is_error); + assert!(result.output().contains("not configured")); } From df7fbbf19e5751f78ab9b8c5a59011850821c18a Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Wed, 11 Nov 2026 02:18:54 +0300 Subject: [PATCH 10/19] test(web3): update evm network variant in wallet automation tests Rename the test fixture's EVM network from Base to BaseMainnet to match the current wire enum variant. Auto-committed-on: macbook Co-authored-by: Medulla --- crates/openhuman-core/src/web3/wallet/automation_tools_tests.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/openhuman-core/src/web3/wallet/automation_tools_tests.rs b/crates/openhuman-core/src/web3/wallet/automation_tools_tests.rs index 7f1771c2978..13946d2c5db 100644 --- a/crates/openhuman-core/src/web3/wallet/automation_tools_tests.rs +++ b/crates/openhuman-core/src/web3/wallet/automation_tools_tests.rs @@ -100,7 +100,7 @@ fn native_rows() -> Vec { }, super::super::BalanceInfo { chain: tinywallet_bus::wire::WalletChain::Evm, - evm_network: Some(tinywallet_bus::wire::EvmNetwork::Base), + evm_network: Some(tinywallet_bus::wire::EvmNetwork::BaseMainnet), address: "0xOwner".into(), asset_symbol: "ETH".into(), decimals: 18, From ec5cfa81874cc5532f18abf0ba7836437a65b3ef Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Wed, 11 Nov 2026 02:19:32 +0300 Subject: [PATCH 11/19] test(wallet): cover token balances in json-rpc e2e Extend the wallet execution surface round-trip test to call openhuman.wallet_token_balances and assert the single USDC row for the Solana account, including its chain, symbol, decimals and decimal-only raw amount. A formatting-only tweak in the automation tool tests keeps the assertion readable. Auto-committed-on: macbook Co-authored-by: Medulla --- .../src/web3/wallet/automation_tools_tests.rs | 6 ++++- tests/json_rpc_wallet_e2e.rs | 27 +++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/crates/openhuman-core/src/web3/wallet/automation_tools_tests.rs b/crates/openhuman-core/src/web3/wallet/automation_tools_tests.rs index 13946d2c5db..7fdf721bd8c 100644 --- a/crates/openhuman-core/src/web3/wallet/automation_tools_tests.rs +++ b/crates/openhuman-core/src/web3/wallet/automation_tools_tests.rs @@ -112,7 +112,11 @@ fn native_rows() -> Vec { } fn tool_json(result: &ToolResult) -> Value { - assert!(!result.is_error, "unexpected tool error: {}", result.output()); + assert!( + !result.is_error, + "unexpected tool error: {}", + result.output() + ); serde_json::from_str(&result.output()).expect("the tool answers with JSON") } diff --git a/tests/json_rpc_wallet_e2e.rs b/tests/json_rpc_wallet_e2e.rs index bc5dfded4e9..09d6852c1ed 100644 --- a/tests/json_rpc_wallet_e2e.rs +++ b/tests/json_rpc_wallet_e2e.rs @@ -310,6 +310,33 @@ async fn json_rpc_wallet_execution_surface_round_trips() { ); } + // token_balances: the module reads the catalogued USDC mint for the one + // Solana account. The mock answers no SPL accounts, so the amount may be + // zero or marked missing, but the row and its shape must arrive. + let tokens = post_json_rpc( + &rpc_base, + 2104, + "openhuman.wallet_token_balances", + json!({}), + ) + .await; + let body = assert_no_jsonrpc_error(&tokens, "wallet_token_balances"); + let result = body.get("result").unwrap_or(body); + let token_rows = result.as_array().expect("token balances array"); + assert_eq!( + token_rows.len(), + 1, + "one USDC row for the Solana account: {result}" + ); + assert_eq!(token_rows[0]["chain"], "solana"); + assert_eq!(token_rows[0]["assetSymbol"], "USDC"); + assert_eq!(token_rows[0]["decimals"], 6); + let raw = token_rows[0]["raw"].as_str().expect("raw present"); + assert!( + raw.chars().all(|c| c.is_ascii_digit()), + "raw must be decimal, got: {raw}" + ); + // prepare_transfer + execute_prepared (happy path). let prep = post_json_rpc( &rpc_base, From 1067efe9b795f423a7a0749dcf58156b4b45539b Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Wed, 11 Nov 2026 02:41:32 +0300 Subject: [PATCH 12/19] test(web3): cover transport errors not leaking endpoint urls Add tests asserting that JSON-RPC and REST transport failures omit the endpoint URL, so API keys embedded in the path or query string cannot surface in error messages. Auto-committed-on: macbook Co-authored-by: Medulla --- .../src/web3/wallet/rpc_tests.rs | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/crates/openhuman-core/src/web3/wallet/rpc_tests.rs b/crates/openhuman-core/src/web3/wallet/rpc_tests.rs index 19e28c2637b..2ab77056177 100644 --- a/crates/openhuman-core/src/web3/wallet/rpc_tests.rs +++ b/crates/openhuman-core/src/web3/wallet/rpc_tests.rs @@ -12,3 +12,43 @@ fn redact_rpc_url_strips_path_and_query() { fn redact_rpc_url_handles_invalid_values() { assert_eq!(redact_rpc_url("not a url"), ""); } + +/// A port nothing listens on, so every request fails in transport. +fn refused_endpoint(path: &str) -> String { + let listener = std::net::TcpListener::bind("127.0.0.1:0").expect("bind"); + let port = listener.local_addr().expect("addr").port(); + drop(listener); + format!("http://127.0.0.1:{port}{path}") +} + +const KEYED_PATH: &str = "/v2/secret-path-key?api-key=secret-query-key"; + +fn assert_no_endpoint_secret(error: &str) { + assert!(error.contains("transport failed"), "unexpected error: {error}"); + assert!( + !error.contains("secret-query-key") && !error.contains("secret-path-key"), + "a transport error must not carry the endpoint URL: {error}" + ); +} + +#[tokio::test] +async fn a_json_rpc_transport_error_does_not_carry_the_endpoint_url() { + let error = rpc_call_to::( + &refused_endpoint(KEYED_PATH), + "getTokenAccountsByOwner", + serde_json::json!([]), + ) + .await + .unwrap_err(); + assert_no_endpoint_secret(&error); +} + +#[tokio::test] +async fn a_rest_transport_error_does_not_carry_the_endpoint_url() { + assert_no_endpoint_secret(&rest_get_text(&refused_endpoint(KEYED_PATH)).await.unwrap_err()); + assert_no_endpoint_secret( + &rest_post_text(&refused_endpoint(KEYED_PATH), "00", "text/plain") + .await + .unwrap_err(), + ); +} From 837771b1de43da94df8aeb4e35d2cb449bee993a Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Wed, 11 Nov 2026 02:41:40 +0300 Subject: [PATCH 13/19] test(web3): import rpc helpers in wallet rpc tests Extend the test module's imports to bring in the REST and RPC call helpers alongside the existing redaction helper, so upcoming tests can exercise them. Auto-committed-on: macbook Co-authored-by: Medulla --- crates/openhuman-core/src/web3/wallet/rpc_tests.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/openhuman-core/src/web3/wallet/rpc_tests.rs b/crates/openhuman-core/src/web3/wallet/rpc_tests.rs index 2ab77056177..a22de723370 100644 --- a/crates/openhuman-core/src/web3/wallet/rpc_tests.rs +++ b/crates/openhuman-core/src/web3/wallet/rpc_tests.rs @@ -1,4 +1,4 @@ -use super::redact_rpc_url; +use super::{redact_rpc_url, rest_get_text, rest_post_text, rpc_call_to}; #[test] fn redact_rpc_url_strips_path_and_query() { From 92673e02231713151bfff372e630c4cec899174f Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Wed, 11 Nov 2026 02:41:58 +0300 Subject: [PATCH 14/19] fix(wallet): return native balance error before token read The balances tool now short-circuits when the native balance read fails, returning that error immediately instead of holding the wallet service lock through a slow token provider. The module record is bumped to the pinned v0.29.0 release (contract 1.15) to pick up the SPL token-balance read, and the wallet docs describe the `{native, tokens}` result shape and `tokensError` field. Auto-committed-on: macbook Co-authored-by: Medulla --- .../src/modules/registry/records_docs_wallet.rs | 5 +++-- .../src/web3/wallet/automation_tools.rs | 10 ++++++++-- crates/openhuman-core/src/web3/wallet/rpc_tests.rs | 11 +++++++++-- docs/gitbooks/en/features/wallet.md | 2 +- 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/crates/openhuman-core/src/modules/registry/records_docs_wallet.rs b/crates/openhuman-core/src/modules/registry/records_docs_wallet.rs index 1fbc3e776ee..a2bbe364bcc 100644 --- a/crates/openhuman-core/src/modules/registry/records_docs_wallet.rs +++ b/crates/openhuman-core/src/modules/registry/records_docs_wallet.rs @@ -116,8 +116,9 @@ pub(crate) const TINYDOCS: ModuleRecord = ModuleRecord { /// The contract also exposes `ExportKey` for downstream hosts that must drive /// a signer locally; OpenHuman itself does not call it. /// -/// The pinned v0.26.0 release (contract 1.14) carries the native wallet, Web3, -/// and x402 bus operations, including mnemonic word-count validation. Secret-bearing +/// The pinned v0.29.0 release (contract 1.15) carries the native wallet, Web3, +/// and x402 bus operations, including mnemonic word-count validation and the +/// `NativeWalletTokenBalances` SPL token-balance read. Secret-bearing /// operations remain confidential and require both attestation and a matching /// pinned digest. pub(crate) const TINYWALLET: ModuleRecord = ModuleRecord { diff --git a/crates/openhuman-core/src/web3/wallet/automation_tools.rs b/crates/openhuman-core/src/web3/wallet/automation_tools.rs index dae0cc0f583..5b5bbbe3d4d 100644 --- a/crates/openhuman-core/src/web3/wallet/automation_tools.rs +++ b/crates/openhuman-core/src/web3/wallet/automation_tools.rs @@ -67,11 +67,17 @@ impl Tool for WalletBalancesTool { context: Option<&dyn tinytools::ToolRunContext>, ) -> anyhow::Result { let ctx = crate::agent::tinyagents::host::run_context::dispatch_ctx_for_tool(context); - let native = super::balances(&ctx).await.map(|outcome| outcome.value); + // A failed native read is the tool's answer on its own: return it before + // the token read, which would otherwise hold the wallet service lock + // and delay the error behind a slow token provider. + let native = match super::balances(&ctx).await { + Ok(outcome) => outcome.value, + Err(error) => return balances_tool_result(Err(error), Ok(Vec::new())), + }; let tokens = super::token_balances(&ctx) .await .map(|outcome| outcome.value); - balances_tool_result(native, tokens) + balances_tool_result(Ok(native), tokens) } } diff --git a/crates/openhuman-core/src/web3/wallet/rpc_tests.rs b/crates/openhuman-core/src/web3/wallet/rpc_tests.rs index a22de723370..473798d95c9 100644 --- a/crates/openhuman-core/src/web3/wallet/rpc_tests.rs +++ b/crates/openhuman-core/src/web3/wallet/rpc_tests.rs @@ -24,7 +24,10 @@ fn refused_endpoint(path: &str) -> String { const KEYED_PATH: &str = "/v2/secret-path-key?api-key=secret-query-key"; fn assert_no_endpoint_secret(error: &str) { - assert!(error.contains("transport failed"), "unexpected error: {error}"); + assert!( + error.contains("transport failed"), + "unexpected error: {error}" + ); assert!( !error.contains("secret-query-key") && !error.contains("secret-path-key"), "a transport error must not carry the endpoint URL: {error}" @@ -45,7 +48,11 @@ async fn a_json_rpc_transport_error_does_not_carry_the_endpoint_url() { #[tokio::test] async fn a_rest_transport_error_does_not_carry_the_endpoint_url() { - assert_no_endpoint_secret(&rest_get_text(&refused_endpoint(KEYED_PATH)).await.unwrap_err()); + assert_no_endpoint_secret( + &rest_get_text(&refused_endpoint(KEYED_PATH)) + .await + .unwrap_err(), + ); assert_no_endpoint_secret( &rest_post_text(&refused_endpoint(KEYED_PATH), "00", "text/plain") .await diff --git a/docs/gitbooks/en/features/wallet.md b/docs/gitbooks/en/features/wallet.md index 0d3e0f21f85..0375ccaf074 100644 --- a/docs/gitbooks/en/features/wallet.md +++ b/docs/gitbooks/en/features/wallet.md @@ -83,7 +83,7 @@ The agent reaches the wallet through eight tools: | --- | --- | | `wallet_status` | Onboarding status and account addresses. | | `wallet_chain_status` | Per-chain readiness and active RPC. | -| `wallet_balances` | Live native and token (USDC on Solana) balances. | +| `wallet_balances` | Live native and token (USDC on Solana) balances, as `{native, tokens}`. If the token read fails, `tokens` is empty and `tokensError` says why; the native rows are still returned. | | `wallet_prepare_transfer` | Build a validated, fee-estimated quote. | | `wallet_execute_prepared` | Execute a prepared quote, only within the spend policy. | | `wallet_tx_status` | Transaction lifecycle state by hash. | From c25072a0419bd6e2003c3b5c2ad5a5fa635bad2d Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Wed, 11 Nov 2026 02:42:13 +0300 Subject: [PATCH 15/19] docs(wallet): document wallet_balances token error shape Clarify in the wallet README that `wallet_balances` returns native and token balances as `{native, tokens}`, and that a `tokensError` field appears alongside the native rows when only the token read fails. Auto-committed-on: macbook Co-authored-by: Medulla --- crates/openhuman-core/src/web3/wallet/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/openhuman-core/src/web3/wallet/README.md b/crates/openhuman-core/src/web3/wallet/README.md index 77e77c29248..14bde8cd955 100644 --- a/crates/openhuman-core/src/web3/wallet/README.md +++ b/crates/openhuman-core/src/web3/wallet/README.md @@ -61,7 +61,9 @@ The six established wallet tools are declared in `tinywallet-bus` and adapted in `tools.rs`: `wallet_status`, `wallet_chain_status`, `wallet_prepare_transfer`, `wallet_tx_status`, `wallet_tx_receipt`, and `wallet_lookup_tx`. `automation_tools.rs` adds two policy-bound tools: -`wallet_balances` (the module's native and token balances) and `wallet_execute_prepared` +`wallet_balances` (the module's native and token balances as `{native, tokens}`, +with `tokensError` beside the native rows when only the token read fails) and +`wallet_execute_prepared` (an execute through the spend policy below). ## Spend policy and ledger From b5422009a4757233d0d0bdc3241fd79ffda1cb07 Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Wed, 11 Nov 2026 02:48:24 +0300 Subject: [PATCH 16/19] fix(web3): redact request urls from wallet rpc error messages Wallet RPC and REST error paths now format reqwest errors with without_url() so that request URLs, which can embed API keys or other credentials, are not leaked into logs or surfaced error strings. Auto-committed-on: macbook Co-authored-by: Medulla --- crates/openhuman-core/src/web3/wallet/rpc.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/openhuman-core/src/web3/wallet/rpc.rs b/crates/openhuman-core/src/web3/wallet/rpc.rs index 9bb596d9c8b..cffd216c368 100644 --- a/crates/openhuman-core/src/web3/wallet/rpc.rs +++ b/crates/openhuman-core/src/web3/wallet/rpc.rs @@ -78,11 +78,11 @@ async fn rpc_call_to_inner( ); let client = client(); let response = client.post(url).json(&payload).send().await.map_err(|e| { - RpcCallError::Transport(format!("wallet RPC transport failed for {method}: {e}")) + RpcCallError::Transport(format!("wallet RPC transport failed for {method}: {}", e.without_url())) })?; let status = response.status(); let raw_body = response.text().await.map_err(|e| { - RpcCallError::Transport(format!("wallet RPC read body failed for {method}: {e}")) + RpcCallError::Transport(format!("wallet RPC read body failed for {method}: {}", e.without_url())) })?; log::debug!( "{LOG_PREFIX} jsonrpc method={method} status={status} body_len={}", @@ -118,12 +118,12 @@ pub async fn rest_get_text(url: &str) -> Result { .get(url) .send() .await - .map_err(|e| format!("wallet REST GET transport failed: {e}"))?; + .map_err(|e| format!("wallet REST GET transport failed: {}", e.without_url()))?; let status = response.status(); let body = response .text() .await - .map_err(|e| format!("wallet REST GET read body failed: {e}"))?; + .map_err(|e| format!("wallet REST GET read body failed: {}", e.without_url()))?; if !status.is_success() { return Err(format!( "wallet REST GET HTTP failure: status={status} body={body}" @@ -145,12 +145,12 @@ pub async fn rest_post_text(url: &str, body: &str, content_type: &str) -> Result .body(body.to_string()) .send() .await - .map_err(|e| format!("wallet REST POST transport failed: {e}"))?; + .map_err(|e| format!("wallet REST POST transport failed: {}", e.without_url()))?; let status = response.status(); let text = response .text() .await - .map_err(|e| format!("wallet REST POST read body failed: {e}"))?; + .map_err(|e| format!("wallet REST POST read body failed: {}", e.without_url()))?; if !status.is_success() { return Err(format!( "wallet REST POST HTTP failure: status={status} body={text}" From 08f4ecfeb8ab76dd584e0faf1613f329bc699570 Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Wed, 11 Nov 2026 02:55:21 +0300 Subject: [PATCH 17/19] style(web3): reformat wallet rpc error formatting Reformatted the transport and body-read error construction in the wallet RPC helper to wrap the format! calls across multiple lines, matching the project's rustfmt style. No behaviour change. Auto-committed-on: macbook Co-authored-by: Medulla --- crates/openhuman-core/src/web3/wallet/rpc.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/crates/openhuman-core/src/web3/wallet/rpc.rs b/crates/openhuman-core/src/web3/wallet/rpc.rs index cffd216c368..2fae57a670f 100644 --- a/crates/openhuman-core/src/web3/wallet/rpc.rs +++ b/crates/openhuman-core/src/web3/wallet/rpc.rs @@ -78,11 +78,17 @@ async fn rpc_call_to_inner( ); let client = client(); let response = client.post(url).json(&payload).send().await.map_err(|e| { - RpcCallError::Transport(format!("wallet RPC transport failed for {method}: {}", e.without_url())) + RpcCallError::Transport(format!( + "wallet RPC transport failed for {method}: {}", + e.without_url() + )) })?; let status = response.status(); let raw_body = response.text().await.map_err(|e| { - RpcCallError::Transport(format!("wallet RPC read body failed for {method}: {}", e.without_url())) + RpcCallError::Transport(format!( + "wallet RPC read body failed for {method}: {}", + e.without_url() + )) })?; log::debug!( "{LOG_PREFIX} jsonrpc method={method} status={status} body_len={}", From db50bcdfc0ea8ac1e49ed77c04dab486cbd0b4ac Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Wed, 11 Nov 2026 02:57:16 +0300 Subject: [PATCH 18/19] feat(wallet): add token balances to wallet tool and log read outcomes The wallet_balances tool now logs native and token read results, warning when the token read fails so native rows are still returned with a tokensError. The capability catalog description and how_to were updated to mention token_balances and USDC on Solana. Auto-committed-on: macbook Co-authored-by: Medulla --- .../about_app/catalog_workflows_automation.rs | 4 ++-- .../src/web3/wallet/automation_tools.rs | 16 +++++++++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/crates/openhuman-core/src/platform/about_app/catalog_workflows_automation.rs b/crates/openhuman-core/src/platform/about_app/catalog_workflows_automation.rs index af51e44f002..7cbfd462d86 100644 --- a/crates/openhuman-core/src/platform/about_app/catalog_workflows_automation.rs +++ b/crates/openhuman-core/src/platform/about_app/catalog_workflows_automation.rs @@ -187,8 +187,8 @@ Capability { name: "Wallet Execution Tools", domain: "wallet", category: CapabilityCategory::Workflows, - description: "Read addresses and balances, prepare/confirm/execute native + token transfers (ERC20/SPL/TRC20/BEP20), and inspect transactions (status, receipt, lookup) across the connected wallet (EVM, BTC, Solana, Tron). Quote-first; signing stays local. Agent and automated executes run inside the [wallet_policy] spend policy (asset allowlist, per-transaction, rolling-day and per-recipient weekly caps) and are recorded in a persistent ledger. Switched off by [components] wallet = false, which answers COMPONENT_DISABLED:wallet and leaves keychain material, spending limits and RPC endpoints untouched.", - how_to: "Use wallet.* RPC methods (balances, prepare_transfer, execute_prepared, tx_status, tx_receipt, lookup_tx, policy_get, policy_update, ledger_list) via the agent or core_rpc_relay, or via Settings > Crypto > Wallet Balances.", + description: "Read addresses, native balances and token balances (USDC on Solana, via wallet.token_balances), prepare/confirm/execute native + token transfers (ERC20/SPL/TRC20/BEP20), and inspect transactions (status, receipt, lookup) across the connected wallet (EVM, BTC, Solana, Tron). Quote-first; signing stays local. Agent and automated executes run inside the [wallet_policy] spend policy (asset allowlist, per-transaction, rolling-day and per-recipient weekly caps) and are recorded in a persistent ledger. Switched off by [components] wallet = false, which answers COMPONENT_DISABLED:wallet and leaves keychain material, spending limits and RPC endpoints untouched.", + how_to: "Use wallet.* RPC methods (balances, token_balances, prepare_transfer, execute_prepared, tx_status, tx_receipt, lookup_tx, policy_get, policy_update, ledger_list) via the agent or core_rpc_relay, or via Settings > Crypto > Wallet Balances.", status: CapabilityStatus::Beta, privacy: LOCAL_CREDENTIALS, }, diff --git a/crates/openhuman-core/src/web3/wallet/automation_tools.rs b/crates/openhuman-core/src/web3/wallet/automation_tools.rs index 5b5bbbe3d4d..fbb5842d770 100644 --- a/crates/openhuman-core/src/web3/wallet/automation_tools.rs +++ b/crates/openhuman-core/src/web3/wallet/automation_tools.rs @@ -72,11 +72,25 @@ impl Tool for WalletBalancesTool { // and delay the error behind a slow token provider. let native = match super::balances(&ctx).await { Ok(outcome) => outcome.value, - Err(error) => return balances_tool_result(Err(error), Ok(Vec::new())), + Err(error) => { + tracing::warn!("[wallet:tool] wallet_balances native read failed"); + return balances_tool_result(Err(error), Ok(Vec::new())); + } }; let tokens = super::token_balances(&ctx) .await .map(|outcome| outcome.value); + match &tokens { + Ok(rows) => tracing::debug!( + native_rows = native.len(), + token_rows = rows.len(), + "[wallet:tool] wallet_balances read" + ), + Err(_) => tracing::warn!( + native_rows = native.len(), + "[wallet:tool] wallet_balances token read failed; returning native rows with tokensError" + ), + } balances_tool_result(Ok(native), tokens) } } From bd91886c74cb8b6a6d980051dd12c666bfc21064 Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Wed, 11 Nov 2026 03:20:18 +0300 Subject: [PATCH 19/19] docs(about_app): clarify wallet balances guidance in automation catalog The wallet capability's how-to text now states that Settings > Crypto > Wallet Balances shows native balances only, with token balances available through wallet.token_balances or the agent's wallet_balances tool, so users are not misled about where token data appears. Auto-committed-on: macbook Co-authored-by: Medulla --- .../src/platform/about_app/catalog_workflows_automation.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/openhuman-core/src/platform/about_app/catalog_workflows_automation.rs b/crates/openhuman-core/src/platform/about_app/catalog_workflows_automation.rs index 7cbfd462d86..1e02c09799d 100644 --- a/crates/openhuman-core/src/platform/about_app/catalog_workflows_automation.rs +++ b/crates/openhuman-core/src/platform/about_app/catalog_workflows_automation.rs @@ -188,7 +188,7 @@ Capability { domain: "wallet", category: CapabilityCategory::Workflows, description: "Read addresses, native balances and token balances (USDC on Solana, via wallet.token_balances), prepare/confirm/execute native + token transfers (ERC20/SPL/TRC20/BEP20), and inspect transactions (status, receipt, lookup) across the connected wallet (EVM, BTC, Solana, Tron). Quote-first; signing stays local. Agent and automated executes run inside the [wallet_policy] spend policy (asset allowlist, per-transaction, rolling-day and per-recipient weekly caps) and are recorded in a persistent ledger. Switched off by [components] wallet = false, which answers COMPONENT_DISABLED:wallet and leaves keychain material, spending limits and RPC endpoints untouched.", - how_to: "Use wallet.* RPC methods (balances, token_balances, prepare_transfer, execute_prepared, tx_status, tx_receipt, lookup_tx, policy_get, policy_update, ledger_list) via the agent or core_rpc_relay, or via Settings > Crypto > Wallet Balances.", + how_to: "Use wallet.* RPC methods (balances, token_balances, prepare_transfer, execute_prepared, tx_status, tx_receipt, lookup_tx, policy_get, policy_update, ledger_list) via the agent or core_rpc_relay. Settings > Crypto > Wallet Balances shows native balances only; token balances come from wallet.token_balances or the agent's wallet_balances tool.", status: CapabilityStatus::Beta, privacy: LOCAL_CREDENTIALS, },