Class ZephyrWalletListener

java.lang.Object
zephyr.wallet.model.ZephyrWalletListener
All Implemented Interfaces:
ZephyrWalletListenerI

public class ZephyrWalletListener extends Object implements ZephyrWalletListenerI
Default wallet listener which takes no action on notifications.
  • 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: ZephyrWalletListenerI
      Invoked as the wallet is synchronized.
      Specified by:
      onSyncProgress in interface ZephyrWalletListenerI
      Parameters:
      height - - height of the synced block
      startHeight - - starting height of the sync request
      endHeight - - ending height of the sync request
      percentDone - - sync progress as a percentage
      message - is a human-readable description of the current progress
    • onNewBlock

      public void onNewBlock(long height)
      Description copied from interface: ZephyrWalletListenerI
      Invoked when a new block is added to the chain.
      Specified by:
      onNewBlock in interface ZephyrWalletListenerI
      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: ZephyrWalletListenerI
      Invoked when the wallet's balances change, once per asset whose balance changed.
      Specified by:
      onBalancesChanged in interface ZephyrWalletListenerI
      Parameters:
      newBalance - - new wallet balance of the asset in atomic units
      newUnlockedBalance - - new unlocked wallet balance of the asset in atomic units
      assetType - - the asset whose balance changed (an open string, see ZephyrAssets)
    • onBalancesChanged

      @Deprecated public final void onBalancesChanged(BigInteger newBalance, BigInteger newUnlockedBalance)
      Not 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 used
      newUnlockedBalance - is not used
    • onOutputReceived

      public void onOutputReceived(ZephyrOutputWallet output)
      The unconfirmed notification carries no asset type (the core does not pass it for pool outputs); the confirmed and unlocked notifications do. Use onBalancesChanged or getTxs() for the asset of an unconfirmed output.
      Specified by:
      onOutputReceived in interface ZephyrWalletListenerI
      Parameters:
      output - - the received output
    • onOutputSpent

      public void onOutputSpent(ZephyrOutputWallet output)
      Description copied from interface: ZephyrWalletListenerI
      Invoked twice per spent output: once when confirmed and once when unlocked.
      Specified by:
      onOutputSpent in interface ZephyrWalletListenerI
      Parameters:
      output - - the spent output