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

casper-trust

v0.1.1

Published

The settled-payment trust layer for Casper agents — read reputation in one line, gate x402 payments on it.

Readme

casper-trust

The settled-payment trust layer for Casper agents — read an agent's reputation in one line, gate x402 payments on it.

What it is

casper-trust wraps three on-chain contracts (identity registry, reputation ledger, escrow) deployed on casper-test and exposes them through a minimal TypeScript SDK. The read path is wallet-free and gas-free. The payment path delegates the 402-handshake to @make-software/casper-x402 + @x402/fetch; this SDK adds the trust-score gate on top.

Install

npm install casper-trust

Wallet-free quickstart

No wallet, no gas. Read any agent's trust score in one call:

import { createTrustClient, checkTrust } from "casper-trust";

const client = createTrustClient();              // reads from casper-test by default
const result = await checkTrust(client, 1);      // agentId = 1
console.log(result.trusted, result.score);       // e.g. true, 9500n (basis points)

result.trusted is true when the agent is Active and score >= minScore (default 0).

Trust-gated x402 payment

import { createTrustClient, pay, type X402TrustClient } from "casper-trust";
import { toClientCasperSigner } from "@make-software/casper-x402";

const signer = toClientCasperSigner(yourCasperAccount);
const client: X402TrustClient = { ...createTrustClient(), signer };

const response = await pay(client, {
  url: "https://api.example.com/protected-resource",
  providerAgentId: 1,   // on-chain identity id of the provider
  minScore: 5000n,      // gate: reject if score < 50 % (basis points)
});

pay() throws TrustGateError before sending any money if the provider's on-chain score is below minScore.

API reference

| Export | Description | |---|---| | createTrustClient(overrides?) | Returns { cfg, rpc } — wallet-free read client | | checkTrust(client, agentId, opts?) | Full trust check; returns TrustResult | | getReputation(client, agentId) | Raw Reputation (jobsCompleted, scoreBps, …) | | getAgent(client, agentId) | Raw Agent (owner, wallet, status, bond) or null | | pay(client, req) | Trust-gated x402 v2 fetch | | gateByTrust(checkFn, agentId, minScore) | Standalone gate (throws TrustGateError) | | register(cfg, signer, uri, bond) | Build+sign a register transaction (no submit) | | attestSettlement(cfg, params) | Build the 4-tx settlement sequence (no submit) | | CASPER_TEST | Default NetworkConfig (testnet RPC + contract hashes) |

x402 delegation

The 402-handshake (retry loop, PAYMENT-SIGNATURE header, amount field) is fully delegated to @make-software/casper-x402 and @x402/fetch. casper-trust adds only the trust-score check before the handshake starts.

Network / contracts

Live on casper-test. Contract package hashes are in CASPER_TEST (see src/config.ts) and documented with their field-index calibration in .git/sdd/task-3-report.md and DEPLOYMENT.md.

Both paths are live-verified on casper-test: the wallet-free read path, and the full trust-gated x402 handshake settling on-chain via the hosted CSPR.cloud facilitator (settle tx 0c58d79a, trust-gated b4a4635f). Reproducible demos in scripts/.

License

MIT