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

arc-honest-money

v0.1.0

Published

Four dependency-light primitives for verifiable agent money on Arc: prove an x402 payment, cap agent spend in code, cross-check a price against a second venue, and pay with an on-chain reconcilable memo.

Readme

arc-honest-money

Four dependency-light primitives for verifiable agent money on Arc, extracted from Cronus Capital. MIT. Fork freely.

npm i arc-honest-money

Importing this package pulls in zero runtime dependencies, reads no environment variables and has no side effects. viem is an optional peer dependency, loaded lazily only by the one function that signs a transaction.

verifyX402Payment - prove you were paid

A seller must be able to prove payment, not assume it. Given a tx hash, confirm an on-chain USDC Transfer of at least minAmount to your payTo. Raw JSON-RPC, no SDK. Works for plain transfers and memo-wrapped ones, because the inner USDC Transfer is still emitted.

const r = await verifyX402Payment({ txHash, payTo, minAmount: "20000" })
// { paid: true, payer: "0x...", amount: "20000", block: "0x2a" }
// underpaid -> { paid: false, reason: "underpaid: ...", amount, minAmount }

decideSpend - cap agent spend in code, not in the prompt

Money safety belongs in code. A pure, deterministic gate over atomic units: a model may propose a number, but the caller enforces the hard cap, so a hallucinated or adversarial amount can never overspend. Fails closed on malformed input, exact at any magnitude.

decideSpend({ spentAtomic: "900000", amountAtomic: "200000", capAtomic: "1000000" })
// { allowed: false, reason: "exceeds remaining budget", remainingAtomic: "100000" }

const breaker = createBreaker("1000000")  // in-process; back it with Redis in prod

crossCheck - corroborate a price against a second venue

A single venue can glitch or be manipulated. Compare a primary price against an independent public spot and report the spread. Advisory and fail-open: on any failure agree stays null - it annotates, it never fabricates a price.

await crossCheck("BTC-USDC", 64000, { tolPct: 0.5 })
// { source: "coinbase", altPrice: 64100, spreadPct: 0.1563, agree: true }

payWithMemo - pay with an on-chain reconcilable reference

Pay any x402 resource through Arc's memo wrapper, attaching an indexed reference to the transfer while keeping your own wallet as msg.sender. The same topic always hashes to the same memoId, so payments are groupable on-chain. Requires viem.

const { payment, unlocked } = await payX402WithMemo({
  url: "https://your-endpoint/api/signal?topic=BTC-USDC%20momentum",
  privateKey: process.env.BUYER_PRIVATE_KEY,
  topic: "BTC-USDC momentum",
})

Why these four

Arc's value is verifiable money. These are the pieces of an honest x402 economy: a seller can prove it was paid, a buyer can pay with context, an agent can cap its own spend, and a signal can be cross-checked before it is trusted.

Design rules

  • Fail closed on money, fail open on data. A spend decision denies on malformed input; a price cross-check returns agree: null rather than inventing a number.
  • Injectable I/O. Every network call accepts a fetchImpl, so the whole surface is testable without a network and without mocking globals.
  • Atomic units everywhere. No floats in money paths.
  • Importable from a serverless handler. No top-level env reads, no top-level signing.

Status

v0.1.0. Extracted from the Cronus Capital codebase and published so the primitives can be forked and imported on their own. Cronus is migrating its own call sites onto this package module by module, starting with the price cross-check.

Tests

npm test          # 42 tests, no network
npm run selftest

CLI

node src/verify-x402-payment.mjs <txHash> <payTo> <minAmount>
node src/spend-breaker.mjs selftest
node src/price-crosscheck.mjs BTC-USDC 64000 0.5
node src/pay-with-memo.mjs "BTC-USDC momentum"

License

MIT (c) Cronus Capital