BalanceUpdatedEvent class

The wallet's balance changed: the read model applied an event that moved money, and these are the numbers it now holds (bead libspiffy-7ye4).

This event existed and nothing emitted it, so the only way an application could learn its balance had changed was to send a GetBalanceQuery again and compare — which means polling, or missing the change entirely.

The numbers are the ones BalanceResponse answers with, computed by the same code over the same rows at the same moment (WalletCoordinatorActor._balancesOf), so an application cannot be told one balance by the event and a different one by the query. That mattered enough to widen this event: it used to carry only the confirmed, unconfirmed and total numbers, and would have left out the wallet's reserved, watch-only and pending funds — exactly the money beads libspiffy-a5h8, libspiffy-87a2 and libspiffy-z84j found reported nowhere.

Announced from the events the wallet read model applied, like TransactionConfirmedEvent and TransactionConfirmationRevertedEvent, so a balance an app is told about is one the read model already holds (bead libspiffy-mu09). It is emitted only when a number actually differs from the one last announced for the wallet, so an event that leaves the balance alone is silent.

Inheritance

Constructors

BalanceUpdatedEvent({required String walletId, required BigInt confirmedBalance, required BigInt unconfirmedBalance, required BigInt totalBalance, BigInt? pendingBalance, BigInt? watchOnlyBalance, BigInt? reservedBalance})

Properties

confirmedBalance → BigInt
See BalanceResponse.confirmedBalance.
final
eventTimestamp → DateTime
When the event was made.
finalinherited
hashCode → int
The hash code for this object.
no setterinherited
pendingBalance → BigInt
See BalanceResponse.pendingBalance: the wallet's money the network is not known to hold, or whose proof a reorganization took away. Not part of totalBalance.
final
reservedBalance → BigInt
See BalanceResponse.reservedBalance. Not part of totalBalance.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
totalBalance → BigInt
confirmedBalance + unconfirmedBalance; see BalanceResponse.totalBalance.
final
unconfirmedBalance → BigInt
See BalanceResponse.unconfirmedBalance.
final
walletId → String
Optional wallet ID for filtering events by wallet
final
watchOnlyBalance → BigInt
See BalanceResponse.watchOnlyBalance. Not part of totalBalance.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited