eth_gasPrice - TRON RPC Method
Get current gas price on TRON. Essential for transaction cost estimation for TRC-20 transfers, wallet operations, and EVM-compatible smart contract integrations.
Returns the current gas price on TRON in wei.
Why TRON? Build on the TVM-compatible Layer 1 for TRC-20 payments, wallet APIs, and low-cost smart contract execution with TVM compatibility paired with native TRON wallet APIs, DPoS block production, and low-cost transaction flows.
Use Cases
The eth_gasPrice method is essential for:
- Transaction pricing - Set appropriate gas prices
- Cost estimation - Calculate transaction costs before sending
- Gas monitoring - Track network congestion
- DeFi operations - Optimize costs for TRC-20 transfers, wallet operations, and EVM-compatible smart contract integrations
Code Examples
curl -X POST https://api-tron-mainnet.n.dwellir.com/YOUR_API_KEY/jsonrpc \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_gasPrice",
"params": [],
"id": 1
}'Error Handling
| Error Code | Message | Description |
|---|---|---|
| -32603 | Internal error | Node error |
Related Methods
eth_maxPriorityFeePerGas- Get priority fee (EIP-1559)eth_feeHistory- Get historical fee dataeth_estimateGas- Estimate gas needed
eth_estimateGas
Estimate gas required for transactions on TRON. Essential for optimizing transaction costs for TRC-20 transfers, wallet operations, and EVM-compatible smart contract integrations.
eth_call
Execute smart contract calls without creating transactions on TRON. Essential for reading contract state for TRC-20 transfers, wallet operations, and EVM-compatible smart contract integrations.