balance

open override fun balance(): Map<GroupId, 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:

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.