curl --request POST \
--url https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/jsonrpc/eth_estimateGas \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "eth_estimateGas",
"id": 1,
"params": [
{
"to": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",
"from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155",
"value": "0x9184e72a"
}
]
}'
{
"jsonrpc": "<string>",
"id": 123,
"result": "<string>"
}
TRON API method that estimates the amount of gas needed to execute a transaction. This method provides Ethereum-compatible interface for TRON blockchain.
curl --request POST \
--url https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/jsonrpc/eth_estimateGas \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "eth_estimateGas",
"id": 1,
"params": [
{
"to": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",
"from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155",
"value": "0x9184e72a"
}
]
}'
{
"jsonrpc": "<string>",
"id": 123,
"result": "<string>"
}
jsonrpc
— the JSON-RPC protocol version (always “2.0”)method
— the method name (always “eth_estimateGas”)params
— array containing method parameters
transaction
— transaction object containing to, from, gas, gasPrice, value, and data fieldsid
— request identifier (number or string)jsonrpc
— the JSON-RPC protocol version (“2.0”)id
— the request identifier that matches the requestresult
— the estimated gas amount as hex stringjsonrpc eth_estimateGas
method is used for:
Estimated gas amount needed for the transaction
The response is of type object
.
Was this page helpful?