zks_getFeeParams - Lens

Returns the current fee model parameters, including the minimal L2 gas price and the pubdata pricing configuration used by the ZK fee model.

Parameters

This method takes an empty params array.

Request

bashcurl --location --request POST 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "zks_getFeeParams",
    "params": [],
    "id": "getblock.io"
}'

example.js

javascriptconst axios = require('axios');
const response = await axios.post('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/', { jsonrpc: '2.0', method: 'zks_getFeeParams', params: [], id: 'getblock.io' }, { headers: { 'Content-Type': 'application/json' } });
console.log(response.data.result);

example.py

pythonimport requests
response = requests.post('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/', headers={'Content-Type': 'application/json'}, json={'jsonrpc': '2.0', 'method': 'zks_getFeeParams', 'params': [], 'id': 'getblock.io'})
print(response.json())

example.rs

rustuse reqwest::Client;
use serde_json::{json, Value};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    let res = client.post("https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/").json(&json!({"jsonrpc":"2.0","method":"zks_getFeeParams","params":[],"id":"getblock.io"})).send().await?.json::<Value>().await?;
    println!("{}", res["result"]);
    Ok(())
}

Response

json{
    "jsonrpc": "2.0",
    "id": "getblock.io",
    "result": {
        "V2": {
            "config": {
                "minimal_l2_gas_price": "0x17d7840",
                "compute_overhead_part": 0,
                "pubdata_overhead_part": 1,
                "batch_overhead_l1_gas": 800000,
                "max_gas_per_batch": 200000000,
                "max_pubdata_per_batch": 500000
            },
            "l1_gas_price": "0x3b9aca00",
            "l1_pubdata_price": "0x5f5e100"
        }
    }
}

Response Fields

FieldTypeDescription
V2.configobjectFee model configuration (gas prices, overheads, batch limits)
V2.l1_gas_pricestringL1 gas price component
V2.l1_pubdata_pricestringL1 pubdata price component

Use Cases

  • Fee Modelling: Read the parameters behind fee estimates
  • Analytics: Study fee configuration

Error Handling

ErrorMessageDescription
-32602 / Invalid paramsInvalid paramsA parameter was malformed
403 / RBAC: access deniedAccess deniedThe GetBlock access token is missing or incorrect