Docs

eth_estimateL1Fee - Estimate L1 Data Fee

Optimism compatibility note for eth_estimateL1Fee. Dwellir's public Optimism endpoints do not expose the L1 fee oracle on the shared archive surface.

Dwellir's public Optimism endpoints do not expose the L1 fee oracle on the shared archive surface. A live call to eth_estimateL1Fee returns -32601.

When to Use This Method

Use this page to confirm that a public Dwellir Optimism endpoint does not currently expose the L1 fee oracle. For standard transaction pricing, use eth_estimateGas and eth_gasPrice.

Live Response

JSON
{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": -32601,
    "message": "the method eth_estimateL1Fee does not exist/is not available"
  }
}

Fallback Check

JavaScript
import { JsonRpcProvider } from 'ethers';

const provider = new JsonRpcProvider('https://api-optimism-mainnet-archive.n.dwellir.com/YOUR_API_KEY');

async function supportsL1FeeOracle(txObject) {
  try {
    await provider.send('eth_estimateL1Fee', [txObject]);
    return true;
  } catch (error) {
    if (error?.code === -32601) {
      return false;
    }
    throw error;
  }
}

console.log('L1 fee oracle available:', await supportsL1FeeOracle({
  to: '0x0000000000000000000000000000000000000000',
  data: '0x'
}));

Supported Alternatives

  • Use eth_estimateGas for execution cost.
  • Use eth_gasPrice for current gas pricing.
  • Use the Optimism documentation if you need a separate L1 data fee oracle.

Need help? Contact our support team or check the Optimism documentation.