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

@wzrd_sol/plugin-trustgate

v0.3.4

Published

Buyer-side x402 reputation gate: free TWZRD ReadinessCard preflight before signing, opt-in canSpendSafely, facilitator onBeforeSettle (daydreams), and Faremeter payerChooser pre-sign guard. Fail-closed by default; no keys or auto-spend.

Readme

@wzrd_sol/plugin-trustgate

Buyer-side x402 trust gate for elizaOS agents. Before your agent signs a payment to a seller, score that seller via the free TWZRD preflight (ReadinessCard: allow / warn / block) and refuse block-rated merchants. No auth, no cost, no Solana dependency in the gate; fail-closed by default.

Dated refuse proof (free, no-spend)

Status (2026-07-16): mechanism proof — not adoption or demand.

Current compatible fetch-gate release:

npm install [email protected]

The results below were captured on 2026-07-16, before 0.8.2 was published. They are dated mechanism evidence, not a claim that this exact release command was rerun for the current package.

Verified live (2026-07-16):

| Fixture | preflight_id | decision | note | |---------|--------------|----------|------| | 7G73PL… wash dogfood | 378468 | block | wash_flagged=true | | HuSiSpc… | 378469 | block | wash_flagged=true, fleet≈98% | | BJGds… alt wash | 378470 | warn | wash_flagged=true (nuance — not all wash is hard-block) | | 4LkEF… clean control | 378471 | warn | not wash |

Gate dogfood: approved=false reason=twzrd_decision_block, USDC spent = 0, tx broadcast = none, ALL PASS.

Public transcript: https://gist.github.com/twzrd-sol/2882bddee912f89e99061f3bc1da8227

Accurate paste line:

Preflight returned decision=block on wash seller 7G73PL… / HuSiSpc… (preflight_id 378468 / 378469, wash_flagged=true). Gate approved=false reason=twzrd_decision_block. No USDC spent. No tx broadcast. Transcript: gist above. Current paired gate release: [email protected].

This transcript demonstrates that the free gate blocked known wash sellers with stamped preflight_ids and zero spend on that date. It is not proof that external agents already default to this path at scale.

Marketplace alignment (honest scope)

TWZRD's full free buyer sequence on the marketplace is:

  1. Free preflight ReadinessCard (this package implements this)
  2. Free merchant_card wash_flagged refuse (default on the product stack)
  3. Optional paid V6 trust receipt (~0.05 USDC)
  4. Optional facilitator settle attach when settle is routed through intel.twzrd.xyz

This package only implements step 1 (preflight) + opt-in enforcement primitives. It does not call GET /v1/intel/merchant_card and does not auto-refuse on wash_flagged by itself. For merchant_card + wash refuse + paid trust actions, use @wzrd_sol/eliza-plugin (preSpendGate, WZRD_MERCHANT_CARD). For fetch-level wrap of every 402, use twzrd-x402-gate.

Install

npm install @wzrd_sol/plugin-trustgate

Compatibility: @elizaos/core >=1.0.0. The package has no direct dependency on twzrd-x402-gate; the reproducible fetch-gate example above is pinned to the current [email protected] release.

Use (3 lines)

import { trustGatePlugin, canSpendSafely } from "@wzrd_sol/plugin-trustgate";
const agent = { plugins: [trustGatePlugin /* ...your others */] };   // 1. agent SEES trust in context
if (!(await canSpendSafely(payTo))) throw new Error("TWZRD: blocked seller"); // 2. hard stop before signing

Runnable end-to-end (no auth, no key): examples/first-installer.ts - npx tsx examples/first-installer.ts. Against the live gate it blocks a real wash-flagged seller (decision block) and proceeds on a clean one (decision warn).

