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

presign-guard-payer-screen

v0.1.0

Published

Screen who pays your x402 API against the OFAC SDN sanctions list before the payment settles: Express middleware, 451 for a listed payer. EVM, Solana, Algorand, XRP Ledger. No dependencies.

Readme

presign-guard-payer-screen

Screen who pays your x402 API against the OFAC SDN sanctions list, before the payment settles.

One Express middleware, placed before your x402 payment middleware. It reads the payer from the payment header and looks the address up. A listed payer gets 451 Unavailable For Legal Reasons, so the payment is never settled and the money never reaches you. Everyone else goes straight on.

  • Every x402 payment kind:
    • EVM: EIP-3009 transferWithAuthorization and Permit2.
    • Solana, Algorand and the XRP Ledger.
  • No calls, no cost per payment: the list is downloaded once and refreshed every 6 hours. It comes from presign-guard's free open copy of the US Treasury's SDN digital currency addresses. Each payment is screened in memory.
  • No dependencies.
npm install presign-guard-payer-screen
import express from "express";
import { paymentMiddleware } from "@x402/express";
import { screenPayers } from "presign-guard-payer-screen";

const app = express();
app.use(screenPayers({
  onBlocked: (info) => console.warn("refused a payment from a sanctioned address", info),
}));
app.use(paymentMiddleware(routes, resourceServer)); // your existing x402 setup

A refused payment answers:

{
  "error": "payer_sanctioned",
  "message": "This payment comes from an address on the OFAC SDN sanctions list; it was not accepted and nothing was charged.",
  "payer": "rnXyVQzgxZe7TR1EPzTkGj2jxH4LMJYh66",
  "network": "xrpl:0",
  "kind": "xrpl",
  "list": "OFAC SDN",
  "entries": [{ "name": "CHATEX", "programs": ["CYBER2"] }],
  "published": "2026-10-09"
}

Options

| Option | Default | | |---|---|---| | failClosed | false | While no list can be loaded, answer 503 instead of letting payments through. With the default, payments pass unscreened and you get one warning. | | onBlocked | none | (info, req) => … for every refused payment: log it, alert someone. | | listUrl | presign-guard's /v1/sanctions | Any URL that serves the same JSON. | | refreshMs | 6 hours | How often to download the list again. A failed refresh keeps the last good list. | | list | none | The list JSON itself, to skip the download (tests, air-gapped servers). | | screen | a new one | Share one createScreen() between middlewares. |

Other frameworks

checkPayment(header, screen) screens one header and returns { blocked, payer, network, kind, entries, published }. If there is nothing to screen, it returns { blocked: false, unscreened }. Answer 451 yourself in Hono, Next.js or a plain Node server:

import { createScreen, checkPayment } from "presign-guard-payer-screen";
const screen = createScreen();

const r = await checkPayment(req.headers.get("payment-signature") ?? req.headers.get("x-payment"), screen);
if (r.blocked) return Response.json({ error: "payer_sanctioned", payer: r.payer }, { status: 451 });

payerOf(header) gives just the payer: { payer, network, kind }.

What it covers, and what it doesn't

What it does:

  • An exact match of the payer against every digital currency address OFAC publishes in the SDN list.
  • On EVM it matches the from of the authorization.
  • On Solana it matches the transfer authority.
  • On Algorand it matches the sender of the payment transaction.
  • On the XRP Ledger it matches the Account.

What it doesn't cover:

  • Addresses of sanctioned persons that OFAC has not published.
  • Indirect exposure.
  • Lists other than OFAC SDN.

This is a tool, not legal advice.

For a full verdict on one address, use presign-guard GET /v1/screen ($0.01). It adds theft, phishing and mixer reports for EVM addresses and a signed receipt.

License

MIT