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

@winsznx/pennymeter

v0.1.0

Published

Pay-per-message AI escrow SDK for Penny on Celo (cUSD) + Stacks. Tier registry, message-hash builder, top-up + dispute helpers, rate previews.

Downloads

94,718

Readme

pennymeter

TypeScript SDK for Penny — pay-per-message AI escrow on Celo (cUSD) + Stacks. Tier registry, deterministic message hash builder, top-up + dispute helpers, milestone ladder.

pnpm add @winsznx/pennymeter viem

viem is a peer dependency (^2.21.0). The Stacks subpath is dependency-free.

What's in the box

  • Tier registryhaiku-4-5, sonnet-4-6, opus-4-7 with stable keccak ids matching the contract
  • buildMessageHash — deterministic keccak(sender|nonce|text) so register / settle never collide
  • Rate estimatorestimateCostWei(tier, tokens) for the "you'll pay X" preview
  • Milestone ladder — five rungs (1 / 10 / 100 / 500 / 2500 messages) + nextMilestone() helper
  • Celo bindingsreadBalance, readMessageCount, readEffectiveRate, writeTopUp, writeSelfRegisterMessage, ensureAllowance
  • Stacks call shapestopUpCall, selfRegisterCall, claimMilestoneCall, setReferrerCall, claimStxCall
  • Hiro v2 balance + tx-count fetch

Layout

@winsznx/pennymeter          chain-neutral utilities
@winsznx/pennymeter/celo     viem reads/writes for Penny.sol
@winsznx/pennymeter/stacks   hiro v2 + Clarity call-shape builders

Quick start — Celo

import { makePublicClient, readBalance, readMessageCount, writeTopUp } from "@winsznx/pennymeter/celo";
import { formatCusd, parseCusd, TIERS, buildMessageHash } from "@winsznx/pennymeter";

const client = makePublicClient({ selector: "mainnet" });
const me = "0xabc...";

const balance = await readBalance(client, me);
console.log("Balance:", formatCusd(balance), "cUSD");

const count = await readMessageCount(client, me);
console.log("Messages on chain:", count.toString());

// Build a deterministic hash before sending:
const msgHash = buildMessageHash({ sender: me, nonce: Number(count) + 1, text: "Hello" });

Tier rate estimate

import { TIERS, estimateCostWei, formatCusd } from "@winsznx/pennymeter";

const cost = estimateCostWei(TIERS["sonnet-4-6"], /* tokens */ 1500);
console.log("Estimated:", formatCusd(cost), "cUSD");

Stacks — open the wallet to register

import { selfRegisterCall, fetchStxBalance } from "@winsznx/pennymeter/stacks";
import { buildMessageHash, TIERS } from "@winsznx/pennymeter";

const shape = selfRegisterCall(
  {
    msgHash: buildMessageHash({ sender: "0xabc...", nonce: 1, text: "hi" }),
    modelId: TIERS["haiku-4-5"].id,
    reportedCost: 100_000n,
  },
  "mainnet",
);

// Pass `shape` into @stacks/connect's request("stx_callContract", shape) in your app.

Addresses

Develop

pnpm install
pnpm typecheck
pnpm test
pnpm build

License

MIT — see LICENSE.