wallet/gettransactioninfobyid
Get detailed transaction information including receipt and logs by transaction ID.
Endpoint
POST /wallet/gettransactioninfobyid
Parameters
Required Parameters
Parameter | Type | Description |
---|---|---|
value | string | Transaction ID (hex string) |
Response
Returns transaction information including:
id
- Transaction IDfee
- Transaction fee in SUNblockNumber
- Block heightblockTimeStamp
- Block timestampcontractResult
- Contract execution resultcontract_address
- Contract address (for contract creation)receipt
- Transaction receipt with energy and bandwidth usagelog
- Transaction logs from smart contract eventsresult
- Transaction result ("SUCCESS" or error)resMessage
- Result message (if any)
Implementation Examples
- JavaScript
- Python
- cURL
// Get transaction receipt information
const response = await fetch('https://api-tron-mainnet.n.dwellir.com/YOUR_API_KEY/wallet/gettransactioninfobyid', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
value: '7c2d4206c03a883dd9066d6c839d0deaef32dc5a0d9b15f6d06e506906c90332'
}),
});
const data = await response.json();
console.log(data);
import requests
url = "https://api-tron-mainnet.n.dwellir.com/YOUR_API_KEY/wallet/gettransactioninfobyid"
payload = {
"value": "7c2d4206c03a883dd9066d6c839d0deaef32dc5a0d9b15f6d06e506906c90332"
}
response = requests.post(url, json=payload)
print(response.json())
curl -X POST https://api-tron-mainnet.n.dwellir.com/YOUR_API_KEY/wallet/gettransactioninfobyid \
-H "Content-Type: application/json" \
-d '{
"value": "7c2d4206c03a883dd9066d6c839d0deaef32dc5a0d9b15f6d06e506906c90332"
}'
Example Response
{
"id": "7c2d4206c03a883dd9066d6c839d0deaef32dc5a0d9b15f6d06e506906c90332",
"fee": 100000,
"blockNumber": 58234567,
"blockTimeStamp": 1702456789000,
"contractResult": [""],
"receipt": {
"energy_fee": 50000,
"energy_usage_total": 5000,
"net_fee": 50000,
"net_usage": 268,
"result": "SUCCESS"
},
"log": [
{
"address": "41a614f803b6fd780986a42c78ec9c7f77e6ded13c",
"topics": [
"ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"
],
"data": "0000000000000000000000000000000000000000000000000000000005f5e100"
}
],
"result": "SUCCESS"
}
Use Cases
- Transaction Confirmation: Get detailed receipt after broadcasting
- Event Monitoring: Access smart contract event logs
- Fee Tracking: Monitor energy and bandwidth consumption
- Debug Failures: Analyze failed transaction reasons
- DApp Integration: Verify transaction results in applications
Related Methods
- wallet/gettransactionbyid - Get basic transaction data
- wallet/broadcasttransaction - Broadcast signed transaction
- wallet/triggersmartcontract - Call smart contract function