Tiny real-time EVM chain health & gas status
Zero dependencies · React hook + core utility · Multi-chain
use-chain-status provides a tiny, zero-dependency utility + React
hook
to monitor:
- 🟢 Chain health (healthy / slow / degraded / offline)
- ⛽ Base fee
- 💵 Gas price (optional)
- ⚡ Congestion level
- ⏱ Block time delay
- 🔢 Latest block number
- 📈 Pending transactions (if supported)
Perfect for dashboards, wallets, block explorers, DApps, and monitoring UIs.
npm install use-chain-status
import { useChainStatus } from 'use-chain-status';
export default function App() {
const { status, loading } = useChainStatus(1);
if (loading) return <div>Loading...</div>;
return (
<div>
<p>Health: {status.health}</p>
<p>Block: {status.blockNumber.toString()}</p>
<p>Base Fee: {String(status.baseFee)}</p>
<p>Congestion: {status.congestion}</p>
</div>
);
}useChainStatus(chainId, {
rpcUrl?: string;
interval?: number; // ms
});useChainStatus(137, {
rpcUrl: 'https://polygon.llamarpc.com',
interval: 4000,
});import { getChainStatus } from 'use-chain-status';
const status = await getChainStatus(1, 'https://rpc.ankr.com/eth');Based on gasUsed / gasLimit.
-
No new block in >12s →
offline -
6s →
degraded -
Extreme congestion →
slow -
Otherwise →
healthy
You can find the full source code, issues, discussions, and documentation here:
👉 https://github.com/felaur/use-chain-status
MIT