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

@inversealtruism/csd-indexwire

v0.1.0

Published

The csd-indexer REST wire contract: TypeScript types for every served row shape (proposals, attestations, txs/outputs, health, analytics) + runtime guards that mirror the production consumer postures (fail-loud on structure, conservative on values). One s

Readme

@inversealtruism/csd-indexwire

TypeScript types + runtime guards for the csd-indexer REST wire: proposals, attestations, txs/outputs, and /health. One source of truth for a contract that was previously hand-maintained in five places (the indexer serializer, the cairnx scanner's local RawProposal, cairn's project reader, cairn-sdk's untyped IndexerClient, and each repo's test fixtures).

Posture (inherited from the production consumers, verbatim)

  • Structure fails loud. A non-array page, a missing txid, a non-ordinal height/pos throws. The CairnX resolver must freeze on last-good state rather than resolve from a malformed feed.
  • Values fail conservative. A malformed tx output is skipped, never thrown: dropping an output can only make a payment look smaller, so an uncovered fill/fee gets rejected, and one weird tx cannot DoS a scan.
  • Coercions are the resolver feed's. Ids and addresses lowercase; epochs/scores through Number(); a saturated expires_epoch stays non-safe on purpose (GRX-WIRE-CLAMP-1: the resolver's own isSafeInteger gate must fire identically on the indexer and SPV wires).

Do not "tighten" a guard here without reviewing the consumer it was extracted from: several asymmetries (e.g. confidence clamping to 0 while score passes through) are deliberate.

API

Types: ProposalRow, AttestationRow, TxRow, TxOut, HealthResponse (the snake_case wire shapes). Guards: requireArrayPage, requireOrdinal, parseProposalRow, parseAttestationRow, conservativeOutputs (+ MAX_OUTPUTS_PER_TX), parseHealth.

Adoption map (post-publish; each swap is behavior-preserving by construction)

  1. cairnx src/scan.ts: replace the local RawProposal interface with ProposalRow/ parseProposalRow, the inline attestation coercions with parseAttestationRow, reqOrd with requireOrdinal, and the output filter with conservativeOutputs. Acceptance bar: full cairnx suite green, pnpm run audit:all clean on a settled tree, /cairnx/state byte-equal before/after at an equal tip.
  2. csd-indexer: a serializer conformance test asserting every served row parses with these guards (binds the producer to the contract; no runtime change).
  3. cairn src/lib/project.ts: parse indexer rows with parseProposalRow.
  4. cairn-sdk src/indexer.ts: type the unknown returns of proposal()/attestations()/ domainProposals()/health() with these types.

Versioning: additive response fields are a minor bump; renames/removals are a major bump plus a changelog entry. The indexer's /health.version field (0.2.5+) says what the producer runs.

Tests

pnpm test — guard assertions over verbatim fixtures captured from the live Granus indexer (2026-07-03) plus adversarial structure/value cases pinning the posture above.