Package zephyr.wallet.model
Interface ZephyrWalletListenerI
- All Known Implementing Classes:
ZephyrWalletListener
public interface ZephyrWalletListenerI
Interface to receive wallet notifications.
-
Method Summary
Modifier and TypeMethodDescriptionvoidonBalancesChanged(BigInteger newBalance, BigInteger newUnlockedBalance, String assetType) Invoked when the wallet's balances change, once per asset whose balance changed.voidonNewBlock(long height) Invoked when a new block is added to the chain.voidonOutputReceived(ZephyrOutputWallet output) Invoked 3 times per received output: once when unconfirmed, once when confirmed, and once when unlocked.voidonOutputSpent(ZephyrOutputWallet output) Invoked twice per spent output: once when confirmed and once when unlocked.voidonSyncProgress(long height, long startHeight, long endHeight, double percentDone, String message) Invoked as the wallet is synchronized.
-
Method Details
-
onSyncProgress
void onSyncProgress(long height, long startHeight, long endHeight, double percentDone, String message) Invoked as the wallet is synchronized.- Parameters:
height- - height of the synced blockstartHeight- - starting height of the sync requestendHeight- - ending height of the sync requestpercentDone- - sync progress as a percentagemessage- is a human-readable description of the current progress
-
onNewBlock
void onNewBlock(long height) Invoked when a new block is added to the chain.- Parameters:
height- - the height of the new block (i.e. the number of blocks before it).
-
onBalancesChanged
Invoked when the wallet's balances change, once per asset whose balance changed.- Parameters:
newBalance- - new wallet balance of the asset in atomic unitsnewUnlockedBalance- - new unlocked wallet balance of the asset in atomic unitsassetType- - the asset whose balance changed (an open string, see ZephyrAssets)
-
onOutputReceived
Invoked 3 times per received output: once when unconfirmed, once when confirmed, and once when unlocked.The unconfirmed notification carries no asset type (the core does not pass it for pool outputs); the confirmed and unlocked notifications do. Use
onBalancesChangedorgetTxs()for the asset of an unconfirmed output.- Parameters:
output- - the received output
-
onOutputSpent
Invoked twice per spent output: once when confirmed and once when unlocked.- Parameters:
output- - the spent output
-