PreconditionsLedgerBoundsResponse
in package
Represents ledger-based validity bounds for transaction preconditions
Ledger bounds specify a range of ledger sequence numbers within which a transaction is valid. The transaction can only be included in ledgers with sequence numbers between minLedger and maxLedger (inclusive). This provides deterministic transaction lifetime control based on network state rather than time.
Ledger bounds are useful when you need precise control over transaction execution windows and want to avoid time-based uncertainties. A value of 0 for either bound indicates no constraint in that direction.
Introduced in Protocol 19 as part of CAP-21 transaction preconditions.
Tags
Table of Contents
Methods
- fromJson() : PreconditionsLedgerBoundsResponse
- Creates a PreconditionsLedgerBoundsResponse instance from JSON data
- getMaxLedger() : int
- Gets the maximum ledger sequence number for transaction validity
- getMinLedger() : int
- Gets the minimum ledger sequence number for transaction validity
- loadFromJson() : void
- Loads ledger bounds data from JSON response
Methods
fromJson()
Creates a PreconditionsLedgerBoundsResponse instance from JSON data
public
static fromJson(array<string|int, mixed> $json) : PreconditionsLedgerBoundsResponse
Parameters
- $json : array<string|int, mixed>
-
The JSON array containing ledger bounds data from Horizon
Return values
PreconditionsLedgerBoundsResponse —The parsed ledger bounds response
getMaxLedger()
Gets the maximum ledger sequence number for transaction validity
public
getMaxLedger() : int
Returns the maximum ledger sequence in which this transaction can be included. If 0, there is no upper bound and the transaction remains valid indefinitely (subject to the minLedger constraint).
Return values
int —The maximum ledger sequence, or 0 for no constraint
getMinLedger()
Gets the minimum ledger sequence number for transaction validity
public
getMinLedger() : int
Returns the minimum ledger sequence in which this transaction can be included. If 0, there is no lower bound and the transaction can be included in any ledger (subject to the maxLedger constraint).
Return values
int —The minimum ledger sequence, or 0 for no constraint
loadFromJson()
Loads ledger bounds data from JSON response
protected
loadFromJson(array<string|int, mixed> $json) : void
Parameters
- $json : array<string|int, mixed>
-
The JSON array containing ledger bounds data