submitTransactionAsync

suspend fun submitTransactionAsync(transactionEnvelopeXdr: String): SubmitTransactionAsyncResponse

Submits a transaction to the Stellar network asynchronously.

Unlike the synchronous version (submitTransaction), which blocks and waits for the transaction to be ingested in Horizon, this endpoint relays the response from Stellar Core directly back to the user. By default, this function checks if destination accounts require a memo as defined in SEP-0029.

Return

com.soneso.stellar.sdk.horizon.responses.SubmitTransactionAsyncResponse containing the submission status

Parameters

transactionEnvelopeXdr

Base64-encoded transaction envelope XDR

See also

Throws

when a transaction is trying to submit an operation to an account which requires a memo

All the exceptions below are subclasses of NetworkException

if the request fails due to a bad request (4xx)

if the request fails due to a bad response from the server (5xx)

if the request fails due to too many requests sent to the server

when Horizon returns a Timeout or connection timeout occurred

if the server returns an unknown status code

when the request cannot be executed due to cancellation or connectivity problems


suspend fun submitTransactionAsync(transactionEnvelopeXdr: String, skipMemoRequiredCheck: Boolean): SubmitTransactionAsyncResponse

Submits a transaction to the Stellar network asynchronously with optional memo required check.

Unlike the synchronous version, which blocks and waits for the transaction to be ingested in Horizon, this endpoint relays the response from Stellar Core directly back to the user. This is useful for fire-and-forget scenarios or when you want to poll for results separately.

The async endpoint has different HTTP status code semantics:

  • HTTP 201: Transaction submitted successfully (PENDING status)

  • HTTP 409: Duplicate transaction (DUPLICATE status)

  • HTTP 400: Either a validation error (ERROR status with error_result_xdr) or malformed request

Return

com.soneso.stellar.sdk.horizon.responses.SubmitTransactionAsyncResponse containing the submission status

Parameters

transactionEnvelopeXdr

Base64-encoded transaction envelope XDR

skipMemoRequiredCheck

Set to true to skip the SEP-0029 memo required check

See also

Throws

when skipMemoRequiredCheck is false and a transaction is trying to submit an operation to an account which requires a memo

All the exceptions below are subclasses of NetworkException

if the request is truly malformed (cannot be parsed as valid response)

if the request fails due to a bad response from the server (5xx)

if the request fails due to too many requests sent to the server

when Horizon returns a Timeout or connection timeout occurred

if the server returns an unknown status code

when the request cannot be executed due to cancellation or connectivity problems