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

@metanet-games/coinslot

v0.1.0

Published

Drop-in micropayment paywall + tip rail for games — priced products, entitlements (durable / N-uses / timed) and receipts, over a pluggable wallet adapter (HandCash, Yours). Zero deps.

Readme

@metanet-games/coinslot

A drop-in micropayment paywall + tip rail for games — the chain as the coin slot. Zero deps.

Define priced products (a continue, a day pass, an unlock, a tip); buy() / require() them. coinslot tracks entitlements per player and keeps receipts. It doesn't move money itself — you plug in a payment adapter (HandCash Connect, Yours, or a test stub), so it's not welded to one wallet.

import { createCoinslot } from "@metanet-games/coinslot";
import { anon } from "@metanet-games/chaintag";

const slot = createCoinslot({
  identity: anon(localStorage),          // entitlements follow the player
  store: localStorage,                    // persist across sessions
  pay: async ({ amountSats, amountFiat, description }) => {
    // call HandCash Connect / Yours here; return the result
    const { transactionId } = await handcash.pay({ sats: amountSats, note: description });
    return { ok: true, txid: transactionId, amountSats };
  },
});

slot.define("continue", { sats: 100, uses: 1 });        // consumable
slot.define("daypass",  { fiat: 0.10, ttl: 86400000 }); // timed
slot.define("nolimit",  { sats: 5000 });                // durable unlock

// gate an action — charges only if not already entitled
if ((await slot.require("continue")).ok) { slot.use("continue"); respawn(); }

slot.entitled("nolimit");   // bool
slot.receipts();            // [{ product, payer, amountSats, txid, ts }]

Entitlement kinds

  • durable{ sats } only: bought once, entitled forever.
  • N-uses{ sats, uses: N }: use() decrements; entitled while uses remain.
  • timed{ fiat, ttl: ms }: a pass valid until it expires; use() doesn't spend it.
  • combine uses + ttl for "N plays valid 24h".

Two rules it enforces (because it spends real money)

  1. Never auto-charges. Payment happens only on an explicit buy()/require() your app calls from a user action. A connected wallet is an account, not standing permission to charge.
  2. Paid ⇒ granted, always. On adapter success the receipt and entitlement are recorded before returning — the worst failure is taking money and withholding what was bought.

The payment adapter converts fiat→sats and settles; coinslot records res.txid in the receipt, so you can anchor/verify it on-chain (e.g. via bsv.cx) if you want tamper-evident sales.

See SPEC.md.

Apache-2.0 © metanet.games