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

@bursar/core

v0.2.0

Published

Shared types, deployment records, RPC pooling and money arithmetic for Bursar spending mandates on Robinhood Chain.

Readme

@bursar/core

The shared foundation every other package, service and the console build on. It holds the Robinhood Chain configuration, the addresses and ABIs of the deployed contracts, six-decimal money types, the RPC pool that spreads reads across independent providers, and strict environment loading. Nothing else in the workspace hard-codes an address or talks to an RPC endpoint directly.

What is in it

| Module | What it gives you | |---|---| | chain | Chain 4663 as read from the chain: USDG, Permit2, Multicall3, the minimum fee cap, the USDG EIP-712 domain. Testnet 46630 is described and refused, because USDG has no contract there. | | deployments | The address book, generated from contracts/deployments/*.json. deploymentForChain(4663) returns the live record; a superseded or retired record is never returned by chain id, and a planned one stays out of the address book until it goes live. | | generated/abi | ABIs for the seven core contracts and the settlement asset, generated from the Foundry build. | | endowments | endowmentsDeployment(4663): the endowment factory, the patron marks and the ERC-8004 identity registry its endowments are made out to. Their ABIs are in generated/abi. | | money | Micro, a bigint in six-decimal micro-USD, with parsing, formatting and arithmetic. No float touches money. | | rpc | RpcPool with per-provider rate limits, a circuit breaker and failover, and createRhcClient, a viem client on top of it. | | explorer | Explorer links and a server-only client for the hosted Blockscout index. | | gas-float | Reads the relayer's ETH balance and refuses a configuration in which two funding roles share an address. | | env | loadEnv and typed variable parsers that fail at start with every problem listed at once. |

Use

npm install @bursar/core

The SDK depends on it, so an agent rarely installs it directly. Inside this repository, depend on it with "@bursar/core": "workspace:*" and build it once with pnpm --filter @bursar/core build.

import { createRhcClient, deploymentForChain, formatMicro, RHC_MAINNET } from '@bursar/core';

const client = createRhcClient();               // reads RHC_RPC_PRIMARY and RHC_RPC_FALLBACK
const { contracts } = deploymentForChain(RHC_MAINNET.chainId);

Regenerating addresses and ABIs

src/generated/ is committed so that nobody needs Foundry installed to typecheck a service. After a contract change or a new deployment record:

cd contracts && forge build && cd ..
pnpm --filter @bursar/core codegen

A test compares the generated address book with the JSON on disk field by field, so a stale checkout fails pnpm test rather than a request.

Configuration

The package reads these only when a caller asks it to, through createRhcClient, rhcChain or createIndexClient. Services list the full set they need in their own READMEs.

| Variable | Required | Meaning | |---|---|---| | RHC_RPC_PRIMARY | yes, for createRhcClient | The endpoint this deployment chose. | | RHC_RPC_FALLBACK | no | A second provider at a different host. Defaults to https://robinhood.drpc.org. Two endpoints at one host are refused. | | RHC_RPC_TERTIARY | no | An optional third provider. | | RHC_RPC_{PRIMARY,FALLBACK,TERTIARY}_MAX_RPS | no | Request rate per provider. Defaults are measured per host. | | RHC_RPC_{PRIMARY,FALLBACK,TERTIARY}_MAX_CONCURRENCY | no | Requests in flight per provider. | | RHC_NETWORK | no | mainnet (default). testnet is refused because nothing can settle on 46630. | | RHC_MAINNET_RPC_URL, RHC_MAINNET_CHAIN_ID, RHC_MAINNET_EXPLORER, RHC_MAINNET_USDG, RHC_MAINNET_PERMIT2, RHC_MAINNET_MULTICALL3, RHC_MAINNET_MIN_FEE_CAP | no | Per-field overrides of the recorded chain values. Point RHC_MAINNET_RPC_URL at a local fork of 4663 to test against one. An override that is set but empty stops the process. | | BLOCKSCOUT_API_KEY | for index reads | Server-side key for the hosted Blockscout index. The index client refuses to run in a browser. | | BLOCKSCOUT_API_BASE | no | A different index host. |

Tests

pnpm --filter @bursar/core test

Setting BURSAR_LIVE_RPC to a Robinhood Chain endpoint adds the checks of the shipped ABIs and constants against the live deployment, and BLOCKSCOUT_API_KEY adds two that read the index for real.

License

MIT. See LICENSE.