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.

Связанные методы