Interface ZephyrWalletListenerI

All Known Implementing Classes:
ZephyrWalletListener

public interface ZephyrWalletListenerI
Interface to receive wallet notifications.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    onBalancesChanged(BigInteger newBalance, BigInteger newUnlockedBalance, String assetType)
    Invoked when the wallet's balances change, once per asset whose balance changed.
    void
    onNewBlock(long height)
    Invoked when a new block is added to the chain.
    void
    Invoked 3 times per received output: once when unconfirmed, once when confirmed, and once when unlocked.
    void
    Invoked twice per spent output: once when confirmed and once when unlocked.
    void
    onSyncProgress(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 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

      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

      void onBalancesChanged(BigInteger newBalance, BigInteger newUnlockedBalance, String assetType)
      Invoked when the wallet's balances change, once per asset whose balance changed.
      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)
    • onOutputReceived

      void onOutputReceived(ZephyrOutputWallet output)
      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 onBalancesChanged or getTxs() for the asset of an unconfirmed output.

      Parameters:
      output - - the received output
    • onOutputSpent

      void onOutputSpent(ZephyrOutputWallet output)
      Invoked twice per spent output: once when confirmed and once when unlocked.
      Parameters:
      output - - the spent output