Stellar PHP SDK API Documentation

GetTransactionResponse extends SorobanRpcResponse

Response when polling the RPC server to find out if a transaction has been completed.

Tags
see
https://developers.stellar.org/network/soroban-rpc/api-reference/methods/getTransaction
see
GetTransactionsResponse

For batch transaction queries

see
SendTransactionResponse

For submitting transactions

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

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.

$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.

$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.

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.

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.

getXdrTransactionResult()

public getXdrTransactionResult() : XdrTransactionResult|null
Tags
throws
InvalidArgumentException

If XDR data is malformed

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.

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


        
On this page

Search results