GetLedgersResponse
extends SorobanRpcResponse
in package
Response for the getLedgers request.
Tags
Table of Contents
Properties
- $cursor : string|null
- $error : SorobanRpcErrorResponse|null
- $jsonResponse : array<string|int, mixed>
- $latestLedger : int|null
- $latestLedgerCloseTime : int|null
- $ledgers : array<string|int, LedgerInfo>|null
- $oldestLedger : int|null
- $oldestLedgerCloseTime : int|null
Methods
- __construct() : mixed
- fromJson() : static
- Creates an instance from JSON-RPC response data
- getCursor() : string|null
- getError() : SorobanRpcErrorResponse|null
- getJsonResponse() : array<string|int, mixed>
- getLatestLedger() : int|null
- getLatestLedgerCloseTime() : int|null
- getLedgers() : array<string|int, LedgerInfo>|null
- getOldestLedger() : int|null
- getOldestLedgerCloseTime() : int|null
- setCursor() : void
- setError() : void
- setJsonResponse() : void
- setLatestLedger() : void
- setLatestLedgerCloseTime() : void
- setLedgers() : void
- setOldestLedger() : void
- setOldestLedgerCloseTime() : void
Properties
$cursor
public
string|null
$cursor
= null
Cursor value for pagination
$error
public
SorobanRpcErrorResponse|null
$error
= null
Error data if the response is an error response
$jsonResponse
public
array<string|int, mixed>
$jsonResponse
$latestLedger
public
int|null
$latestLedger
= null
The sequence number of the latest ledger known to Soroban RPC at the time it handled the request
$latestLedgerCloseTime
public
int|null
$latestLedgerCloseTime
= null
Unix timestamp of the latest ledger close time
$ledgers
public
array<string|int, LedgerInfo>|null
$ledgers
= null
Array of ledger information
$oldestLedger
public
int|null
$oldestLedger
= null
The sequence number of the oldest ledger ingested by Soroban RPC
$oldestLedgerCloseTime
public
int|null
$oldestLedgerCloseTime
= null
Unix timestamp of the oldest ledger close time
Methods
__construct()
public
__construct(array<string|int, mixed> $jsonResponse) : mixed
Parameters
- $jsonResponse : array<string|int, mixed>
-
The complete JSON response as data array
fromJson()
Creates an instance from JSON-RPC response data
public
static fromJson(array<string, mixed> $json) : static
Parameters
- $json : array<string, mixed>
-
The JSON response data
Return values
static —The created instance
getCursor()
public
getCursor() : string|null
Return values
string|null —Cursor value for pagination
getError()
public
getError() : SorobanRpcErrorResponse|null
Return values
SorobanRpcErrorResponse|null —Error data if the response is an error response
getJsonResponse()
public
getJsonResponse() : array<string|int, mixed>
Return values
array<string|int, mixed> —The complete JSON response as data array
getLatestLedger()
public
getLatestLedger() : int|null
Return values
int|null —The sequence number of the latest ledger known to Soroban RPC at the time it handled the request
getLatestLedgerCloseTime()
public
getLatestLedgerCloseTime() : int|null
Return values
int|null —Unix timestamp of the latest ledger close time
getLedgers()
public
getLedgers() : array<string|int, LedgerInfo>|null
Return values
array<string|int, LedgerInfo>|null —Array of ledger information
getOldestLedger()
public
getOldestLedger() : int|null
Return values
int|null —The sequence number of the oldest ledger ingested by Soroban RPC
getOldestLedgerCloseTime()
public
getOldestLedgerCloseTime() : int|null
Return values
int|null —Unix timestamp of the oldest ledger close time
setCursor()
public
setCursor(string|null $cursor) : void
Parameters
- $cursor : string|null
-
Cursor value for pagination
setError()
public
setError(SorobanRpcErrorResponse|null $error) : void
Parameters
- $error : SorobanRpcErrorResponse|null
-
Error data if the response is an error response
setJsonResponse()
public
setJsonResponse(array<string|int, mixed> $jsonResponse) : void
Parameters
- $jsonResponse : array<string|int, mixed>
-
The complete JSON response as data array
setLatestLedger()
public
setLatestLedger(int|null $latestLedger) : void
Parameters
- $latestLedger : int|null
-
The sequence number of the latest ledger
setLatestLedgerCloseTime()
public
setLatestLedgerCloseTime(int|null $latestLedgerCloseTime) : void
Parameters
- $latestLedgerCloseTime : int|null
-
Unix timestamp of the latest ledger close time
setLedgers()
public
setLedgers(array<string|int, LedgerInfo>|null $ledgers) : void
Parameters
- $ledgers : array<string|int, LedgerInfo>|null
-
Array of ledger information
setOldestLedger()
public
setOldestLedger(int|null $oldestLedger) : void
Parameters
- $oldestLedger : int|null
-
The sequence number of the oldest ledger
setOldestLedgerCloseTime()
public
setOldestLedgerCloseTime(int|null $oldestLedgerCloseTime) : void
Parameters
- $oldestLedgerCloseTime : int|null
-
Unix timestamp of the oldest ledger close time