Queried by: developerswalletsanalytics
The Big Picture
The base fee is the minimum gas price for transactions. It adjusts up when blocks are full and down when empty. Users pay base fee (burned) + priority fee (to validators).
Use Cases
- Estimate transaction costs
- Set gas price in transactions
- Track fee trends
- Build gas price oracles
Purpose & Usage
Purpose
Stores the base fee for the next block's transactions.
Common Query Patterns
- Single value query
Stored Value
value (U256)
Relationships
Modified By
Related Events
Code Examples
import { ApiPromise, WsProvider } from "@polkadot/api";
import { stringCamelCase } from "@polkadot/util";
const provider = new WsProvider("wss://entrypoint-finney.opentensor.ai:443");
const api = await ApiPromise.create({ provider });
// Query BaseFeePerGas storage (no keys - plain value)
const result = await api.query
[stringCamelCase("BaseFee")]
[stringCamelCase("BaseFeePerGas")]();
console.log("BaseFeePerGas:", result.toHuman());Runtime Info
- Pallet
- BaseFee
- Storage Kind
- Plain
- First Version
- v210
- Current Version
- v393