chain_l2_fee
OP Stack L2 fee estimate (Base/Optimism) — Full cost of a transaction on Base or Optimism = L2 execution fee (gas price x gas) + L1 data fee (GasPriceOracle getL1FeeUpperBound), in ETH and USD (Chainlink ETH/USD). Returns L1 base fee, blob base fee, scalars and estimates for ETH transfer, ERC-20 transfer, DEX swap and NFT mint. Pass chain= (base or optimism); optional gas=, data= (0x calldata) or data_bytes= for your own transaction. Price: $0.002 USDC (Base, via x402).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"chain": "<chain>"
},
"name": "chain_l2_fee"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chain | Yes | base |