balance
Total balance held across EVERY vault this factory has tagged, by group id — all of them share one contractId. For the current vault's own holdings use currentVaultBalance. "Can I spend this right now?" is a separate question answered by filterInputs / markInterestingSpendable, not by balance.
The result is keyed by GroupId: the native Nexa entry under nativeCoinGroupId is always present (seeded to zero) so callers can read it without a null check; each group token that has ever been sent here gets its own entry on demand.
Per-UTXO accounting:
Confirmed (mined) UTXOs count toward both Balance.balance and Balance.confirmed.
Unconfirmed UTXOs from transactions this wallet broadcast (detected via TransactionHistory.outgoingAmt> 0) are trusted as our own and also count toward Balance.confirmed — we created and signed them.
Unconfirmed UTXOs from foreign transactions count only toward Balance.balance and Balance.unconfirmed.
Caveat: the "we created this tx" heuristic misclassifies atomic-exchange transactions where this wallet contributed an output but the incoming UTXO actually came from a counterparty.