Package org.xrpl.xrpl4j.model.ledger
Interface LedgerHeader
- All Known Implementing Classes:
ImmutableLedgerHeader
@Immutable
public interface LedgerHeader
Contains the contents of a given ledger on the XRPL.
-
Method Summary
Modifier and TypeMethodDescriptionThe SHA-512Half of this ledger's state tree information.builder()Construct a builder for this class.default booleanclosed()If true, this ledger version is no longer accepting new transactions.Optional<com.google.common.primitives.UnsignedLong> The approximate time this ledger version closed, as the number of seconds since the Ripple Epoch.The time this ledger was closed, in human-readable format.Optional<com.google.common.primitives.UnsignedInteger> AnUnsignedIntegerin the range [2,120] indicating the maximum number of seconds by which thecloseTime()could be rounded.The SHA-512Half of this ledger version.The ledger index of the ledger.Optional<com.google.common.primitives.UnsignedLong> The time at which the previous ledger was closed.TheledgerHash()value of the previous ledger version that is the direct predecessor of this one.The total number of drops of XRP owned by accounts in the ledger.The SHA-512Half of the transactions included in this ledger.List<TransactionResult<? extends Transaction>> Transactions applied in this ledger version.
-
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 aLedgerIndex, however the ledger method returns the ledger_index as aStringrepresenting an unsigned 32 bit integer.- Returns:
- A
Stringcontaining the ledger index.
-
ledgerHash
The SHA-512Half of this ledger version. This serves as a unique identifier for this ledger and all its contents. -
accountHash
The SHA-512Half of this ledger's state tree information. -
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 thecloseTimeResolution()}.- Returns:
- An
Optionalof typeUnsignedLongrepresenting 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
ZonedDateTimerepresenting thecloseTime()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:
trueif this ledger version is no longer accepting new transactions, otherwisefalse.
-
parentHash
Hash256 parentHash()TheledgerHash()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
Hash256containing 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
UnsignedLongdenoting this ledger's parent ledger's close time.
-
totalCoins
Optional<XrpCurrencyAmount> 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
Optionalof typeXrpCurrencyAmountrepresenting the total number of coins.
-
transactionHash
The SHA-512Half of the transactions included in this ledger.- Returns:
- A
Hash256containing the hash of all transactions in this ledger.
-
transactions
List<TransactionResult<? extends Transaction>> transactions()Transactions applied in this ledger version.- Returns:
- A
ListofTransactionResults containing all the transactions in this ledger.
-
closeTimeResolution
Optional<com.google.common.primitives.UnsignedInteger> closeTimeResolution()AnUnsignedIntegerin the range [2,120] indicating the maximum number of seconds by which thecloseTime()could be rounded.- Returns:
- An
Optionalof typeUnsignedIntegerrepresenting the close time resolution.
-