Skip to main content

sendTransaction

Submit a real transaction to the Stellar network. This is the only way to make changes on-chain.

Unlike Horizon, this does not wait for transaction completion. It simply validates and enqueues the transaction. Clients should call getTransaction to learn about transaction success/failure.

This supports all transactions, not only smart contract-related transactions.

Params

(1)

Please note that parameter structure within the request must contain named parameters as a by-name object, and not as positional arguments in a by-position array

1. transaction (required)

The signed transaction to broadcast for inclusion in a ledger.

string

A Stellar transaction, serialized as a base64 string

Result

(sendTransactionResult)

Transaction status and network state. The result will include if the transaction was successfully enqueued, and information about the current ledger.

hash
string
required

Transaction hash (as a hex-encoded string)

>= 64 characters<= 64 characters
Match pattern:
^[a-f\d]{64}$
status
string
required

The current status of the transaction by hash.

Allowed values:
PENDINGDUPLICATETRY_AGAIN_LATERERROR
latestLedger
number
required

The sequence number of the latest ledger known to Soroban RPC at the time it handled the request.

latestLedgerCloseTime
string
required

The unix timestamp of the close time of the latest ledger known to Soroban RPC at the time it handled the request.

errorResultXdr
string

(optional) If the transaction status is ERROR, this will be a base64 encoded string of the raw TransactionResult XDR struct containing details on why stellar-core rejected the transaction.

diagnosticEventsXdr
array[string]

(optional) If the transaction status is ERROR, this field may be present with an array of base64 encoded strings. Each string will decode to a raw DiagnosticEvent XDR struct containing details on why stellar-core rejected the transaction.

Examples

Submitting a valid transaction using the sendTransaction method, resulting in a PENDING status.

Request

curl -X POST \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": 8675309,
"method": "sendTransaction",
"params": {
"transaction": "AAAAAgAAAAAg4dbAxsGAGICfBG3iT2cKGYQ6hK4sJWzZ6or1C5v6GAAAAGQAJsOiAAAADQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAACgAAAAVIZWxsbwAAAAAAAAEAAAAMU29yb2JhbiBEb2NzAAAAAAAAAAELm/oYAAAAQATr6Ghp/DNO7S6JjEFwcJ9a+dvI6NJr7I/2eQttvoovjQ8te4zKKaapC3mbmx6ld6YKL5T81mxs45TjzdG5zw0="
}
}' \
https://soroban-testnet.stellar.org:443 | jq

Result

{
"jsonrpc": "2.0",
"id": 8675309,
"result": {
"status": "PENDING",
"hash": "d8ec9b68780314ffdfdfc2194b1b35dd27d7303c3bceaef6447e31631a1419dc",
"latestLedger": 2553978,
"latestLedgerCloseTime": "1700159337"
}
}