SubmitTransactionResponse
extends TransactionResponse
in package
Represents the response from synchronous transaction submission
This response extends TransactionResponse and is returned when submitting a transaction to Horizon via POST /transactions. It includes all transaction details plus submission-specific information such as result codes and XDR data for failed transactions.
The response indicates whether the transaction succeeded or failed:
- Success: Transaction was validated, included in a ledger, and all operations executed successfully
- Failure: Transaction validation or execution failed with detailed error codes in extras
Use isSuccessful() to check transaction outcome. For failures, examine extras.resultCodes to identify the specific transaction or operation error that occurred.
For fee-bump transactions, success is determined by checking both the outer result code (FEE_BUMP_INNER_SUCCESS) and the inner transaction result code (SUCCESS).
Tags
Table of Contents
Properties
- $httpClient : Client|null
- $rateLimitLimit : int|null
- $rateLimitRemaining : int|null
- $rateLimitReset : int|null
Methods
- fromJson() : SubmitTransactionResponse
- Creates a SubmitTransactionResponse instance from JSON data
- getCreatedAt() : string
- Gets the timestamp when this transaction was created
- getEnvelopeXdr() : XdrTransactionEnvelope
- Gets the parsed transaction envelope XDR
- getEnvelopeXdrBase64() : string
- Gets the base64-encoded transaction envelope XDR
- getExtras() : SubmitTransactionResponseExtras|null
- Gets the submission extras containing result codes and XDR data
- getFeeAccount() : string
- Gets the account that paid the transaction fee
- getFeeAccountMuxed() : string|null
- Gets the multiplexed fee account if applicable
- getFeeAccountMuxedId() : string|null
- Gets the multiplexed fee account ID if applicable
- getFeeBumpTransactionResponse() : FeeBumpTransactionResponse|null
- Gets the fee-bump transaction details if this is a fee-bump transaction
- getFeeCharged() : string|null
- Gets the actual fee charged for this transaction in stroops
- getFeeMetaXdr() : array<string|int, mixed>|null
- Gets the parsed fee metadata XDR as ledger entry changes
- getFeeMetaXdrBase64() : string|null
- Gets the base64-encoded fee metadata XDR
- getHash() : string
- Gets the transaction hash
- getHttpClient() : Client|null
- Gets the HTTP client used for pagination requests
- getId() : string
- Gets the unique identifier for this transaction
- getInnerTransactionResponse() : InnerTransactionResponse|null
- Gets the inner transaction details if this is a fee-bump transaction
- getLedger() : int
- Gets the ledger sequence number where this transaction was included
- getLinks() : TransactionLinksResponse
- Gets the hypermedia links to related resources
- getMaxFee() : string|null
- Gets the maximum fee the submitter was willing to pay in stroops
- getMemo() : Memo
- Gets the memo attached to this transaction
- getOperationCount() : int
- Gets the number of operations in this transaction
- getPagingToken() : string
- Gets the paging token for this transaction in list results
- getPreconditions() : TransactionPreconditionsResponse|null
- Gets the transaction preconditions if any were set
- getRateLimitLimit() : int|null
- Returns X-RateLimit-Limit header from the response.
- getRateLimitRemaining() : int|null
- Returns X-RateLimit-Remaining header from the response.
- getRateLimitReset() : int|null
- Returns X-RateLimit-Reset header from the response. Seconds until a new window starts.
- getResultMetaXdr() : XdrTransactionMeta|null
- Gets the parsed transaction metadata XDR
- getResultMetaXdrBase64() : string|null
- Gets the base64-encoded transaction metadata XDR
- getResultXdr() : XdrTransactionResult
- Gets the parsed transaction result XDR
- getResultXdrBase64() : string
- Gets the base64-encoded transaction result XDR
- getSignatures() : TransactionSignaturesResponse
- Gets the signatures attached to this transaction
- getSourceAccount() : string
- Gets the source account for this transaction
- getSourceAccountMuxed() : string|null
- Gets the multiplexed source account if applicable
- getSourceAccountMuxedId() : string|null
- Gets the multiplexed source account ID if applicable
- getSourceAccountSequence() : string
- Gets the sequence number used by this transaction
- isSuccessful() : bool
- Checks if the transaction submission was successful
- setExtras() : void
- Sets the submission extras
- setHeaders() : void
- Extracts and sets rate limiting information from HTTP response headers
- setHttpClient() : void
- Sets the HTTP client for making follow-up requests
- loadFromJson() : void
- Loads submission response data from JSON
Properties
$httpClient
protected
Client|null
$httpClient
= null
$rateLimitLimit
protected
int|null
$rateLimitLimit
= null
$rateLimitRemaining
protected
int|null
$rateLimitRemaining
= null
$rateLimitReset
protected
int|null
$rateLimitReset
= null
Methods
fromJson()
Creates a SubmitTransactionResponse instance from JSON data
public
static fromJson(array<string|int, mixed> $json) : SubmitTransactionResponse
Parameters
- $json : array<string|int, mixed>
-
The JSON array containing transaction submission response data from Horizon
Return values
SubmitTransactionResponse —The parsed transaction submission response
getCreatedAt()
Gets the timestamp when this transaction was created
public
getCreatedAt() : string
Return values
string —The creation time in ISO 8601 format
getEnvelopeXdr()
Gets the parsed transaction envelope XDR
public
getEnvelopeXdr() : XdrTransactionEnvelope
Return values
XdrTransactionEnvelope —The transaction envelope containing the transaction and signatures
getEnvelopeXdrBase64()
Gets the base64-encoded transaction envelope XDR
public
getEnvelopeXdrBase64() : string
Return values
string —The envelope XDR as a base64 string
getExtras()
Gets the submission extras containing result codes and XDR data
public
getExtras() : SubmitTransactionResponseExtras|null
Returns additional submission details including envelope XDR, result XDR, and detailed result codes for failed transactions. Null for successful transactions or when extras are not included in the response.
Return values
SubmitTransactionResponseExtras|null —The submission extras, or null
getFeeAccount()
Gets the account that paid the transaction fee
public
getFeeAccount() : string
For fee-bump transactions, this differs from the source account.
Return values
string —The fee account ID
getFeeAccountMuxed()
Gets the multiplexed fee account if applicable
public
getFeeAccountMuxed() : string|null
Return values
string|null —The muxed fee account address, or null if not muxed
getFeeAccountMuxedId()
Gets the multiplexed fee account ID if applicable
public
getFeeAccountMuxedId() : string|null
Return values
string|null —The muxed fee account ID, or null if not muxed
getFeeBumpTransactionResponse()
Gets the fee-bump transaction details if this is a fee-bump transaction
public
getFeeBumpTransactionResponse() : FeeBumpTransactionResponse|null
Return values
FeeBumpTransactionResponse|null —Fee-bump details, or null if not fee-bumped
getFeeCharged()
Gets the actual fee charged for this transaction in stroops
public
getFeeCharged() : string|null
Return values
string|null —The fee charged as a string, or null if not available
getFeeMetaXdr()
Gets the parsed fee metadata XDR as ledger entry changes
public
getFeeMetaXdr() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|null —Array of XdrLedgerEntryChange objects, or null
getFeeMetaXdrBase64()
Gets the base64-encoded fee metadata XDR
public
getFeeMetaXdrBase64() : string|null
Return values
string|null —The fee metadata XDR, or null if not available
getHash()
Gets the transaction hash
public
getHash() : string
Return values
string —The 64-character hexadecimal transaction hash
getHttpClient()
Gets the HTTP client used for pagination requests
public
getHttpClient() : Client|null
Return values
Client|null —The HTTP client instance, or null if not set
getId()
Gets the unique identifier for this transaction
public
getId() : string
Return values
string —The transaction ID
getInnerTransactionResponse()
Gets the inner transaction details if this is a fee-bump transaction
public
getInnerTransactionResponse() : InnerTransactionResponse|null
Return values
InnerTransactionResponse|null —Inner transaction details, or null if not fee-bumped
getLedger()
Gets the ledger sequence number where this transaction was included
public
getLedger() : int
Return values
int —The ledger sequence number
getLinks()
Gets the hypermedia links to related resources
public
getLinks() : TransactionLinksResponse
Return values
TransactionLinksResponse —Links to account, ledger, operations, effects, etc.
getMaxFee()
Gets the maximum fee the submitter was willing to pay in stroops
public
getMaxFee() : string|null
Return values
string|null —The max fee as a string, or null if not available
getMemo()
Gets the memo attached to this transaction
public
getMemo() : Memo
Return values
Memo —The transaction memo
getOperationCount()
Gets the number of operations in this transaction
public
getOperationCount() : int
Return values
int —The operation count
getPagingToken()
Gets the paging token for this transaction in list results
public
getPagingToken() : string
Return values
string —The paging token used for cursor-based pagination
getPreconditions()
Gets the transaction preconditions if any were set
public
getPreconditions() : TransactionPreconditionsResponse|null
Return values
TransactionPreconditionsResponse|null —Preconditions including time bounds, or null
getRateLimitLimit()
Returns X-RateLimit-Limit header from the response.
public
getRateLimitLimit() : int|null
This number represents the he maximum number of requests that the current client can make in one hour.
Tags
Return values
int|nullgetRateLimitRemaining()
Returns X-RateLimit-Remaining header from the response.
public
getRateLimitRemaining() : int|null
The number of remaining requests for the current window.
Tags
Return values
int|nullgetRateLimitReset()
Returns X-RateLimit-Reset header from the response. Seconds until a new window starts.
public
getRateLimitReset() : int|null
Tags
Return values
int|nullgetResultMetaXdr()
Gets the parsed transaction metadata XDR
public
getResultMetaXdr() : XdrTransactionMeta|null
Return values
XdrTransactionMeta|null —The transaction metadata containing ledger changes, or null
getResultMetaXdrBase64()
Gets the base64-encoded transaction metadata XDR
public
getResultMetaXdrBase64() : string|null
Return values
string|null —The metadata XDR as a base64 string, or null
getResultXdr()
Gets the parsed transaction result XDR
public
getResultXdr() : XdrTransactionResult
Return values
XdrTransactionResult —The transaction result containing operation results
getResultXdrBase64()
Gets the base64-encoded transaction result XDR
public
getResultXdrBase64() : string
Return values
string —The result XDR as a base64 string
getSignatures()
Gets the signatures attached to this transaction
public
getSignatures() : TransactionSignaturesResponse
Return values
TransactionSignaturesResponse —Collection of signature strings
getSourceAccount()
Gets the source account for this transaction
public
getSourceAccount() : string
Return values
string —The source account ID
getSourceAccountMuxed()
Gets the multiplexed source account if applicable
public
getSourceAccountMuxed() : string|null
Return values
string|null —The muxed source account address, or null if not muxed
getSourceAccountMuxedId()
Gets the multiplexed source account ID if applicable
public
getSourceAccountMuxedId() : string|null
Return values
string|null —The muxed account ID, or null if not muxed
getSourceAccountSequence()
Gets the sequence number used by this transaction
public
getSourceAccountSequence() : string
Return values
string —The source account sequence number
isSuccessful()
Checks if the transaction submission was successful
public
isSuccessful() : bool
Returns true if the transaction was successfully included in the ledger and all operations executed successfully. For regular transactions, checks for SUCCESS result code. For fee-bump transactions, verifies both the outer transaction (FEE_BUMP_INNER_SUCCESS) and inner transaction (SUCCESS) succeeded.
Return values
bool —True if transaction succeeded, false otherwise
setExtras()
Sets the submission extras
public
setExtras(SubmitTransactionResponseExtras|null $extras) : void
Parameters
- $extras : SubmitTransactionResponseExtras|null
-
The submission extras to set
setHeaders()
Extracts and sets rate limiting information from HTTP response headers
public
setHeaders(array<string|int, mixed> $headers) : void
This method processes the X-Ratelimit-* headers from the HTTP response and stores them for client access.
Parameters
- $headers : array<string|int, mixed>
-
Associative array of HTTP headers from the response
setHttpClient()
Sets the HTTP client for making follow-up requests
public
setHttpClient([Client|null $httpClient = null ]) : void
Paginated responses contain links to next/previous pages. This HTTP client is used when following those links to fetch additional pages.
Parameters
- $httpClient : Client|null = null
-
The Guzzle HTTP client to use for pagination
loadFromJson()
Loads submission response data from JSON
protected
loadFromJson(array<string|int, mixed> $json) : void
Parameters
- $json : array<string|int, mixed>
-
The JSON array containing transaction submission response data