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

@jhinresh/viem-guard

v0.9.0

Published

Universal trust middleware for viem — auto-checks Maiat trust score before every transaction

Readme

@jhinresh/viem-guard

Universal trust middleware for viem — automatically checks Maiat trust score before every transaction.

Install

npm install @jhinresh/viem-guard viem

Usage

import { createWalletClient, http, parseEther } from 'viem'
import { base } from 'viem/chains'
import { withMaiatTrust } from '@jhinresh/viem-guard'

const walletClient = createWalletClient({
  account,
  chain: base,
  transport: http(),
})

// Wrap with Maiat trust gate
const client = withMaiatTrust(walletClient, {
  minScore: 60,  // block if trust score < 60 (default)
})

// All transactions now auto-checked
await client.sendTransaction({
  to: '0xSomeContract',
  value: parseEther('1'),
})
// ^ auto-calls GET /api/v1/trust-check?agent=0xSomeContract
// score < 60 → throws MaiatTrustError
// score ≥ 60 → tx proceeds normally

Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | minScore | number | 60 | Block transactions to addresses below this trust score | | apiKey | string | - | mk_... key for paid tier (no rate limit) | | mode | 'block' \| 'warn' \| 'silent' | 'block' | How to handle low-trust addresses | | onWarn | (result) => void | - | Called when mode='warn' and address is low-trust |

Modes

// block (default) — throws MaiatTrustError
const client = withMaiatTrust(walletClient, { mode: 'block' })

// warn — logs warning, tx continues
const client = withMaiatTrust(walletClient, {
  mode: 'warn',
  onWarn: (result) => console.warn(`Low trust: ${result.address} (${result.score}/100)`),
})

// silent — disables all checks (for testing)
const client = withMaiatTrust(walletClient, { mode: 'silent' })

Error handling

import { withMaiatTrust, MaiatTrustError } from '@jhinresh/viem-guard'

try {
  await client.sendTransaction({ to: '0x...', value: parseEther('1') })
} catch (e) {
  if (e instanceof MaiatTrustError) {
    console.log(e.address)  // blocked address
    console.log(e.score)    // 0-100
    console.log(e.verdict)  // 'block'
  }
}

What gets intercepted

| tx.to | Trust check | |-------|-------------| | DeFi protocol | Protocol trust score | | Agent wallet | ACP seller reputation | | NFT contract | Contract safety | | ERC-20 token | Token trust score |

Both sendTransaction and writeContract are intercepted. Unknown addresses (not in Maiat DB) are allowed through (fail-open).

Rate limits

| Tier | Limit | How | |------|-------|-----| | Free | 10 req/min per IP | Default, no setup | | Paid | Unlimited | apiKey: 'mk_...' |

Powered by

Maiat Protocol — trust infrastructure for agentic commerce