Stellar PHP SDK API Documentation

SubmitTransactionResponse extends TransactionResponse

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
see
TransactionResponse

For base transaction response fields

see
SubmitTransactionResponseExtras

For submission extras including result codes

see
SubmitAsyncTransactionResponse

For asynchronous transaction submission

see
https://developers.stellar.org

Stellar developer docs Submit Transaction

since
1.0.0

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

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

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

getLedger()

Gets the ledger sequence number where this transaction was included

public getLedger() : int
Return values
int

The ledger sequence number

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

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

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
see
https://developers.stellar.org

Stellar developer docs Rate limiting documentation

Return values
int|null

getRateLimitRemaining()

Returns X-RateLimit-Remaining header from the response.

public getRateLimitRemaining() : int|null

The number of remaining requests for the current window.

Tags
see
https://developers.stellar.org

Stellar developer docs Rate limiting documentation

Return values
int|null

getRateLimitReset()

Returns X-RateLimit-Reset header from the response. Seconds until a new window starts.

public getRateLimitReset() : int|null
Tags
see
https://developers.stellar.org

Stellar developer docs Rate limiting documentation

Return values
int|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

getResultXdrBase64()

Gets the base64-encoded transaction result XDR

public getResultXdrBase64() : string
Return values
string

The result XDR as a base64 string

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

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


        
On this page

Search results