eth_feeHistory
The eth_feeHistory method returns historical gas information for a range of blocks on the Kaia network. This data includes base fee per gas and priority fees, enabling applications to make informed decisions about gas pricing for new transactions.
This method is essential for implementing dynamic fee markets (EIP-1559), analyzing gas price trends, and helping users choose appropriate fee parameters. The historical data allows applications to predict optimal gas prices, display fee trends to users, implement intelligent fee estimation strategies, and adapt to network congestion patterns. By examining recent blocks, applications can provide better user experiences by suggesting competitive fees that balance cost and confirmation speed.
Parameters
parameter | type | description |
|---|---|---|
blockCount | string (required) | Number of blocks in the requested range (hex). Maximum is 1024 blocks |
newestBlock | string (required) | Highest block number in the range (hex) or one of the string tags: 'latest', 'earliest', or 'pending' |
rewardPercentiles | array (optional) | Array of percentile values (0-100) for priority fee distribution. For example, [25, 50, 75] returns the 25th, 50th (median), and 75th percentile priority fees for each block |
Return Object
field | type | description |
|---|---|---|
oldestBlock | string | Lowest block number in the returned range (hex) |
baseFeePerGas | array | Array of base fees per gas for each block in the range (hex). Length is blockCount + 1 as it includes the next block's base fee |
gasUsedRatio | array | Array of gas used ratios for each block. Each value is a float between 0 and 1 representing the ratio of gasUsed to gasLimit |
reward | array | Array of arrays containing priority fee percentiles for each block (hex). Only present if rewardPercentiles parameter was provided. Each inner array corresponds to the requested percentiles for that block |
Request Example
Request
Response Example
Response