Package org.stellar.sdk.xdr
Class PreconditionsV2
java.lang.Object
org.stellar.sdk.xdr.PreconditionsV2
- All Implemented Interfaces:
XdrElement
PreconditionsV2's original definition in the XDR file is:
struct PreconditionsV2
{
TimeBounds* timeBounds;
// Transaction only valid for ledger numbers n such that
// minLedger <= n < maxLedger (if maxLedger == 0, then
// only minLedger is checked)
LedgerBounds* ledgerBounds;
// If NULL, only valid when sourceAccount's sequence number
// is seqNum - 1. Otherwise, valid when sourceAccount's
// sequence number n satisfies minSeqNum <= n < tx.seqNum.
// Note that after execution the account's sequence number
// is always raised to tx.seqNum, and a transaction is not
// valid if tx.seqNum is too high to ensure replay protection.
SequenceNumber* minSeqNum;
// For the transaction to be valid, the current ledger time must
// be at least minSeqAge greater than sourceAccount's seqTime.
Duration minSeqAge;
// For the transaction to be valid, the current ledger number
// must be at least minSeqLedgerGap greater than sourceAccount's
// seqLedger.
uint32 minSeqLedgerGap;
// For the transaction to be valid, there must be a signature
// corresponding to every Signer in this array, even if the
// signature is not otherwise required by the sourceAccount or
// operations.
SignerKey extraSigners<2>;
};
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface org.stellar.sdk.xdr.XdrElement
gson -
Constructor Summary
ConstructorsConstructorDescriptionPreconditionsV2(TimeBounds timeBounds, LedgerBounds ledgerBounds, SequenceNumber minSeqNum, Duration minSeqAge, Uint32 minSeqLedgerGap, SignerKey[] extraSigners) Creates a newPreconditionsV2instance. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()static PreconditionsV2decode(XdrDataInputStream stream) static PreconditionsV2decode(XdrDataInputStream stream, int maxDepth) voidencode(XdrDataOutputStream stream) Encodes this value to XDR and writes it to the provided stream.booleanstatic PreconditionsV2static PreconditionsV2fromXdrBase64(String xdr) static PreconditionsV2fromXdrByteArray(byte[] xdr) Value of theextraSignersfield.Value of theledgerBoundsfield.Value of theminSeqAgefield.Value of theminSeqLedgerGapfield.Value of theminSeqNumfield.Value of thetimeBoundsfield.inthashCode()voidsetExtraSigners(SignerKey[] extraSigners) Value of theextraSignersfield.voidsetLedgerBounds(LedgerBounds ledgerBounds) Value of theledgerBoundsfield.voidsetMinSeqAge(Duration minSeqAge) Value of theminSeqAgefield.voidsetMinSeqLedgerGap(Uint32 minSeqLedgerGap) Value of theminSeqLedgerGapfield.voidsetMinSeqNum(SequenceNumber minSeqNum) Value of theminSeqNumfield.voidsetTimeBounds(TimeBounds timeBounds) Value of thetimeBoundsfield.toJson()Serializes this value to JSON.toString()Methods inherited from interface org.stellar.sdk.xdr.XdrElement
toXdrBase64, toXdrByteArray
-
Constructor Details
-
PreconditionsV2
public PreconditionsV2() -
PreconditionsV2
public PreconditionsV2(TimeBounds timeBounds, LedgerBounds ledgerBounds, SequenceNumber minSeqNum, Duration minSeqAge, Uint32 minSeqLedgerGap, SignerKey[] extraSigners) Creates a newPreconditionsV2instance.- Parameters:
timeBounds- thetimeBoundsfield valueledgerBounds- theledgerBoundsfield valueminSeqNum- theminSeqNumfield valueminSeqAge- theminSeqAgefield valueminSeqLedgerGap- theminSeqLedgerGapfield valueextraSigners- theextraSignersfield 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
-
getTimeBounds
Value of thetimeBoundsfield.- Returns:
- the
timeBoundsfield value
-
getLedgerBounds
Value of theledgerBoundsfield.- Returns:
- the
ledgerBoundsfield value
-
getMinSeqNum
Value of theminSeqNumfield.- Returns:
- the
minSeqNumfield value
-
getMinSeqAge
Value of theminSeqAgefield.- Returns:
- the
minSeqAgefield value
-
getMinSeqLedgerGap
Value of theminSeqLedgerGapfield.- Returns:
- the
minSeqLedgerGapfield value
-
getExtraSigners
Value of theextraSignersfield.- Returns:
- the
extraSignersfield value
-
setTimeBounds
Value of thetimeBoundsfield.- Parameters:
timeBounds- thetimeBoundsfield value
-
setLedgerBounds
Value of theledgerBoundsfield.- Parameters:
ledgerBounds- theledgerBoundsfield value
-
setMinSeqNum
Value of theminSeqNumfield.- Parameters:
minSeqNum- theminSeqNumfield value
-
setMinSeqAge
Value of theminSeqAgefield.- Parameters:
minSeqAge- theminSeqAgefield value
-
setMinSeqLedgerGap
Value of theminSeqLedgerGapfield.- Parameters:
minSeqLedgerGap- theminSeqLedgerGapfield value
-
setExtraSigners
Value of theextraSignersfield.- Parameters:
extraSigners- theextraSignersfield value
-
equals
-
hashCode
public int hashCode() -
toString
-