TimeBounds
in package
Represents the time validity bounds for a transaction
TimeBounds specify the time window during which a transaction is valid. Transactions with time bounds will only be accepted by the network if the ledger close time falls within the specified range.
Using time bounds is recommended for security purposes to prevent transaction replay attacks and to ensure transactions expire if not processed within an expected timeframe.
Tags
Table of Contents
Methods
- __construct() : mixed
- TimeBounds constructor
- fromXdr() : TimeBounds
- Creates TimeBounds from XDR format
- getMaxTime() : DateTime
- Gets the maximum time (latest validity)
- getMinTime() : DateTime
- Gets the minimum time (earliest validity)
- toXdr() : XdrTimeBounds
- Converts these time bounds to XDR format
Methods
__construct()
TimeBounds constructor
public
__construct(DateTime $minTime, DateTime $maxTime) : mixed
Parameters
- $minTime : DateTime
-
The earliest time the transaction is valid (inclusive)
- $maxTime : DateTime
-
The latest time the transaction is valid (inclusive)
fromXdr()
Creates TimeBounds from XDR format
public
static fromXdr(XdrTimeBounds $xdrTimeBounds) : TimeBounds
Parameters
- $xdrTimeBounds : XdrTimeBounds
-
The XDR encoded time bounds
Return values
TimeBounds —The decoded time bounds object
getMaxTime()
Gets the maximum time (latest validity)
public
getMaxTime() : DateTime
Return values
DateTime —The latest time the transaction is valid
getMinTime()
Gets the minimum time (earliest validity)
public
getMinTime() : DateTime
Return values
DateTime —The earliest time the transaction is valid
toXdr()
Converts these time bounds to XDR format
public
toXdr() : XdrTimeBounds
Return values
XdrTimeBounds —The XDR representation of these time bounds