eth_gasPrice

Helps in estimating the cost for transaction fees, ensuring efficient and accurate gas pricing for transactions on the Ethereum network

Request
Examples
curl --request POST \
     --url https://rpc.xone.org \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "eth_gasPrice"
}
'
Response
200 OK
{
  {
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "oldestBlock": "0x130b1e6",
    "reward": [
      [
        "0x5041e1e",
        "0xdd221b80"
      ],
      [
        "0x5041e1e",
        "0xb8346df0"
      ],
      [
        "0x55d4a80",
        "0xb2d05e00"
      ],
      [
        "0x4dd9818",
        "0x3b9aca00"
      ]
    ],
    "baseFeePerGas": [
      "0x52d80a82c",
      "0x50f43f659",
      "0x50012de8d",
      "0x4e30357d6",
      "0x57efff9e7"
    ],
    "gasUsedRatio": [
      0.40875283333333334,
      0.45308523333333334,
      0.4091907,
      0.9987537
    ],
    "baseFeePerBlobGas": [
      "0x1",
      "0x1",
      "0x1",
      "0x1",
      "0x1"
    ],
    "blobGasUsedRatio": [
      0.5,
      1,
      0.6666666666666666,
      1
    ]
  }
}

Request params

NameTypeDescription
idintegerRequest identifier
jsonrpcstringJSON-RPC version
methodstringAPI method name
ParametersThis method does not accept any parameters. 

Response

200
Retrieves the current gas price in wei from the latest block.
NameTypeDescription
Parametersobject 
idinteger
jsonrpcstring
resultstring