Guide

Gas and blocks

getGasData in the provider's own unit, getBlockInfo by number, and the chains where neither is a thing.

Gas

const gas = await provider.getGasData?.("base");

Etherscan and Blockscout on their EVM chains, Mempool on Bitcoin and Litecoin. Nobody else, and the reasons are on the provider pages: Blockstream's fee estimates do not match the recommendation shape, Peppool has no fee endpoint, Arweave prices storage per byte rather than per gas unit, and the rest simply do not publish fee data.

type GasUnit = "gwei" | "sat/vB" | "litoshi/vB" | "micro-lamports/CU" | "MIST";

interface GasData {
  chain: ChainKey;
  unit: GasUnit; // shared by every price field below
  safeGasPrice?: string;
  proposedGasPrice?: string;
  fastGasPrice?: string;
  baseFee?: string;
  priorityFee?: string;
}

The unit is part of the answer. gwei on EVM chains, sat/vB on Bitcoin, litoshi/vB on Litecoin. Fields a provider does not quote are absent, not zero.

Blocks

const block = await provider.getBlockInfo?.(18_000_000, "ethereum");

Etherscan, Blockscout, Blockchair, Mempool on Bitcoin and Litecoin, Blockstream, Solscan, TRONSCAN and the Arweave gateway. TONAPI and Blockberry do not expose a lookup that fits a single block number, Helius and Koios do not serve blocks, and Aptos serves nothing.

interface BlockInfo {
  number: number;
  hash: string;
  parentHash: string;
  timestamp: string; // ISO
  miner: string;
  gasUsed: string;
  gasLimit: string;
  txCount: number;
  baseFee?: string; // EIP-1559 chains
}

On chains without gas the two gas fields hold "0". That is the convention for every non-EVM provider, Arweave included, so a consumer can treat the field as always present.

CLI

explorers gas
explorers gas -c base
explorers gas -c bitcoin
explorers block 18000000
explorers block 1994692 -c arweave

@agntn/explorers·MIT license· Read-only. Addresses you type go to a public explorer API, never to a wallet.