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

verify-before-pay

v0.1.2

Published

Verify an x402 counterparty's settlement-grounded reputation before your agent pays it. Drop-in for any x402 client's paymentRequirementsSelector. By Crest / AgentRank.

Downloads

431

Readme

verify-before-pay

Before your AI agent releases funds over x402, check the counterparty against AgentRank's settlement-grounded verdict. Drop it into any x402 client's paymentRequirementsSelector so verification runs after the payee is known but before the payment is signed.

The payer-side complement to require-rank (which is the provider side: a service gating its caller).

Why settlement-grounded

A counterfeit agent can fake fluency, a badge, even an on-chain-looking reference. It cannot fake having actually been paid. The verdict here is recomputed from real settled USDC, weighted by payer standing. In a sealed, preregistered experiment, a fake-verifiable counterfeit beat an honest agent 99% of the time without verification; performing the check flipped it, and it held 94% even against an actively lying counterparty. Surface heuristics collapse under mimicry; only verification recovers the truth.

Install & use

import { wrapFetchWithPayment } from "x402-fetch";
import { verifyingSelector } from "verify-before-pay";

// default-on: every payment verifies its counterparty first
const fetchWithPay = wrapFetchWithPayment(
  fetch, wallet, maxValue,
  verifyingSelector({ minScore: 1, onFail: "warn" })   // surface by default; flip to "block" to refuse
);

Or check directly:

import { verifyCounterparty } from "verify-before-pay";
const v = await verifyCounterparty("0xPAYEE..."); // { verified, score, usd, payers, verdict }

Policy (all optional)

| option | default | meaning | |---|---|---| | minScore | 0 | require at least this AgentRank score (0–1000) to pass | | requireVerified | false | require settlement-verified, not just scored | | onFail | "warn" | "warn" (surface + proceed) · "block" (throw) · "allow" (silent) | | failClosed | false | on a lookup error, refuse instead of failing open | | onCheck(results) | — | callback with every verdict, for logging/telemetry | | apiBase | https://api.agentrank.info | verdict source |

Defaults are non-breaking: it always checks and surfaces, never blocks, so installing it can't break a flow. Turn on minScore / requireVerified / onFail:"block" to make it a hard gate. On a verification outage it fails open by default (a verifier outage must not halt your agent).

MIT · by Crest Deployment Systems · https://agentrank.info

Example: classify before paying

See example.mjs — a drop-in payIfTrusted() that classifies the payTo (service / buyer / rail / treasury / dust) and refuses anything that is not a real service, using the free /full counterparty endpoint.

node example.mjs blockrun.ai   # service -> would pay
node example.mjs 0x1111...      # dust    -> would refuse