Package nxt

Class AccountLedger


  • public class AccountLedger
    extends java.lang.Object
    Maintain a ledger of changes to selected accounts
    • Field Detail

      • trimKeep

        public static final int trimKeep
        Number of blocks to keep when trimming
    • Constructor Detail

      • AccountLedger

        public AccountLedger()
    • Method Detail

      • removeListener

        public static boolean removeListener​(Listener<AccountLedger.LedgerEntry> listener,
                                             AccountLedger.Event eventType)
        Remove a listener
        Parameters:
        listener - Listener
        eventType - Event to listen for
        Returns:
        True if the listener was removed
      • getEntry

        public static AccountLedger.LedgerEntry getEntry​(long ledgerId)
        Return a single entry identified by the ledger entry identifier
        Parameters:
        ledgerId - Ledger entry identifier
        Returns:
        Ledger entry or null if entry not found
      • getEntries

        public static java.util.List<AccountLedger.LedgerEntry> getEntries​(long accountId,
                                                                           AccountLedger.LedgerEvent event,
                                                                           long eventId,
                                                                           AccountLedger.LedgerHolding holding,
                                                                           long holdingId,
                                                                           int firstIndex,
                                                                           int lastIndex)
        Return the ledger entries sorted in descending insert order
        Parameters:
        accountId - Account identifier or zero if no account identifier
        event - Ledger event or null
        eventId - Ledger event identifier or zero if no event identifier
        holding - Ledger holding or null
        holdingId - Ledger holding identifier or zero if no holding identifier
        firstIndex - First matching entry index, inclusive
        lastIndex - Last matching entry index, inclusive
        Returns:
        List of ledger entries