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

@atlasauth/pca-payments

v0.4.1

Published

Payment-mandate reference for Proof-Carrying Authority: merchant/category allowlists, per-transaction and cumulative caps, auto-approve threshold, hard ceiling and bonded refunds expressed as PCA capabilities. Experimental prototype.

Readme

@atlasauth/pca-payments

Experimental prototype. A payment mandate (merchant and category allowlists, per-transaction and cumulative caps, an auto-approve threshold, a hard ceiling, and bonded refunds) expressed as a Proof-Carrying Authority (PCA) Root Intent Grant, for agentic payments. A charge at or under the auto-approve threshold is autonomous; above it needs a human co-sign; off-allowlist, wrong-currency or over-ceiling charges are denied.

Install

npm i @atlasauth/pca-payments

Depends on @atlasauth/pca.

Usage

import { generateKeyPair, encodeKey } from '@atlasauth/pca';
import { buildPaymentMandate, authorizeCharge, settleCharge } from '@atlasauth/pca-payments';

const principal = generateKeyPair();
const agent = generateKeyPair();

// Encode the mandate as a PCA Root Intent Grant + initial trust budget.
const mandate = buildPaymentMandate({
  principalSecret: principal.secretKey,
  principalPublic: encodeKey(principal.publicKey),
  agentPublic: encodeKey(agent.publicKey),
  merchants: ['acme'],
  currency: 'USD',
  perTransactionCap: 200,     // X — hard ceiling on one charge
  autoApproveThreshold: 50,   // Y — at/under ⇒ autonomous, over ⇒ human co-sign
  cumulativeCap: 1000,        // total autonomous spend between co-signs
});

const storedGrant = mandate.grant; // built here; a server loads it from its own store by the grant id
// Run a charge through the PCA decision against the grant YOU verified or stored (never the one a request carries).
// A mandate whose grant, terms or policy differ from that grant throws MandateGrantError (code
// 'mandate_grant_mismatch' / 'mandate_terms_mismatch'; 'verified_grant_required' without one).
const decision = authorizeCharge(mandate, { merchant: 'acme', amount: 40, currency: 'USD' }, storedGrant);
// decision.outcome: 'auto' | 'step_up' | 'deny'

const next = settleCharge(mandate, decision); // thread the debited budget to the next charge

chargeToPCActn(mandate, charge, { signerSecret, aud, counter }) builds the signed PCActn for a charge, and openChargeBond opens an optimistic bonded claim for dispute and refund handling. applyHumanCosign restores the autonomous budget after a human co-sign.

Status

Experimental. authorizeCharge computes a mandate decision and the derived trust budget; it does not authorize on its own, and the resource server's verifier remains the authority at run time. Use integer minor units for amounts in production to avoid float drift. Part of Proof-Carrying Authority; its cryptography has not been independently audited.

License

MIT - see LICENSE