Interface LedgerHeader

All Known Implementing Classes:
ImmutableLedgerHeader

@Immutable public interface LedgerHeader
Contains the contents of a given ledger on the XRPL.
  • Method Details

    • builder

      Construct a builder for this class.
      Returns:
      An ImmutableLedgerHeader.Builder.
    • ledgerIndex

      LedgerIndex ledgerIndex()
      The ledger index of the ledger. In other objects, this would be a LedgerIndex, however the ledger method returns the ledger_index as a String representing an unsigned 32 bit integer.
      Returns:
      A String containing the ledger index.
    • ledgerHash

      Optional<Hash256> ledgerHash()
      The SHA-512Half of this ledger version. This serves as a unique identifier for this ledger and all its contents.
      Returns:
      An Optional of type Hash256 containing the hash of the ledger.
    • accountHash

      Optional<Hash256> accountHash()
      The SHA-512Half of this ledger's state tree information.
      Returns:
      An Optional of type Hash256 containing the hash of this ledger's state tree.
    • closeTime

      Optional<com.google.common.primitives.UnsignedLong> closeTime()
      The approximate time this ledger version closed, as the number of seconds since the Ripple Epoch. This value is rounded based on the closeTimeResolution()}.
      Returns:
      An Optional of type UnsignedLong representing the close time.
    • closeTimeHuman

      Optional<ZonedDateTime> closeTimeHuman()
      The time this ledger was closed, in human-readable format. Always uses the UTC time zone.
      Returns:
      A ZonedDateTime representing the closeTime() in human-readable format.
    • closed

      @Default default boolean closed()
      If true, this ledger version is no longer accepting new transactions. (However, unless this ledger version is validated, it might be replaced by a different ledger version with a different set of transactions.)
      Returns:
      true if this ledger version is no longer accepting new transactions, otherwise false.
    • parentHash

      Hash256 parentHash()
      The ledgerHash() value of the previous ledger version that is the direct predecessor of this one. If there are different versions of the previous ledger index, this indicates from which one the ledger was derived.
      Returns:
      A Hash256 containing the hash of this ledger's parent ledger.
    • parentCloseTime

      Optional<com.google.common.primitives.UnsignedLong> parentCloseTime()
      The time at which the previous ledger was closed.
      Returns:
      An UnsignedLong denoting this ledger's parent ledger's close time.
    • totalCoins

      The total number of drops of XRP owned by accounts in the ledger. This omits XRP that has been destroyed by transaction fees. The actual amount of XRP in circulation is lower because some accounts are "black holes" whose keys are not known by anyone.
      Returns:
      An Optional of type XrpCurrencyAmount representing the total number of coins.
    • transactionHash

      Optional<Hash256> transactionHash()
      The SHA-512Half of the transactions included in this ledger.
      Returns:
      A Hash256 containing the hash of all transactions in this ledger.
    • transactions

      List<TransactionResult<? extends Transaction>> transactions()
      Transactions applied in this ledger version.
      Returns:
      A List of TransactionResults containing all the transactions in this ledger.
    • closeTimeResolution

      Optional<com.google.common.primitives.UnsignedInteger> closeTimeResolution()
      An UnsignedInteger in the range [2,120] indicating the maximum number of seconds by which the closeTime() could be rounded.
      Returns:
      An Optional of type UnsignedInteger representing the close time resolution.