eth_gasPrice
The eth_gasPrice method returns the current gas price in sun. This method provides the Tron network's suggested gas price for transactions, which represents the amount of sun you should pay per unit of gas to have your transaction processed in a reasonable time.
It's widely used by wallets and applications to estimate transaction costs and set appropriate gas prices for user transactions. The returned value is typically based on recent blocks and represents a baseline gas price for standard transaction inclusion. Note that since EIP-1559, this method returns the legacy gas price and may not reflect the optimal maxFeePerGas and maxPriorityFeePerGas for newer transaction types. For EIP-1559 transactions, consider using eth_feeHistory or eth_maxPriorityFeePerGas instead.
Parameters
This method does not require any parameters.
Return Object
field | type | description |
|---|---|---|
result | string | The current gas price in sun encoded as a hexadecimal string. This represents the network's suggested price per unit of gas. To calculate total transaction cost, multiply this value by the estimated gas amount (e.g., 21000 for a simple transfer). |
Request Example
Response Example