npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@balq/viem

v0.4.0

Published

viem transport that reads your contracts' storage from a local balq archive (EIP-7928 Block Access Lists) and falls back to your RPC for everything else

Readme

@balq/viem

Read your contracts' state from a local balq archive instead of an archive RPC — with the code you already have.

npm i @balq/viem viem
balq index 0xYourContract --rpc $NODE --layout out/YourContract.sol/YourContract.json --serve
import { createPublicClient, http } from "viem";
import { balq } from "@balq/viem";

const client = createPublicClient({
  chain,
  transport: balq({ fallback: http(process.env.RPC_URL) }),
});

// Exactly as before. Now answered by balq when it can, by the RPC when it cannot.
await client.readContract({ address, abi, functionName: "balanceOf", args: [user], blockNumber: 18_000_000n });
await client.getStorageAt({ address, slot: "0x5", blockNumber: 18_000_000n });

// Private variables have no getter; ask by name.
await client.request({ method: "balq_getField", params: [address, "_reserves[0x…]", "0x112a880"] });

What is served locally

| call | served by balq when | |---|---| | eth_getStorageAt(addr, slot, block) | addr is indexed and block is in the archive | | eth_call({ to, data }, block) | data is the compiler-generated getter of a public variable in to's layout — values, mappings (balances(addr)), nested mappings, arrays (items(i)), structs (the members as a tuple). Verified against the block header, ABI-encoded like the node would. | | balq_getField(addr, "path", block) | any variable by name, private included: { value, kind, slot, setAt, provenance } | | eth_blockNumber | the archive head |

Everything else — eth_call on a view with logic (getReserves()), other contracts, logs, transactions, eth_chainId — goes to fallback untouched. So does every miss (NotWatched, AfterHead, BeforeStart, NeverRecorded, UnknownBefore), unless strict: true, in which case a miss throws BalqRpcError with .balqCode.

latest is served from balq only while the archive is at most headLag blocks (default 1) behind the node; otherwise the fallback answers, so a read-then-send flow never sees stale state.

Options

balq({
  url: "http://127.0.0.1:7928",   // balq index --serve
  fallback: http(RPC_URL),        // strongly recommended
  strict: false,                  // true: throw on misses instead of falling back
  addresses: ["0x…"],             // route only these through balq
  headLag: 1,                     // 0 disables the head check for `latest`
})

Works with anything built on viem — Ponder, wagmi's server side, your own indexer or bot. The archive is verified against block headers; the RPC is never trusted for what balq answers.