Package org.stellar.sdk.xdr
Class LedgerHeader
java.lang.Object
org.stellar.sdk.xdr.LedgerHeader
- All Implemented Interfaces:
XdrElement
LedgerHeader's original definition in the XDR file is:
struct LedgerHeader
{
uint32 ledgerVersion; // the protocol version of the ledger
Hash previousLedgerHash; // hash of the previous ledger header
StellarValue scpValue; // what consensus agreed to
Hash txSetResultHash; // the TransactionResultSet that led to this ledger
Hash bucketListHash; // hash of the ledger state
uint32 ledgerSeq; // sequence number of this ledger
int64 totalCoins; // total number of stroops in existence.
// 10,000,000 stroops in 1 XLM
int64 feePool; // fees burned since last inflation run
uint32 inflationSeq; // inflation sequence number
uint64 idPool; // last used global ID, used for generating objects
uint32 baseFee; // base fee per operation in stroops
uint32 baseReserve; // account base reserve in stroops
uint32 maxTxSetSize; // maximum size a transaction set can be
Hash skipList[4]; // hashes of ledgers in the past. allows you to jump back
// in time without walking the chain back ledger by ledger
// each slot contains the oldest ledger that is mod of
// either 50 5000 50000 or 500000 depending on index
// skipList[0] mod(50), skipList[1] mod(5000), etc
// reserved for future use
union switch (int v)
{
case 0:
void;
case 1:
LedgerHeaderExtensionV1 v1;
}
ext;
};
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classLedgerHeaderExt's original definition in the XDR file is: -
Field Summary
Fields inherited from interface org.stellar.sdk.xdr.XdrElement
gson -
Constructor Summary
ConstructorsConstructorDescriptionLedgerHeader(Uint32 ledgerVersion, Hash previousLedgerHash, StellarValue scpValue, Hash txSetResultHash, Hash bucketListHash, Uint32 ledgerSeq, Int64 totalCoins, Int64 feePool, Uint32 inflationSeq, Uint64 idPool, Uint32 baseFee, Uint32 baseReserve, Uint32 maxTxSetSize, Hash[] skipList, LedgerHeader.LedgerHeaderExt ext) Creates a newLedgerHeaderinstance. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()static LedgerHeaderdecode(XdrDataInputStream stream) static LedgerHeaderdecode(XdrDataInputStream stream, int maxDepth) voidencode(XdrDataOutputStream stream) Encodes this value to XDR and writes it to the provided stream.booleanstatic LedgerHeaderstatic LedgerHeaderfromXdrBase64(String xdr) static LedgerHeaderfromXdrByteArray(byte[] xdr) Value of thebaseFeefield.Value of thebaseReservefield.Value of thebucketListHashfield.getExt()Value of theextfield.Value of thefeePoolfield.Value of theidPoolfield.Value of theinflationSeqfield.Value of theledgerSeqfield.Value of theledgerVersionfield.Value of themaxTxSetSizefield.Value of thepreviousLedgerHashfield.Value of thescpValuefield.Hash[]Value of theskipListfield.Value of thetotalCoinsfield.Value of thetxSetResultHashfield.inthashCode()voidsetBaseFee(Uint32 baseFee) Value of thebaseFeefield.voidsetBaseReserve(Uint32 baseReserve) Value of thebaseReservefield.voidsetBucketListHash(Hash bucketListHash) Value of thebucketListHashfield.voidValue of theextfield.voidsetFeePool(Int64 feePool) Value of thefeePoolfield.voidValue of theidPoolfield.voidsetInflationSeq(Uint32 inflationSeq) Value of theinflationSeqfield.voidsetLedgerSeq(Uint32 ledgerSeq) Value of theledgerSeqfield.voidsetLedgerVersion(Uint32 ledgerVersion) Value of theledgerVersionfield.voidsetMaxTxSetSize(Uint32 maxTxSetSize) Value of themaxTxSetSizefield.voidsetPreviousLedgerHash(Hash previousLedgerHash) Value of thepreviousLedgerHashfield.voidsetScpValue(StellarValue scpValue) Value of thescpValuefield.voidsetSkipList(Hash[] skipList) Value of theskipListfield.voidsetTotalCoins(Int64 totalCoins) Value of thetotalCoinsfield.voidsetTxSetResultHash(Hash txSetResultHash) Value of thetxSetResultHashfield.toJson()Serializes this value to JSON.toString()Methods inherited from interface org.stellar.sdk.xdr.XdrElement
toXdrBase64, toXdrByteArray
-
Constructor Details
-
LedgerHeader
public LedgerHeader() -
LedgerHeader
public LedgerHeader(Uint32 ledgerVersion, Hash previousLedgerHash, StellarValue scpValue, Hash txSetResultHash, Hash bucketListHash, Uint32 ledgerSeq, Int64 totalCoins, Int64 feePool, Uint32 inflationSeq, Uint64 idPool, Uint32 baseFee, Uint32 baseReserve, Uint32 maxTxSetSize, Hash[] skipList, LedgerHeader.LedgerHeaderExt ext) Creates a newLedgerHeaderinstance.- Parameters:
ledgerVersion- theledgerVersionfield valuepreviousLedgerHash- thepreviousLedgerHashfield valuescpValue- thescpValuefield valuetxSetResultHash- thetxSetResultHashfield valuebucketListHash- thebucketListHashfield valueledgerSeq- theledgerSeqfield valuetotalCoins- thetotalCoinsfield valuefeePool- thefeePoolfield valueinflationSeq- theinflationSeqfield valueidPool- theidPoolfield valuebaseFee- thebaseFeefield valuebaseReserve- thebaseReservefield valuemaxTxSetSize- themaxTxSetSizefield valueskipList- theskipListfield valueext- theextfield value
-
-
Method Details
-
encode
Description copied from interface:XdrElementEncodes this value to XDR and writes it to the provided stream.- Specified by:
encodein interfaceXdrElement- Parameters:
stream- the destination XDR output stream- Throws:
IOException- if an I/O error occurs while writing the value
-
decode
- Throws:
IOException
-
decode
- Throws:
IOException
-
fromXdrBase64
- Throws:
IOException
-
fromXdrByteArray
- Throws:
IOException
-
toJson
Description copied from interface:XdrElementSerializes this value to JSON.- Specified by:
toJsonin interfaceXdrElement- Returns:
- the JSON representation of this value
-
fromJson
-
builder
-
toBuilder
-
getLedgerVersion
Value of theledgerVersionfield.- Returns:
- the
ledgerVersionfield value
-
getPreviousLedgerHash
Value of thepreviousLedgerHashfield.- Returns:
- the
previousLedgerHashfield value
-
getScpValue
Value of thescpValuefield.- Returns:
- the
scpValuefield value
-
getTxSetResultHash
Value of thetxSetResultHashfield.- Returns:
- the
txSetResultHashfield value
-
getBucketListHash
Value of thebucketListHashfield.- Returns:
- the
bucketListHashfield value
-
getLedgerSeq
Value of theledgerSeqfield.- Returns:
- the
ledgerSeqfield value
-
getTotalCoins
Value of thetotalCoinsfield.- Returns:
- the
totalCoinsfield value
-
getFeePool
Value of thefeePoolfield.- Returns:
- the
feePoolfield value
-
getInflationSeq
Value of theinflationSeqfield.- Returns:
- the
inflationSeqfield value
-
getIdPool
Value of theidPoolfield.- Returns:
- the
idPoolfield value
-
getBaseFee
Value of thebaseFeefield.- Returns:
- the
baseFeefield value
-
getBaseReserve
Value of thebaseReservefield.- Returns:
- the
baseReservefield value
-
getMaxTxSetSize
Value of themaxTxSetSizefield.- Returns:
- the
maxTxSetSizefield value
-
getSkipList
Value of theskipListfield.- Returns:
- the
skipListfield value
-
getExt
Value of theextfield.- Returns:
- the
extfield value
-
setLedgerVersion
Value of theledgerVersionfield.- Parameters:
ledgerVersion- theledgerVersionfield value
-
setPreviousLedgerHash
Value of thepreviousLedgerHashfield.- Parameters:
previousLedgerHash- thepreviousLedgerHashfield value
-
setScpValue
Value of thescpValuefield.- Parameters:
scpValue- thescpValuefield value
-
setTxSetResultHash
Value of thetxSetResultHashfield.- Parameters:
txSetResultHash- thetxSetResultHashfield value
-
setBucketListHash
Value of thebucketListHashfield.- Parameters:
bucketListHash- thebucketListHashfield value
-
setLedgerSeq
Value of theledgerSeqfield.- Parameters:
ledgerSeq- theledgerSeqfield value
-
setTotalCoins
Value of thetotalCoinsfield.- Parameters:
totalCoins- thetotalCoinsfield value
-
setFeePool
Value of thefeePoolfield.- Parameters:
feePool- thefeePoolfield value
-
setInflationSeq
Value of theinflationSeqfield.- Parameters:
inflationSeq- theinflationSeqfield value
-
setIdPool
Value of theidPoolfield.- Parameters:
idPool- theidPoolfield value
-
setBaseFee
Value of thebaseFeefield.- Parameters:
baseFee- thebaseFeefield value
-
setBaseReserve
Value of thebaseReservefield.- Parameters:
baseReserve- thebaseReservefield value
-
setMaxTxSetSize
Value of themaxTxSetSizefield.- Parameters:
maxTxSetSize- themaxTxSetSizefield value
-
setSkipList
Value of theskipListfield.- Parameters:
skipList- theskipListfield value
-
setExt
Value of theextfield.- Parameters:
ext- theextfield value
-
equals
-
hashCode
public int hashCode() -
toString
-