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

goatx402-quickpay

v0.1.0

Published

GoatX402 QuickPay public payer/agent library and CLI

Readme

goatx402-quickpay

Public payer/agent library and CLI for GoatX402 QuickPay. It is generic, stateless, and manifest-driven: it does not know any specific merchant — the merchant identity comes entirely from the link a merchant shares.

# inspect a merchant's payment capabilities (machine-readable JSON)
npx goatx402-quickpay inspect https://pay.goat.network/quickpay/acme/agent.md --json

# pay a custom amount via x402
npx goatx402-quickpay pay-x402 https://pay.goat.network/quickpay/acme/agent.md \
  --amount 12.50 --token-contract 0xToken --chain 4217 --wallet <privateKey>

# pay a fixed MPP route
npx goatx402-quickpay pay-mpp https://pay.goat.network/quickpay/acme/agent.md \
  --route GET:api:data --wallet <privateKey>

Library usage:

import { QuickPayClient } from 'goatx402-quickpay'

const client = new QuickPayClient('https://pay.goat.network/quickpay/acme/agent.md')
const manifest = await client.loadManifest()
const summary = await client.inspect()

Security model — the host is the trust anchor

The input link's origin (scheme://host) is the single trust anchor:

  • The merchant_id is taken from the trusted URL path, and the fetched manifest.json must self-identify as the same merchant or the command fails closed.
  • Every endpoint the CLI calls (session create/status, MPP challenge/verify) is derived from the origin. Absolute URLs embedded in the manifest are never trusted, so a tampered manifest cannot redirect a payment to another host.
  • The origin must be https:// (plaintext http:// is rejected except for loopback hosts in local dev), because an on-path attacker on plaintext could swap the session's payTo and redirect funds.

Share only links on a host you trust (e.g. pay.goat.network).

Retry safety (avoid double-paying)

pay-x402 and pay-mpp are designed so a retry never silently pays twice:

  • The broadcast tx_hash is always returned (even if confirmation polling fails), so you can resume by polling rather than re-sending.
  • A reused session (same payment intent) is not auto-paid — the CLI resumes/polls it. Only pass --force to pay-x402 to broadcast on a reused session, and only when you are certain no payment was sent (e.g. the wallet rejected the first attempt).
  • If pay-mpp fails after broadcasting, the JSON output preserves the tx_hash and challenge so you can resume verification instead of paying again.

Configuration

  • Wallet key: --wallet <privateKey> or QUICKPAY_PRIVATE_KEY.
  • Token: prefer --token-contract <address> from the manifest. --token <SYM> is accepted only when the symbol is unique on that chain.
  • RPC URL (for the on-chain transfer): --rpc <url>, or QUICKPAY_RPC_<chainId>, or QUICKPAY_RPC.

Architecture

  • client.ts — library-first QuickPayClient facade.
  • manifest.ts — link resolution, schema validation, trust-anchor enforcement.
  • inspect.ts / pay.ts — capability discovery and the x402 / MPP orchestration. The on-chain step is behind an injectable backend so the orchestration is unit tested without a chain.
  • backend-ethers.ts — real ERC20 transfer for pay-x402 (ethers v6).
  • backend-mpp-sdk.tspay-mpp delegates to goatx402-sdk's MPPClient (an optional dependency loaded at runtime).

The live on-chain flows (the actual ERC20 transfer / MPP settlement) require a chain + wallet and are not exercised by the unit tests; the manifest handling, trust-anchor enforcement, and request orchestration are.

Develop

pnpm install
pnpm typecheck   # tsc --noEmit
pnpm test:run    # vitest
pnpm build       # emit dist/