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

@chainpeavax/sdk

v0.2.0

Published

ChainPe SDK — add x402 USDC payments + on-chain ERC-8004 reputation to any app in 3 lines, on Avalanche C-Chain.

Readme

@chainpe/sdk

x402 USDC payments + on-chain ERC-8004 reputation for the Avalanche agent economy — in 3 lines.

Give any app or AI agent the ability to discover, pay for, and rate HTTP APIs per request in USDC, settled on Avalanche C-Chain. The provider's facilitator pays the gas, so your wallet only needs USDC.

npm install @chainpe/sdk

Quickstart (the 3 lines)

import { ChainPe } from '@chainpe/sdk'

const cp = new ChainPe({ privateKey: process.env.PRIVATE_KEY!, network: 'avalanche' })
const res = await cp.fetch('https://api.example.com/paid') // auto-pays a 402
const data = await res.json()

cp.fetch is a drop-in fetch: it makes the request, and if the server answers 402 Payment Required, it signs a USDC payment (EIP-3009), retries with the X-PAYMENT header, and returns the final Response.

Discover + pay an agent (ranked by reputation)

const cp = new ChainPe({ privateKey, network: 'avalanche' })

// Ranked: scored services first, highest ⭐ first.
const services = await cp.discover('summarize')

const best = services[0]
const result = await cp.pay(best.endpoint, {
  method: 'POST',
  headers: { 'content-type': 'application/json' },
  body: JSON.stringify({ text: '…' }),
  autoFeedback: true // leave on-chain ERC-8004 feedback after paying
})

console.log(result.data)        // parsed response body
console.log(result.payment)     // { amount, recipient, network, txHash }
console.log(result.reputation)  // { agentId, score, txHash } when autoFeedback

API

new ChainPe(options)

| option | default | purpose | |---|---|---| | privateKey | — (required) | EOA key that signs payments + feedback | | network | 'avalanche' | 'avalanche' or 'fuji' | | registryAddress | deployed default (mainnet) | ChainPeRegistry address | | reputationRegistry | deployed default (mainnet) | ERC-8004 Reputation Registry | | maxPerCall | '1' | max USDC to auto-pay for one 402 | | autoFeedback | false | post positive feedback after a paid call | | facilitatorUrl | — | reserved for facilitator-routed flows |

Methods:

  • fetch(url, opts?)Response — drop-in fetch that auto-pays a 402.
  • pay(url, opts?)PaidResult — same, but returns parsed data plus payment and (optional) reputation details.
  • discover(query?)RankedService[] — read the on-chain registry, annotate each service with its ERC-8004 reputation, ranked best-first. query is a search string or { query, tags, maxPrice }.
  • getReputation(agentId)ReputationSummary | null — aggregate score.
  • giveFeedback(agentId, score, opts?)txHash — post 0–100 feedback.
  • getAddress()string — the wallet address.
  • balance(){ usdc, avax } — on-chain balances (human units).

Environment overrides

registryAddress / reputationRegistry fall back to CHAINPE_REGISTRY_ADDRESS and ERC8004_REPUTATION_REGISTRY env vars, then the built-in deployed defaults.

Live on Avalanche C-Chain

Works out of the box against the deployed mainnet contracts (see docs/DEPLOYMENTS.md): ChainPeRegistry 0x2a589f1e4e3Cd0A3ee986cec5202aF3760E3170E, ERC-8004 Reputation 0xfe7Df66e6BFbd3A76B68dDF26b9312E6c85a38543. USDC is available on major CEXes and bridges (e.g., Stargate).

Run the example:

CHAINPE_PRIVATE_KEY=0x... npx tsx examples/quickstart.ts

License

MIT