How it works

  • trustGateProvider injects BLOCK / WARN / ALLOW + score for the counterparty seller into the agent's context, so the model won't choose to pay a blocked merchant in the first place.
  • canSpendSafely(sellerWallet) is the enforcement primitive your payment action calls before signing: false = do not pay. It hits free POST https://intel.twzrd.xyz/v1/intel/preflight and blocks on decision === "block" (sellers TWZRD flags as high-risk via preflight).
  • Enforcement is opt-in: the plugin does not auto-intercept signatures - your payment action must call canSpendSafely(payTo). The provider only makes the model aware.
  • Fail-closed by default: a preflight outage blocks the payment (canSpendSafely returns false, verdict carries gateAvailable: false) so an intel hiccup never silently approves a spend. Set failOpen: true to opt into legacy allow-on-outage (liveness > security).

Config

import { checkTrust, createTrustGateProvider } from "@wzrd_sol/plugin-trustgate";

const verdict = await checkTrust(payTo, {
  minScore: 0,     // also block when trust_score < this. Default 0 (decision-only).
  failOpen: false, // true = allow on a preflight outage (legacy). Default false (fail-closed).
  timeoutMs: 4000,
  intelBase: "https://intel.twzrd.xyz",
});
//   -> { decision, trustScore, blocked, reason, gateAvailable }

const provider = createTrustGateProvider({ failOpen: true }); // opt into legacy allow-on-outage

Sharp edge - minScore: unknown sellers score 45 (default_no_data), so minScore > 45 blocks every not-yet-seen merchant, not just bad ones. Use it deliberately; decision-only (minScore: 0) blocks just the wash-flagged block verdicts from preflight.

Powered by the TWZRD agent-intel corpus (the independent scorer on the real Solana x402 payment graph). MIT.

withTwzrdGuard (convenience wrapper)

import { withTwzrdGuard } from "@wzrd_sol/plugin-trustgate";

// Throws on block-rated seller before calling fn; passes through on allow/warn.
// Note: this is preflight-only (not the same as twzrd-x402-gate's fetch wrapper).
await withTwzrdGuard(payTo, () => signAndSendPayment(payTo, amount));

Faremeter / Corbits buyers (payerChooser)

Faremeter's fetch wrap exposes a pure-config pre-sign seam: ProcessPaymentRequiredResponseOpts.payerChooser. Each candidate carries requirements.payTo before exec() signs. Drop in createTwzrdPayerChooser() — no fork of Faremeter.

import { createTwzrdPayerChooser } from "@wzrd_sol/plugin-trustgate/faremeter";

// wire into Faremeter wrap / processPaymentRequiredResponse options:
const payerChooser = createTwzrdPayerChooser();
// wrap(fetch, { handlers, payerChooser })

Hard-blocks only decision === "block" (and optional minScore). Free-tier warn / can_spend=false does not reject alone. Fail-closed on preflight outage. Solana-only by default. Throws TwzrdPayerChooserBlockedError when all scoreable candidates are blocked — no signature.

npm run demo:faremeter-chooser --workspace=packages/plugin-trustgate

Facilitator operators

Two facilitator shapes (do not mix them):

| Subpath | Seam | Stack | |---------|------|--------| | ./facilitator | onBeforeSettle(ctx) => void \| {abort,reason} | daydreamsai/facilitator, @x402/core | | ./faremeter | payerChooser(execers) => execer (buyer) | Faremeter wrap / handler composition |

Screen every settlement on a daydreams-style facilitator:

npm install @wzrd_sol/plugin-trustgate
import { createFacilitator } from "@daydreamsai/facilitator";
import { createOnBeforeSettleHook } from "@wzrd_sol/plugin-trustgate/facilitator";

const facilitator = createFacilitator({
  svmSigners: [/* your Solana signer */],
  hooks: { onBeforeSettle: createOnBeforeSettleHook() }, // screens every settle via preflight
});

See docs/facilitator-trust-in-3-lines.md for full options and no-seam fallback.

No hook seam on your facilitator? Gate at the resource server instead:

import { canSpendSafely } from "@wzrd_sol/plugin-trustgate";
// between /verify and requesting /settle:
if (!(await canSpendSafely(payTo))) { /* refuse to settle */ }

Optional product pitch (not implemented in this package): settling through TWZRD (POST https://intel.twzrd.xyz/settle) may attach free merchant intel + receipt for payTo - see live GET /supported twzrd block.