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

@celo/buy

v0.5.0

Published

buy — HTTP 402 stablecoin payments on Celo

Downloads

581

Readme

@celo/buy

buy pays HTTP 402 Payment Required challenges with USDC or USDT on Celo. It signs with a wallet held in your OS keychain, retries the request with an X-PAYMENT header, and can attach a Self.xyz proof when an endpoint requires one.

Node.js 20 or newer is required. No clone, npm login, or global install is needed.

Quickstart

Create a dedicated wallet. Celo mainnet is the default network:

npx --yes @celo/[email protected] setup --name demo

Fund the printed address with a small amount of USDC or USDT on Celo mainnet. The gateway sponsors transaction gas, so the buyer does not need CELO.

Create a Self proof if you plan to buy an e2-standard-* machine — the shared-core sizes (e2-micro, e2-small, e2-medium) need none. Scope buy.celo, minimum age 18, and OFAC screening are defaults; the gateway verifies against the Self mainnet hub, so a real passport is required and mock proofs are rejected:

npx --yes @celo/[email protected] verify hosted \
  --endpoint https://usebuy.ai/self/api/verify

The gateway hosts the Self receiver, so nothing listens on this machine and no cloudflared is needed. The --endpoint is whatever the 402 challenge pinned — a failed buy curl prints the whole command with it filled in, which beats typing it. Against a gateway that pins no endpoint, use verify serve instead; that one hosts a receiver locally and does need cloudflared.

Neither command ever receives the wallet private key.

Buy a one-hour e2-micro VM and run a script. Preserve the response because its poll URL is the capability used to collect the result:

(
  umask 077
  set -o pipefail
  response_file=$(mktemp ./buy-vm.XXXXXX) || exit
  npx --yes @celo/[email protected] --verbose curl \
    --max-amount 0.02 \
    -X POST \
    --data '{"script":"uname -a; nproc","machineType":"e2-micro"}' \
    https://usebuy.ai/gcloud/vm | tee "$response_file"
  response_status=$?
  printf 'Private response saved to %s\n' "$response_file" >&2
  exit "$response_status"
)

The response contains a poll URL. Call it until scriptStatus is done; polling is free:

npx --yes @celo/[email protected] curl '<poll-url>'

USDC is the default payment token. Add --token USDT to the paid command to use USDT.

Limits and safety

The public service uses on-demand VMs in us-west1 and supports e2-micro, e2-small, e2-medium, e2-standard-2, e2-standard-4, and e2-standard-8. Quotes are authoritative. The service limits leases to one hour at a time and 24 hours total, admits at most 200 VMs, and stops admission at $25/hour of catalogued compute. /gcloud/ssh is enabled and priced identically to /gcloud/vm for the same machine type.

Mainnet payments are real and irreversible. Use a dedicated low-balance wallet and always set --max-amount. Do not automatically retry 500 provision_failed or 500 settle_uncertain; settlement may already have occurred. A 4xx or 503 refusal happens before settlement.

buy receipts --account demo lists local payment history, but streamed buy curl receipts currently do not retain the paid response, transaction hash, poll URL, instance, IP, or correlation ID. Until cpay#85 is fixed, keep the generated private response file until the lease ends; a missing recovery field is not a reason to pay again.

Other commands

npx --yes @celo/[email protected] --help
npx --yes @celo/[email protected] whoami
npx --yes @celo/[email protected] mcp install --client all

Wallet configuration and receipts persist between npx invocations. BUY_HOME chooses a different data directory. Existing installations continue to use ~/.config/cpay (legacy default) and the existing OS-keychain entry. buy fetch remains the compatibility alias; new usage should prefer buy curl.

This is pre-1.0 beta software without an external security review. It is not intended for production use.

License: Apache-2.0