HyperEVM RPC
@bloxwap/smart-hyperevm is a drop-in viem transport for HyperEVM. It ranks RPC endpoints using live latency, errors, congestion, and block-head lag, then races the best candidates. Recent reads can be answered from a local cache.
Install
bun add @bloxwap/smart-hyperevmnpm, pnpm, and Yarn work too. Node.js 22.12 or later is required. viem is the only peer dependency; the package has no runtime dependencies of its own.
Create a client
import { createPublicClient } from "viem";
import { hyperEvm } from "viem/chains";
import { smartHyperevm } from "@bloxwap/smart-hyperevm";
const client = createPublicClient({
chain: hyperEvm,
transport: smartHyperevm(),
});
const block = await client.getBlockNumber();With no arguments, smartHyperevm() uses the eligible HTTP endpoints in the shipped registry. HyperEVM mainnet is chain ID 999.
Defaults
| Feature | Default behavior |
|---|---|
| Racing | Sends idempotent reads to the two best-scored endpoints. |
| Failover | Retries endpoint errors and ejects repeatedly failing endpoints. |
| Pinned latest | Uses one consistent block across endpoints. |
| Coalescing | Shares identical in-flight reads. |
| Cache | Serves recent reads at most one block behind the newest known head. |
| Log index | Maintains a rolling 1,000-block window for recent filters. |
| Background work | Refreshes hot keys and pauses in hidden browser tabs. |
These defaults trade additional upstream requests for lower latency and better availability. Disable individual features when request cost or freshness matters more.