r14 balance
Sync unspent notes with the indexer and display your balance.
Usage
r14 balance
What It Does
- Loads the wallet from
~/.r14/wallet.json. - For each unspent note without an on-chain index, queries
GET /v1/leaf/{commitment}on the indexer to check if it has been indexed. - Updates the wallet with any newly discovered on-chain indices.
- Saves the wallet.
- Displays total balance and per-note details.
Output
Notes with an index are shown as on-chain (green). Notes without an index are shown as local-only (yellow) - they haven't been confirmed on-chain or the indexer hasn't synced them yet.
With --json:
{
"balance": 2500,
"notes": [
{
"value": 1000,
"app_tag": 1,
"commitment": "0x1a2b...",
"index": 3,
"status": "on-chain"
},
{
"value": 1500,
"app_tag": 1,
"commitment": "0x3c4d...",
"index": null,
"status": "local-only"
}
]
}
Indexer Unreachable
If the indexer is unreachable, the command still shows the balance from local state. Notes that need syncing will remain as local-only until the indexer is available and the command is run again.