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

@vedmohan/agent-wallet

v2.0.4

Published

x402 payments where AI agents pay their own way — API + gas, all in USDC, no AVAX needed. Built on SmoothSend ERC-4337 infrastructure.

Readme

🤖 Agent Wallet — x402 + ERC-8004

AI agents pay for APIs in USDC on Avalanche — including gas. No AVAX needed. Plus on-chain agent identity and reputation via ERC-8004.

Built on SmoothSend ERC-4337 infrastructure (VerifyingPaymaster + bundler on Avalanche C-Chain).


✨ Live Demo

x402avax.vercel.app — three tabs:

| Tab | What it does | |-----|-------------| | Live Demo | Toggle x402 OFF → see raw 402 Payment Required. Toggle ON → auto-pays in USDC, get weather data. City picker (Tokyo, London, Dubai, NYC, Singapore). $0.02/tx | | Marketplace | ERC-8004 agent registry. Register your agent, browse agents by reputation score, hire via x402 payment + on-chain feedback | | Quick Start | Copy-paste code snippets |


What's New in v2.0.0 — ERC-8004 Agent Registry

This release adds on-chain agent identity and reputation via ERC-8004: the Trustless Agents standard.

Two contracts deployed on Avalanche Fuji:

| Contract | Address | Role | |----------|---------|------| | IdentityRegistry | 0x3F5Ee79771C2628D3941Bc015d306C194DA2E425 | ERC-721 agent identities with EIP-712 wallet verification | | ReputationRegistry | 0x351487d9E592B0D6682b0027a2eA099ab2652B10 | On-chain feedback scores with proof-of-payment |

Source: agent-wallet/contracts/contracts/

// New in v2.0.0 — ERC-8004 identity + reputation
const wallet = await AgentWallet.create({ ... });

// Register an agent identity (mints an ERC-721, gas sponsored)
const agentId = await wallet.registerIdentity(
  'Weather Bot',
  'Gets weather data via x402 on Avalanche'
);
// → Agent ID: 1 — on-chain identity created

// Get reputation score for any agent
const rep = await wallet.getReputation(agentId);
// → { count: 5, summaryValue: 42500, valueDecimals: 2, score: 85 }

// Submit feedback after a transaction
const feedbackTx = await wallet.submitFeedback({
  agentId: 1,
  value: 85,
  tag1: 'x402',
  feedbackURI: 'data:...,{"proofOfPayment":{"txHash":"0x..."}}',
});

// Get full marketplace listing
const listing = await wallet.getAgentListing(agentId);
// → { identity: { agentId, owner, agentWallet }, reputation: { count, score } }

ERC-8004 Flow

AgentWallet.create()
  → registerIdentity(name, desc)    // Mints ERC-721 on IdentityRegistry
  → x402.request(url)               // Pays API in USDC
  → submitFeedback(agentId, score)  // Posts feedback to ReputationRegistry
  → getReputation(agentId)          // Reads on-chain reputation score

The IdentityRegistry uses EIP-712 signatures to verify the agent's payment wallet. The ReputationRegistry stores feedback as (value, valueDecimals, tag1, tag2) with optional proofOfPayment URIs. Both are per-chain singletons — one shared registry that all agents register to, building a networked reputation layer.


Monorepo Structure

agent-wallet/
├── src/                     # SDK source (AgentWallet, X402Client, types)
├── contracts/               # ERC-8004 Solidity contracts
│   ├── contracts/
│   │   ├── IdentityRegistry.sol    # ERC-721 agent identity
│   │   └── ReputationRegistry.sol  # On-chain feedback
│   ├── scripts/deploy.ts           # Fuji deploy script
│   ├── hardhat.config.ts
│   └── DEPLOYED.md                 # Contract addresses
├── demo-site/               # Next.js demo app (Vercel)
│   └── app/
│       ├── page.tsx                 # Main UI (3 tabs)
│       └── api/
│           ├── demo/route.ts        # x402 flow + agent registration
│           ├── marketplace/route.ts # Agent listing API
│           └── merchant/route.ts    # Merchant endpoint (402)
├── dist/                    # Built SDK
└── package.json             # @vedmohan/agent-wallet

Why Agent Wallet?

Base's x402 protocol makes merchants pay gas in ETH. Agent Wallet flips this — the agent pays everything in USDC on Avalanche:

| | Plain x402 | Agent Wallet | |---|---|---| | Network | Base (ETH gas) | Avalanche C-Chain | | Merchant receives | ~96% | 100% | | Who pays gas | Merchant in ETH | Agent in USDC | | Gas token | ETH | USDC | | Agent needs ETH? | Yes | No — just USDC | | Setup | Deploy paymaster + KYC | 1 API key, 30s | | Identity | None | ERC-8004 on-chain | | Reputation | None | On-chain feedback |


