sendTransaction

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

This method will use 10 Compute Units.


Reference: Here

Parameters

  • transaction (string)(required) The signed transaction to broadcast (serialized in base64).

Returns

  • hash string - The transaction hash (in an hex-encoded string).

  • status string - The current status of the transaction by hash.

    • Allowed values:PENDINGDUPLICATETRY_AGAIN_LATERERROR

  • latestLedger string - The latest ledger known to Soroban-RPC at the time it handled the sendTransaction() request.

  • latestLedgerCloseTime string - The unix timestamp of the close time of the latest ledger known to Soroban-RPC at the time it handled the sendTransaction() 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.

// Result
{
  "jsonrpc": "2.0",
  "id": 8675309,
  "result": {
    "hash": "a01441a4d0b80769d2c2d97dcd28d13e9036065da14ea83731424d77efc50894",
    "status": "PENDING",
    "latestLedger": "45075181",
    "latestLedgerCloseTime": "1677115742"
  }
}
curl https://mainnet.stellar.validationcloud.io/v1/<YOUR_API_KEY_HERE> \
    -X POST \
    -H "Content-Type: application/json" \
    -d '{
  "jsonrpc": "2.0",
  "id": 8675309,
  "method": "sendTransaction",
  "params": {
    "transaction": "AAAAAgAAAABzdv3ojkzWHMD7KUoXhrPx0GH18vHKV0ZfqpMiEblG1gAAp18AAAAAAAAAAgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAHN2/eiOTNYcwPspSheGs/HQYfXy8cpXRl+qkyIRuUbWAAAAGAAAAAEAAAABAAAAAPVf8W9m9DNgJmuV22+P7AHXYDEFQwauSks4BZj2z9EUAAAAAO3beL34UBBpCfUUPCfcnqX8YQKn41UhnKu6BInkVe9lAAAAAAAAAAEAAAABAAAAB+3beL34UBBpCfUUPCfcnqX8YQKn41UhnKu6BInkVe9lAAAAAQAAAAbhq+vRxjISTR62JpK1SAnzz1cZKpSpkRlwLJH6ZrzssgAAABQAAUKLAAAUkAAAAIAAAACoAAAAAAAAACEAAAAAAAAAARG5RtYAAABA+Vy3k86bNEP7rP8hb3cY1QWYhRa3CnF7jqHUj22Rd++2a0YwCKrMbofTUOb21GP6aFZwfKVvaokS22u1to5xDw=="
  }
}'

Last updated