L0vdL0vd

eth_gasPrice

Returns the node's current suggested gas price.

curl https://eth.l0vdinfra.com/YOUR_KEY \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"jsonrpc":"2.0","id":1,"method":"eth_gasPrice","params":[]}'

响应示例

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x7d182b9"
}
参数与您的端点

参数

此方法没有参数。

返回值

string Gas price in wei, hex.

适用场景

Get a quick legacy gas price suggestion in wei.

如何解读结果

Hex wei. Divide by 10^9 for gwei.

提示

  • For EIP-1559 transactions prefer eth_feeHistory and eth_maxPriorityFeePerGas to set maxFeePerGas and the tip.

相关方法