Stellar PHP SDK API Documentation

PreconditionsLedgerBoundsResponse

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
see
TransactionPreconditionsResponse

For the parent preconditions container

see
PreconditionsTimeBoundsResponse

For time-based validity bounds

see
https://developers.stellar.org

Stellar developer docs Transaction Preconditions

see
https://stellar.org/protocol/cap-21

CAP-21: Generalized Transaction Preconditions

since
1.0.0

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

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


        
On this page

Search results