Package zephyr.wallet.model
Class ZephyrWalletListener
java.lang.Object
zephyr.wallet.model.ZephyrWalletListener
- All Implemented Interfaces:
ZephyrWalletListenerI
Default wallet listener which takes no action on notifications.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a listener that ignores every notification; override the callbacks you need. -
Method Summary
Modifier and TypeMethodDescriptionfinal voidonBalancesChanged(BigInteger newBalance, BigInteger newUnlockedBalance) Deprecated.voidonBalancesChanged(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) The unconfirmed notification carries no asset type (the core does not pass it for pool outputs); the confirmed and unlocked notifications do.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.
-
Constructor Details
-
ZephyrWalletListener
public ZephyrWalletListener()Constructs a listener that ignores every notification; override the callbacks you need.
-
-
Method Details
-
onSyncProgress
public void onSyncProgress(long height, long startHeight, long endHeight, double percentDone, String message) Description copied from interface:ZephyrWalletListenerIInvoked as the wallet is synchronized.- Specified by:
onSyncProgressin interfaceZephyrWalletListenerI- 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
public void onNewBlock(long height) Description copied from interface:ZephyrWalletListenerIInvoked when a new block is added to the chain.- Specified by:
onNewBlockin interfaceZephyrWalletListenerI- Parameters:
height- - the height of the new block (i.e. the number of blocks before it).
-
onBalancesChanged
public void onBalancesChanged(BigInteger newBalance, BigInteger newUnlockedBalance, String assetType) Description copied from interface:ZephyrWalletListenerIInvoked when the wallet's balances change, once per asset whose balance changed.- Specified by:
onBalancesChangedin interfaceZephyrWalletListenerI- 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)
-
onBalancesChanged
@Deprecated public final void onBalancesChanged(BigInteger newBalance, BigInteger newUnlockedBalance) Deprecated.overrideonBalancesChanged(BigInteger, BigInteger, String)insteadNot called by zephyr-java: balances change per asset. Kept final so that a listener ported from monero-java fails to compile here instead of never being notified.- Parameters:
newBalance- is not usednewUnlockedBalance- is not used
-
onOutputReceived
The unconfirmed notification carries no asset type (the core does not pass it for pool outputs); the confirmed and unlocked notifications do. UseonBalancesChangedorgetTxs()for the asset of an unconfirmed output.- Specified by:
onOutputReceivedin interfaceZephyrWalletListenerI- Parameters:
output- - the received output
-
onOutputSpent
Description copied from interface:ZephyrWalletListenerIInvoked twice per spent output: once when confirmed and once when unlocked.- Specified by:
onOutputSpentin interfaceZephyrWalletListenerI- Parameters:
output- - the spent output
-
onBalancesChanged(BigInteger, BigInteger, String)instead