TriportRPC

eth_gasPrice

POSThttps://triport.io/rpc/tron

Returns the current EVM gas price exposed by the Tron JSON-RPC layer.

Tron mainnettron:rpcfree+; tron_read_rpc: 15 / 20 / 100 / 250 RPS (free / basic / pro / business; default, unmeasured)

eth_gasPrice returns the EVM-facing gas price as a hex quantity. The measured example returned 0x64; consumers should parse the quantity rather than rely on that sample value remaining current.

This method is for software using the EVM compatibility layer. It is distinct from the native wallet getenergyprices method, which returns Tron energy price changes in a wallet response object.

Parameters

JSON-RPC params must be an empty array.

paramsarrayrequired
Empty array; no transaction object is accepted.

Response

Response fields

FieldTypeDescription
jsonrpcstringJSON-RPC protocol version.
idnumberCorrelates the response with the request.
resultstringCurrent gas price as an EVM hex quantity.

Errors

See Tron errors for the shared envelope.

CodeMeaningWhen it happens
-32602Invalid paramsparams contains an unexpected value.
-32601Method not foundThe requested method is outside the contract.
401UnauthorizedThe API key is missing or invalid.
429Rate limitedThe tron_read_rpc budget is exceeded.

Examples

const response = await fetch("https://triport.io/rpc/tron", {
  method: "POST",
  headers: { "x-token": process.env.TRIPORT_API_KEY, "Content-Type": "application/json" },
  body: JSON.stringify({ jsonrpc: "2.0", id: 1, method: "eth_gasPrice", params: [] }),
});
const gasPrice = BigInt((await response.json()).result);

Notes

  • Treat the response as a quantity, not a decimal string.
  • The example is a captured response, not a fixed price guarantee.
  • Related: getenergyprices exposes the native wallet view.