Executes a message call immediately in a read-only manner without creating a transaction on the blockchain (functionally equivalent to triggerConstantContract).
Parameters
-
Object- The transaction call object, The fields in the object include:Item Name Data Type Description fromDATA, 20 BytesCaller address, using TRON's hexadecimal address format with the 41prefix removed.toDATA, 20 BytesContract address, using TRON's hexadecimal address format with the 41prefix removed.gasQUANTITYThis field is not used by the current implementation. gasPriceQUANTITYThis field is not used by the current implementation. valueQUANTITY(Optional) Amount of TRX sent with the call (Unit: sun, Format: Hex). Maps to msg.valuefor simulation; no actual funds are transferred.dataDATAFunction selector and ABI-encoded parameters; lenient hex parsing is retained for compatibility with legacy clients. inputDATAAlias for data; takes precedence when both are present. A non-empty value requires a0xprefix and an even number of hex digits; an empty string represents empty bytes. -
QUANTITY|TAG|Object- The string form currently supports only"latest". The object form may containblockNumberorblockHash; the node verifies that the referenced block exists, but still executes against the latest state rather than historical state.
earliest, pending, finalized, and safe are not accepted as string block tags by this method. If an object contains both blockNumber and blockHash, blockNumber takes precedence.
Example
Request
curl -X POST 'https://api.shasta.trongrid.io/jsonrpc' --data '{
"jsonrpc": "2.0",
"method": "eth_call",
"params": [{
"from": "0xF0CC5A2A84CD0F68ED1667070934542D673ACBD8",
"to": "0x70082243784DCDF3042034E7B044D6D342A91360",
"gas": "0x0",
"gasPrice": "0x0",
"value": "0x0",
"data": "0x70a08231000000000000000000000041f0cc5a2a84cd0f68ed1667070934542d673acbd8"
}, "latest"],
"id": 1
}'Response
{"jsonrpc":"2.0","id":1,"result":"0x"}