eth_feeHistory - Flow EVM RPC Method
Get historical gas fee data on Flow EVM Gateway. Essential for fee prediction for consumer NFTs (NBA Top Shot, Disney Pinnacle), gaming dApps, and hybrid Cadence-EVM applications.
Returns historical gas information on Flow EVM Gateway for fee estimation.
Use Cases
- Fee prediction - Estimate future gas prices based on history
- Gas analytics - Analyze fee trends over time
- Optimal timing - Find best times for transactions on consumer NFTs (NBA Top Shot, Disney Pinnacle), gaming dApps, and hybrid Cadence-EVM applications
Request Parameters
Number of blocks in the range
Highest block of the range
Percentiles to sample for priority fees
Response Body
Code Examples
curl -X POST https://api-flow-evm-gateway-mainnet.n.dwellir.com/YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_feeHistory",
"params": ["0x5", "latest", [25, 50, 75]],
"id": 1
}'import { JsonRpcProvider, formatUnits } from 'ethers';
const provider = new JsonRpcProvider('https://api-flow-evm-gateway-mainnet.n.dwellir.com/YOUR_API_KEY');
const feeHistory = await provider.send('eth_feeHistory', ['0xa', 'latest', [25, 50, 75]]);
console.log('Base fees:', feeHistory.baseFeePerGas.map(f => formatUnits(f, 'gwei')));
console.log('Reward (25th percentile):', feeHistory.reward.map(r => formatUnits(r[0], 'gwei')));from web3 import Web3
w3 = Web3(Web3.HTTPProvider('https://api-flow-evm-gateway-mainnet.n.dwellir.com/YOUR_API_KEY'))
fee_history = w3.eth.fee_history(10, 'latest', [25, 50, 75])
print(f'Base fees: {[w3.from_wei(f, "gwei") for f in fee_history["baseFeePerGas"]]}')Related Methods
eth_gasPrice- Get current gas priceeth_maxPriorityFeePerGas- Get priority fee
eth_maxPriorityFeePerGas
Get recommended priority fee on Flow EVM Gateway. Essential for EIP-1559 transactions for consumer NFTs (NBA Top Shot, Disney Pinnacle), gaming dApps, and hybrid Cadence-EVM applications.
eth_call
Execute smart contract calls without creating transactions on Flow EVM Gateway. Essential for reading contract state for consumer NFTs (NBA Top Shot, Disney Pinnacle), gaming dApps, and hybrid Cadence-EVM applications.