Sign and Broadcast Transaction
To complete any operation on Tron, sign the unsigned transaction provided by the Staking API and broadcast it to the network.
1. Prepare the transaction
Obtain the unsignedTransaction object provided by a transaction builder or the relevant API endpoint, e.g., /staking/delegate, /staking/vote, /staking/undelegate.
2. Sign the transaction
Use the P2P Signer SDK to sign the unsigned data following protocol specific configuration.
3. Send the transaction
Broadcast the signed transaction to the Celestia network by making a POST request to /api/v1/tron/{network}/transaction/send.
Example request:
curl --request POST \
--url 'https://api-test.p2p.org/api/v1/tron/testnet-nile/transaction/send' \
--header 'accept: application/json' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"signedTransaction": "0x7b2276697369626c65223a66616c73652c2274784944223a22..."
}'signedTransaction— signed transaction in the hexadecimal which needs to be broadcasted to the network.
Example response:
{
"error": null,
"result": {
"transactionHash": "c8e47301ca1d4a56120e6f13f0ce5f8a680e2fda221b3d8bc423cc355f924a70",
"createdAt": "2025-07-04T09:01:10.000Z",
"network": "testnet-nile",
"senderAddress": "41da53d324a354aa5924c7117caff3ead97910a5e1",
"block": null,
"status": "PENDING",
"gas": {
"bandwidthUsed": 0,
"energyUsed": 0
}
}
}transactionHash— hash of the transaction.createdAt— timestamp of the transaction in the ISO 8601 format.network— identifier of the TRON network (e.g.,mainnet,testnet-nile).senderAddress— address of the transaction sender in the base58 format.block— unique identifier of the block in which the transaction has been included.null, if still pending.status— transaction status:PENDING,FAILEDorCONFIRMED.gas— resources consumed by the transaction depending on their type:bandwidthUsed— amount of bandwidth points consumed by the transaction.energyUsed— amount of energy points consumed by the transaction.
To check the transaction status, use the transaction hash in explorers like Tronscan.
What's next?
- Staking API reference
- Unified API
Updated 8 days ago