GetTransactionResponse
extends SorobanRpcResponse
in package
Response when polling the RPC server to find out if a transaction has been completed.
Tags
Table of Contents
Constants
- STATUS_FAILED = "FAILED"
- STATUS_NOT_FOUND = "NOT_FOUND"
- STATUS_SUCCESS = "SUCCESS"
Properties
- $applicationOrder : int|null
- $createdAt : string|null
- $diagnosticEventsXdr : array<string|int, string>|null
- $envelopeXdr : string|null
- $error : SorobanRpcErrorResponse|null
- $events : TransactionEvents|null
- $feeBump : bool|null
- $jsonResponse : array<string|int, mixed>
- $latestLedger : int|null
- $latestLedgerCloseTime : string|null
- $ledger : int|null
- $oldestLedger : int|null
- $oldestLedgerCloseTime : string|null
- $resultMetaXdr : string|null
- $resultXdr : string|null
- $status : string|null
- $txHash : string|null
Methods
- __construct() : mixed
- fromJson() : static
- Creates an instance from JSON-RPC response data
- getApplicationOrder() : int|null
- getCreatedAt() : string|null
- getCreatedContractId() : string|null
- Extracts the contract id from the response if the transaction created a contract
- getDiagnosticEventsXdr() : array<string|int, string>|null
- getEnvelopeXdr() : string|null
- getError() : SorobanRpcErrorResponse|null
- getEvents() : TransactionEvents|null
- getFeeBump() : bool|null
- getJsonResponse() : array<string|int, mixed>
- getLatestLedger() : int|null
- getLatestLedgerCloseTime() : string|null
- getLedger() : int|null
- getOldestLedger() : int|null
- getOldestLedgerCloseTime() : string|null
- getResultMetaXdr() : string|null
- getResultValue() : XdrSCVal|null
- Extracts the result value on success
- getResultXdr() : string|null
- getStatus() : string|null
- getTxHash() : string|null
- getWasmId() : string|null
- Extracts the wasm id from the response if the transaction installed a contract.
- getXdrTransactionEnvelope() : XdrTransactionEnvelope|null
- getXdrTransactionMeta() : XdrTransactionMeta|null
- getXdrTransactionResult() : XdrTransactionResult|null
- setDiagnosticEventsXdr() : void
- setError() : void
- setEvents() : void
- setJsonResponse() : void
- setTxHash() : void
Constants
STATUS_FAILED
public
mixed
STATUS_FAILED
= "FAILED"
STATUS_NOT_FOUND
public
mixed
STATUS_NOT_FOUND
= "NOT_FOUND"
STATUS_SUCCESS
public
mixed
STATUS_SUCCESS
= "SUCCESS"
Properties
$applicationOrder
public
int|null
$applicationOrder
= null
(optional) The index of the transaction among all transactions included in the ledger. This field is only present if status is SUCCESS or FAILED.
$createdAt
public
string|null
$createdAt
= null
(optional) The unix timestamp of when the transaction was included in the ledger. This field is only present if status is SUCCESS or FAILED.
$diagnosticEventsXdr
public
array<string|int, string>|null
$diagnosticEventsXdr
= null
(optional) A base64 encoded slice of xdr.DiagnosticEvent. This is only present if the ENABLE_SOROBAN_DIAGNOSTIC_EVENTS has been enabled in the stellar-core config.
$envelopeXdr
public
string|null
$envelopeXdr
= null
(optional) A base64 encoded string of the raw TransactionEnvelope XDR struct for this transaction.
$error
public
SorobanRpcErrorResponse|null
$error
= null
Error data if the response is an error response
$events
public
TransactionEvents|null
$events
= null
events for the transaction. Only available for protocol version >= 23
$feeBump
public
bool|null
$feeBump
= null
(optional) Indicates whether the transaction was fee bumped. This field is only present if status is SUCCESS or FAILED.
$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
string|null
$latestLedgerCloseTime
= null
The unix timestamp of the close time of the latest ledger known to Soroban RPC at the time it handled the request.
$ledger
public
int|null
$ledger
= null
(optional) The sequence number of the ledger which included the transaction. This field is only present if status is SUCCESS or FAILED.
$oldestLedger
public
int|null
$oldestLedger
= null
The sequence number of the oldest ledger ingested by Soroban RPC at the time it handled the request.
$oldestLedgerCloseTime
public
string|null
$oldestLedgerCloseTime
= null
The unix timestamp of the close time of the oldest ledger ingested by Soroban RPC at the time it handled the request.
$resultMetaXdr
public
string|null
$resultMetaXdr
= null
(optional) A base64 encoded string of the raw TransactionMeta XDR struct for this transaction.
$resultXdr
public
string|null
$resultXdr
= null
(optional) A base64 encoded string of the raw TransactionResult XDR struct for this transaction. This field is only present if status is SUCCESS or FAILED.
$status
public
string|null
$status
= null
The current status of the transaction by hash, one of: SUCCESS, NOT_FOUND, FAILED
$txHash
public
string|null
$txHash
= null
hex-encoded transaction hash string. Only available for protocol version >= 22
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
getApplicationOrder()
public
getApplicationOrder() : int|null
Return values
int|null —(optional) The index of the transaction among all transactions included in the ledger. This field is only present if status is SUCCESS or FAILED.
getCreatedAt()
public
getCreatedAt() : string|null
Return values
string|null —(optional) The unix timestamp of when the transaction was included in the ledger. This field is only present if status is SUCCESS or FAILED.
getCreatedContractId()
Extracts the contract id from the response if the transaction created a contract
public
getCreatedContractId() : string|null
Return values
string|null —the contract id if available.
getDiagnosticEventsXdr()
public
getDiagnosticEventsXdr() : array<string|int, string>|null
Return values
array<string|int, string>|null —(optional) A base64 encoded slice of xdr.DiagnosticEvent. This is only present if the ENABLE_SOROBAN_DIAGNOSTIC_EVENTS has been enabled in the stellar-core config.
getEnvelopeXdr()
public
getEnvelopeXdr() : string|null
Return values
string|null —(optional) A base64 encoded string of the raw TransactionEnvelope XDR struct for this transaction.
getError()
public
getError() : SorobanRpcErrorResponse|null
Return values
SorobanRpcErrorResponse|null —Error data if the response is an error response
getEvents()
public
getEvents() : TransactionEvents|null
Return values
TransactionEvents|null —events for the transaction. Only available for protocol version >= 23
getFeeBump()
public
getFeeBump() : bool|null
Return values
bool|null —(optional) Indicates whether the transaction was fee bumped. This field is only present if status is SUCCESS or FAILED.
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() : string|null
Return values
string|null —The unix timestamp of the close time of the latest ledger known to Soroban RPC at the time it handled the request.
getLedger()
public
getLedger() : int|null
Return values
int|null —(optional) The sequence number of the ledger which included the transaction. This field is only present if status is SUCCESS or FAILED.
getOldestLedger()
public
getOldestLedger() : int|null
Return values
int|null —The sequence number of the oldest ledger ingested by Soroban RPC at the time it handled the request.
getOldestLedgerCloseTime()
public
getOldestLedgerCloseTime() : string|null
Return values
string|null —The unix timestamp of the close time of the oldest ledger ingested by Soroban RPC at the time it handled the request.
getResultMetaXdr()
public
getResultMetaXdr() : string|null
Return values
string|null —(optional) A base64 encoded string of the raw TransactionMeta XDR struct for this transaction.
getResultValue()
Extracts the result value on success
public
getResultValue() : XdrSCVal|null
Return values
XdrSCVal|null —the result value if available.
getResultXdr()
public
getResultXdr() : string|null
Return values
string|null —(optional) A base64 encoded string of the raw TransactionResult XDR object for this transaction. This field is only present if status is SUCCESS or FAILED.
getStatus()
public
getStatus() : string|null
Return values
string|null —The current status of the transaction by hash, one of: SUCCESS, NOT_FOUND, FAILED
getTxHash()
public
getTxHash() : string|null
Return values
string|null —hex-encoded transaction hash string. Only available for protocol version >= 22
getWasmId()
Extracts the wasm id from the response if the transaction installed a contract.
public
getWasmId() : string|null
Return values
string|null —the wasm id if available.
getXdrTransactionEnvelope()
public
getXdrTransactionEnvelope() : XdrTransactionEnvelope|null
Tags
Return values
XdrTransactionEnvelope|null —(optional) the TransactionEnvelope XDR struct for this transaction.
getXdrTransactionMeta()
public
getXdrTransactionMeta() : XdrTransactionMeta|null
Tags
Return values
XdrTransactionMeta|null —(optional) TransactionMeta XDR object for this transaction.
getXdrTransactionResult()
public
getXdrTransactionResult() : XdrTransactionResult|null
Tags
Return values
XdrTransactionResult|null —(optional) the TransactionResult XDR object for this transaction. This field is only present if status is SUCCESS or FAILED.
setDiagnosticEventsXdr()
public
setDiagnosticEventsXdr(array<string|int, string>|null $diagnosticEventsXdr) : void
Parameters
- $diagnosticEventsXdr : array<string|int, string>|null
-
(optional) A base64 encoded slice of xdr.DiagnosticEvent.
setError()
public
setError(SorobanRpcErrorResponse|null $error) : void
Parameters
- $error : SorobanRpcErrorResponse|null
-
Error data if the response is an error response
setEvents()
public
setEvents(TransactionEvents|null $events) : void
Parameters
- $events : TransactionEvents|null
-
events for the transaction. Only available for protocol version >= 23
setJsonResponse()
public
setJsonResponse(array<string|int, mixed> $jsonResponse) : void
Parameters
- $jsonResponse : array<string|int, mixed>
-
The complete JSON response as data array
setTxHash()
public
setTxHash(string|null $txHash) : void
Parameters
- $txHash : string|null
-
hex-encoded transaction hash string. Only for protocol version >= 22