get_btc_account_balance
Retrieve the total on-chain Bitcoin balance for a Ledger account by aggregating balances of all cached used addresses. Returns confirmed, mempool, and total sats/BTC with per-address breakdown.
Instructions
READ-ONLY — sum the on-chain balance across every cached USED address (txCount > 0 at last scan) for one Ledger Bitcoin account index. Walks the pairing cache populated by pair_ledger_btc's BIP44 gap-limit scan, fans out to the indexer for live balances, and returns both the rolled-up totals (confirmed + mempool + total sats / BTC) and a per-address breakdown including type, BIP-32 chain (0=receive, 1=change), and addressIndex. Skips empty cached entries (the trailing fresh-receive addresses) to keep fan-out tight. If the cache is stale (recent receive on a previously-empty cached address), call rescan_btc_account to refresh — pure indexer fetch, no Ledger needed. Only re-run pair_ledger_btc when funds may have landed PAST the originally-walked gap window (the rescan flags that case via needsExtend: true).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| accountIndex | Yes | Ledger Bitcoin account slot to aggregate. Must have been paired via `pair_ledger_btc` first — the tool fans out across every cached USED address (txCount > 0 at scan time) for this accountIndex, sums their on-chain balances, and surfaces the per-address breakdown so the agent can show which legs hold the funds. Empty cached addresses are skipped to keep the response tight; if you suspect the cache is stale, call `rescan_btc_account` (indexer-only, no Ledger needed). |