GetLatestLedgerResponse
extends SorobanRpcResponse
in package
Response for getLatestLedger request.
Tags
Table of Contents
Properties
- $closeTime : int|null
- $error : SorobanRpcErrorResponse|null
- $headerXdr : string|null
- $id : string|null
- $jsonResponse : array<string|int, mixed>
- $metadataXdr : string|null
- $protocolVersion : int|null
- $sequence : int|null
Methods
- __construct() : mixed
- fromJson() : static
- Creates an instance from JSON-RPC response data
- getCloseTime() : int|null
- getError() : SorobanRpcErrorResponse|null
- getHeaderXdr() : string|null
- getId() : string|null
- getJsonResponse() : array<string|int, mixed>
- getMetadataXdr() : string|null
- getProtocolVersion() : int|null
- getSequence() : int|null
- setCloseTime() : void
- setError() : void
- setHeaderXdr() : void
- setId() : void
- setJsonResponse() : void
- setMetadataXdr() : void
- setProtocolVersion() : void
- setSequence() : void
Properties
$closeTime
public
int|null
$closeTime
= null
Unix timestamp when the ledger closed
$error
public
SorobanRpcErrorResponse|null
$error
= null
Error data if the response is an error response
$headerXdr
public
string|null
$headerXdr
= null
Base64-encoded ledger header XDR
$id
public
string|null
$id
= null
Hash identifier of the latest ledger as hex-encoded string
$jsonResponse
public
array<string|int, mixed>
$jsonResponse
$metadataXdr
public
string|null
$metadataXdr
= null
Base64-encoded ledger close metadata XDR
$protocolVersion
public
int|null
$protocolVersion
= null
Stellar Core protocol version associated with the latest ledger
$sequence
public
int|null
$sequence
= null
The sequence number of the latest ledger known to Soroban RPC
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
getCloseTime()
public
getCloseTime() : int|null
Return values
int|null —Unix timestamp when the ledger closed
getError()
public
getError() : SorobanRpcErrorResponse|null
Return values
SorobanRpcErrorResponse|null —Error data if the response is an error response
getHeaderXdr()
public
getHeaderXdr() : string|null
Return values
string|null —Base64-encoded ledger header XDR
getId()
public
getId() : string|null
Return values
string|null —Hash identifier of the latest ledger as hex-encoded string
getJsonResponse()
public
getJsonResponse() : array<string|int, mixed>
Return values
array<string|int, mixed> —The complete JSON response as data array
getMetadataXdr()
public
getMetadataXdr() : string|null
Return values
string|null —Base64-encoded ledger close metadata XDR
getProtocolVersion()
public
getProtocolVersion() : int|null
Return values
int|null —Stellar Core protocol version associated with the latest ledger
getSequence()
public
getSequence() : int|null
Return values
int|null —The sequence number of the latest ledger known to Soroban RPC
setCloseTime()
public
setCloseTime(int|null $closeTime) : void
Parameters
- $closeTime : int|null
-
Unix timestamp when the ledger closed
setError()
public
setError(SorobanRpcErrorResponse|null $error) : void
Parameters
- $error : SorobanRpcErrorResponse|null
-
Error data if the response is an error response
setHeaderXdr()
public
setHeaderXdr(string|null $headerXdr) : void
Parameters
- $headerXdr : string|null
-
Base64-encoded ledger header XDR
setId()
public
setId(string|null $id) : void
Parameters
- $id : string|null
-
Hash identifier of the latest ledger
setJsonResponse()
public
setJsonResponse(array<string|int, mixed> $jsonResponse) : void
Parameters
- $jsonResponse : array<string|int, mixed>
-
The complete JSON response as data array
setMetadataXdr()
public
setMetadataXdr(string|null $metadataXdr) : void
Parameters
- $metadataXdr : string|null
-
Base64-encoded ledger close metadata XDR
setProtocolVersion()
public
setProtocolVersion(int|null $protocolVersion) : void
Parameters
- $protocolVersion : int|null
-
Stellar Core protocol version
setSequence()
public
setSequence(int|null $sequence) : void
Parameters
- $sequence : int|null
-
The sequence number of the latest ledger