Quick Start

npm install @vedmohan/agent-wallet
import { AgentWallet, X402Client } from '@vedmohan/agent-wallet';

// Create wallet (smart account auto-deployed on first tx)
const wallet = await AgentWallet.create({
  smoothSendApiKey: 'sk_nogas_...',      // dashboard.smoothsend.xyz
  dailyLimit: '100',
  perTxLimit: '10',
  network: 'avalanche-fuji',
});

console.log(`Smart Account: ${wallet.address}`);
console.log(`Balance: $${await wallet.getBalance()} USDC`);

// Optional: register an ERC-8004 identity
const agentId = await wallet.registerIdentity('My Bot', 'AI agent demo');
console.log(`Registered as Agent #${agentId}`);

// x402 calls — auto-pays when 402 is received
const x402 = new X402Client({ wallet });

const weather = await x402.request(
  'https://api.example.com/weather?city=Tokyo'
);

console.log(`🌤️  ${weather.data.temperature}°C, ${weather.data.condition}`);
// 💸 Auto-paid $0.02 USDC — all in USDC

API Reference

AgentWallet

const wallet = await AgentWallet.create(config)

| Config Field | Required | Default | Description | |---|---|---|---| | smoothSendApiKey | ✅ | — | From dashboard.smoothsend.xyz | | network | ✅ | — | avalanche-fuji or avalanche-mainnet | | dailyLimit | ✅ | — | Max USDC/day (e.g. '100') | | perTxLimit | ✅ | — | Max USDC/tx (e.g. '10') | | privateKey | ❌ | Random EOA | Reuse wallet across restarts | | identityRegistryAddress | ❌ | Fuji deployment | Custom IdentityRegistry address | | reputationRegistryAddress | ❌ | Fuji deployment | Custom ReputationRegistry address |

Methods:

| Method | Returns | Description | |--------|---------|-------------| | wallet.address | string | Smart account address (ERC-4337) | | wallet.eoaAddress | string | EOA owner address | | wallet.agentId | number \| null | ERC-8004 agent ID (after registerIdentity) | | getBalance() | string | USDC balance | | payForService(req) | PaymentResult | Pay merchant in USDC (auto-approves paymaster) | | getBudgetStatus() | BudgetStatus | Daily + per-tx budget info | | exportPrivateKey() | string | Export EOA private key | | registerIdentity(name, desc) | number | v2.0 Mint ERC-8004 identity, returns agentId | | getReputation(agentId) | AgentReputation | v2.0 Read on-chain reputation score (0-100) | | submitFeedback(input) | string | v2.0 Submit feedback for an agent (tx hash) | | getAgentListing(agentId) | object | v2.0 Full identity + reputation listing |

X402Client

const x402 = new X402Client({ wallet });

const result = await x402.request(url | AxiosRequestConfig);
// → { data, status, paid, payment? }

const results = await x402.batch([url1, url2, ...]);
  • paid: false → no payment needed
  • paid: true → 402 was paid, payment: { txHash, totalCost, gasCost, apiCost }

Architecture

┌─────────────────────────────────────────────────────┐
│                   Agent Wallet SDK                  │
├─────────────┬──────────────┬────────────────────────┤
│ AgentWallet │ X402Client   │ McpClient              │
│ (wallet)    │ (auto-pay)   │ (tx lookup)            │
├─────────────┴──────┬───────┴────────────────────────┤
│                    │                                │
│     SmoothSend Bundler (ERC-4337)                   │
│     VerifyingPaymaster (user-pays-erc20)            │
│     EntryPoint v0.7                                 │
├─────────────────────────────────────────────────────┤
│ IdentityRegistry (ERC-8004)    ReputationRegistry   │
│ • register(name, desc)         • giveFeedback()     │
│ • setAgentWallet(EIP-712)      • getSummary()       │
│ • getAgentWallet()             • revokeFeedback()   │
└─────────────────────────────────────────────────────┘

Development

Running locally

# Terminal 1: build SDK in watch mode
cd agent-wallet
npm run dev

# Terminal 2: demo site with local SDK
cd agent-wallet/demo-site
npm run dev:local           # uses local build (no npm publish needed)
# or: npm run dev            # uses published npm package

Deploying contracts

cd agent-wallet/contracts
cp .env.example .env        # add DEPLOYER_PRIVATE_KEY
npm run deploy:fuji

License

MIT — © 2026 Ved Mohan