Sends a transaction to a Tron smart contract, with the data already compiled to binary and encoded in hex.
The data must be encoded according to the ABI spec, starting with 0x...
See https://solidity.readthedocs.io/en/develop/abi-spec.html for spec info. This function refers only to Tron smart contracts.
NOTE: Success or failure in this API call does not necessarily mean success or failure in the transaction itself. For one example, the transaction may succeed, but the "success" response to the client can be lost if the internet is down for the client.
To verify the status of the transaction:
- Call
/getCurrentToken and store it in the DB.
- Send your transaction. The transaction created uses the token from step 1.
- Call
/getTransactionByToken using your token from /getCurrentToken to track the current status of the transaction you just sent.
Input Example:
sendTransactionToTronContractWithRawHex(
account_id=1,
contract_address="TBia4uHnb3oSSZm5isP284cA7Np1v15Vhi",
amount="0",
max_fee=500000,
raw_data_in_hex="0a020add22086c2763abadf9ed2940c8d5deea822e5a65080112610a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412300a15418840e6c55b9ada326d211d818c34a994aeced808121541d3136787e667d1e055d2cd5db4b5f6c880563049186470ac89dbea822e",
validate_transaction=True,
description="example",
specificFromAddress="TFdko4yMVrKZarYLkC8XKgjrRmhsu9D7iA"
):
----
**Response Example:**
```
{
"FunctionData": {
"ApprovalRequestStatus": 3,
"CoinType": "TRX",
"Transactions": [
{
"AmountToTransfer": "0",
"DestinationAddress": "0x0471...938d"
}
]
},
"Meta": {
"AccessToken": "a640...5477",
"Destination": "0421...e936",
"Source": "99bf...c264",
"Time": "2025-05-22 14:15:30.124"
}
}
```
account_idintegerThe account ID that owns the tokens and is granting the approval.
contract_addressstringThe address of the contract to send to.
amountstring<p>The amount send via this transaction, in the token's base unit.</p>
max_feeintegerThe maximum amount to pay the validator.
raw_data_in_hexstringBinary transaction data parsed and encoded.
validate_transactionboolean<p>When true, performs pre-execution validation to check if the transaction is likely to succeed before submission.</p>
descriptionstringInternal description for transaction records. Not sent to the blockchain.
specific_from_addressstringThe specific address to send from. Cannot be used if the account is defined as an Omnibus account.