eth_feeHistory

Returns transaction base fee per gas and effective priority fee per gas for the requested/supported block range.

Parameters

  1. BlockCount - Requested range of blocks (between 1 to 1024 blocks).

  2. NewestBlock - Highest block of the requested range. Choose 1 of the following options:

    • A hexadecimal block number.

    • "earliest" - the earliest/genesis block.

    • "latest" - the latest mined block.

    • "safe" - the latest safe head block.

    • "finalized" - the latest finalized block.

    • "pending" - the pending state/transactions.

  3. RewardPercentiles - A monotonically increasing list of percentile values. For each block in the requested range, the transactions will be sorted in ascending order by effective tip per gas and the corresponding effective tip for the percentile will be determined, accounting for gas consumed.

Sample Request

curl https://lb.nodies.app/v1/<INSERT URL> \
   -H "x-api-key: <API-KEY>" \
   -X POST \
   -H "Content-Type: application/json" \
   -d '{ 
  "id": 1,
  "jsonrpc": "2.0",
  "method": "eth_feeHistory",
  "params": [
    "0x5",
    "pending",
    [
      10,
      20
    ]
  ]
}'

Sample Response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "oldestBlock": "0x6eafae",
    "reward": [
      [
        "0x15",
        "0x15"
      ],
      [
        "0x3b9aca01",
        "0x3b9aca01"
      ],
      [
        "0x15",
        "0x15"
      ],
      [
        "0x0",
        "0x0"
      ],
      [
        "0x3b9aca00",
        "0x3baa0c3f"
      ]
    ],
    "baseFeePerGas": [
      null,
      null,
      null,
      null,
      null,
      "0x0"
    ],
    "gasUsedRatio": [
      0.78,
      0.53522965,
      0.4875,
      0.16980405,
      0.62050145
    ]
  }
}

Last updated