LedgerBounds
in package
Represents ledger number bounds as transaction preconditions
LedgerBounds specify a range of ledger numbers during which a transaction is valid. Transactions with ledger bounds will only be accepted if the current ledger number falls within the specified range.
This feature was introduced in CAP-21 to provide more granular control over transaction validity based on ledger progression rather than time.
Tags
Table of Contents
Methods
- __construct() : mixed
- Constructs a new LedgerBounds instance
- fromXdr() : LedgerBounds
- Creates LedgerBounds from XDR format
- getMaxLedger() : int
- Gets the maximum ledger number
- getMinLedger() : int
- Gets the minimum ledger number
- setMaxLedger() : void
- Sets the maximum ledger number
- setMinLedger() : void
- Sets the minimum ledger number
- toXdr() : XdrLedgerBounds
- Converts these ledger bounds to XDR format
Methods
__construct()
Constructs a new LedgerBounds instance
public
__construct(int $minLedger, int $maxLedger) : mixed
Parameters
- $minLedger : int
-
The minimum ledger number (inclusive)
- $maxLedger : int
-
The maximum ledger number (inclusive)
fromXdr()
Creates LedgerBounds from XDR format
public
static fromXdr(XdrLedgerBounds $xdr) : LedgerBounds
Parameters
- $xdr : XdrLedgerBounds
-
The XDR encoded ledger bounds
Return values
LedgerBounds —The decoded ledger bounds object
getMaxLedger()
Gets the maximum ledger number
public
getMaxLedger() : int
Return values
int —The maximum ledger number
getMinLedger()
Gets the minimum ledger number
public
getMinLedger() : int
Return values
int —The minimum ledger number
setMaxLedger()
Sets the maximum ledger number
public
setMaxLedger(int $maxLedger) : void
Parameters
- $maxLedger : int
-
The maximum ledger number
setMinLedger()
Sets the minimum ledger number
public
setMinLedger(int $minLedger) : void
Parameters
- $minLedger : int
-
The minimum ledger number
toXdr()
Converts these ledger bounds to XDR format
public
toXdr() : XdrLedgerBounds
Return values
XdrLedgerBounds —The XDR representation of these ledger bounds