broadcasttransaction - Tron

broadcasttransaction. Broadcasts a signed transaction to the Tron network.

broadcasttransaction - tron [Value: 20CU]
Broadcasts a signed transaction to the Tron network.
Use cases

Use cases

  • Submit a signed TRX or TRC10/TRC20 transfer to the network
  • Complete a smart contract call after local or offline signing
Constraints

Constraints

  • raw_data_hex must exactly match the bytes that were signed
  • Transactions expire (default ~60 seconds) and must be broadcast before expiration
Get started
Unlock Access to 100+ chains
Boost your app's speed and reliability with dRPC - get your access API key

Language

Request
Examples
curl --request POST \
     --url https://lb.drpc.live/tron/{API-KEY}/wallet/broadcasttransaction \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '{
  "raw_data": {
    "contract": [ one contract],
    "ref_block_bytes": "c145",
    "ref_block_hash": "c56bd8a3b3341d9d",
    "expiration": 1646796363000,
    "data": "74657374",
    "timestamp": 1646796304152,
    "fee_limit": 10000000000
  },
  "signature": [
    "47b1f77b...8b0a1800"
  ]
}'
Copy
Response
200
{
  "result": true,
  "txid": "f3c9aa2b4d122979f92a658be1804560f949a89c8b5d30e15b2d003712d72c92"
}
Copy

Request params

idinteger
jsonrpcstring
methodstring
Parametersobject
object
raw_dataobject
The unsigned transaction body containing the contract instruction and blockchain reference data.
object
contractarray_of_objects
The list of contract instructions to be executed by this transaction (in most transactions, a single-element array).
ref_block_bytesstring
The last two bytes of the reference block number, used for transaction expiration and replay protection.
ref_block_hashstring
The last eight bytes of the reference block's hash, paired with ref_block_bytes for replay protection.
expirationinteger
Unix timestamp, in ms, after which this transaction is no longer valid and will be rejected by the network.
datastring
Hex-encoded optional memo/note attached to the transaction (up to 512 bytes).
timestampinteger
Unix timestamp, in ms, marking when the transaction was created/signed by the client.
fee_limitinteger
The maximum amount of TRX, in sun, the sender is willing to spend on Energy fees for this transaction (required for contract calls).
signaturearray_of_strings
The list of hex-encoded signatures authorizing this transaction, one entry per required signing key.

Response

200
Broadcasts a signed transaction to the Tron network.

Response params

object
resultboolean
Whether the node accepted the transaction into its pending pool
txidstring
The transaction hash, usable with gettransactionbyid / gettransactioninfobyid
codestring
Present only on failure, e.g. SIGERROR, TRANSACTION_EXPIRATION_ERROR, DUP_TRANSACTION_ERROR
messagestring
Present only on failure, a hex-encoded explanation of the error