To sign and broadcast in a single call, use
tron_sendTransaction instead.To sign a transaction, make a Block reference fields (A successful response looks like:The Check out the API reference for more details.
POST request toref_block_bytes, ref_block_hash, expiration) are required for tron_signTransaction — fetch them fresh using TronWeb.trx.getCurrentRefBlockParams() before every request. They expire in about 60 seconds.Usage
signed_transaction is rawDataHex + signatureHex (signature = last 130 hex chars / 65 bytes). To broadcast, pass it to POST /wallet/broadcasthex on any Tron full node.Parameters
string
required
Must be
"tron_signTransaction".array
required
Array of exactly one contract —
TransferContract (TRX) or TriggerSmartContract (TRC-20 / smart
contract call). All addresses must be 41-prefixed hex.string
required
Block reference bytes — 4 hex characters. Must be fetched fresh from chain before signing.
string
required
Block reference hash — 16 hex characters. Fetched alongside
ref_block_bytes.number
required
Transaction expiration in Unix milliseconds.
number
Maximum energy fee in sun. Required for
TriggerSmartContract. 100_000_000 (100 TRX) is a safe
default for TRC-20 transfers.number
Transaction creation timestamp in Unix milliseconds. Defaults to
Date.now() if omitted.Returns
string
The signed transaction hex:
rawDataHex + signatureHex (65 bytes). Pass directly to
/wallet/broadcasthex on a Tron full node.string
Always
"hex".
