/wallet/broadcasttransaction - Tron

This endpoint submits a signed transaction to the network. It accepts the full signed transaction object and returns whether it was accepted.

Parameters

ParameterTypeRequiredDescription
transactionobjectYesThe full signed transaction object, including the signature array

Request

bashcurl --location --request POST 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/wallet/broadcasttransaction' \
--header 'Content-Type: application/json' \
--data-raw '{
  "txID": "d5ec749ecc2a615399d8a6c864ea4c74ff9f523c2be0e341ac9be5d47d7c2d62",
  "raw_data": {
    "contract": []
  },
  "raw_data_hex": "0a02...",
  "signature": [
    "a1b2c3...signature"
  ]
}'

example.js

javascriptconst response = await fetch(
    'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/wallet/broadcasttransaction',
    {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({"txID": "d5ec749ecc2a615399d8a6c864ea4c74ff9f523c2be0e341ac9be5d47d7c2d62", "raw_data": {"contract": []}, "raw_data_hex": "0a02...", "signature": ["a1b2c3...signature"]})
    }
);
console.log(await response.json());

example.py

pythonimport requests

response = requests.post(
    'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/wallet/broadcasttransaction',
    headers={'Content-Type': 'application/json'},
    json={"txID": "d5ec749ecc2a615399d8a6c864ea4c74ff9f523c2be0e341ac9be5d47d7c2d62", "raw_data": {"contract": []}, "raw_data_hex": "0a02...", "signature": ["a1b2c3...signature"]}
)

print(response.json())

Response

json{
  "result": true,
  "txid": "d5ec749ecc2a615399d8a6c864ea4c74ff9f523c2be0e341ac9be5d47d7c2d62"
}

Response Parameters

FieldTypeDescription
resultbooleantrue when the transaction is accepted into the mempool
txidstringThe transaction id, on acceptance
codestringRejection code, when the transaction is not accepted
messagestringRejection reason, when the transaction is not accepted

Use Cases

  • Payment Broadcast: Submit a signed TRX or token transfer
  • Contract Calls: Broadcast a signed triggersmartcontract transaction
  • dApp Backends: Relay transactions signed on the client
  • Retry Flows: Resubmit a signed transaction from stored data

Error Handling

HTTP StatusMessageDescription
200OKReturns result true on acceptance, or a code and message on rejection
400Bad requestThe signed transaction is malformed
500Internal errorThe node failed to broadcast the transaction