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

agent-marketplace-sdk

v0.1.1

Published

SDK for the agent-to-agent services marketplace — discover, pay, and use AI agent services with one function call

Readme

@psm/agent-marketplace

CI npm License: MIT TypeScript

SDK for the agent-to-agent services marketplace -- discover, pay, and use AI agent services with one function call.

Any agent framework (elizaOS, LangChain, CrewAI, raw code) can use this to find and pay for services from other agents over the open marketplace.

Install

npm install @psm/agent-marketplace

Quick Start

import { AgentMarketplace } from '@psm/agent-marketplace';

const marketplace = new AgentMarketplace({
  registryUrl: 'https://agent-marketplace.psm.workers.dev/v1',
  solanaPrivateKey: process.env.SOLANA_PRIVATE_KEY,
  maxPricePerCall: '1.00', // USDC safety cap
  preferredChain: 'solana',
});

// One call does everything: discover + pay + execute
const result = await marketplace.call('nvidia-codereview', {
  code: 'function add(a, b) { return a + b; }',
  language: 'typescript',
}, { maxPrice: '0.05', timeout: 30000 });

console.log(result.content);    // tool output
console.log(result.payment);    // { txHash, amount, chain }
console.log(result.latencyMs);  // end-to-end time

API Reference

new AgentMarketplace(config)

| Option | Type | Default | Description | |--------|------|---------|-------------| | registryUrl | string | required | Marketplace registry API base URL | | solanaPrivateKey | string \| Uint8Array | undefined | Base58 or raw secret key for payment signing | | maxPricePerCall | string | '10.00' | Global USDC safety cap per call | | preferredChain | 'solana' \| 'base' | 'solana' | Preferred payment chain | | cacheDiscovery | boolean | true | Cache discovery results | | cacheTtlMs | number | 300000 | Cache TTL in milliseconds (default 5 min) |

marketplace.discover(query, options?)

Search for services in the registry.

const services = await marketplace.discover('code review', {
  category: 'ai',
  maxPrice: '0.10',
  minReputation: 3.0,
  limit: 10,
});

Returns ServiceListing[] with name, price, tools, reputation, latency, and uptime.

marketplace.call(serviceName, args, options?)

Discover + pay + execute in one step. The primary method.

const result = await marketplace.call('nvidia-codereview', {
  code: sourceCode,
  language: 'typescript',
}, { maxPrice: '0.05', timeout: 30000 });

Returns CallResult:

{
  content: [{ type: 'text', text: '...' }],
  payment: { txHash: '...', amount: '0.05', chain: 'solana' },
  latencyMs: 423,
  service: 'nvidia-codereview',
}

marketplace.balance()

Check USDC balance for the configured wallet.

const bal = await marketplace.balance();
// { address: '...', balances: [{ chain: 'solana', token: 'USDC', amount: '42.50' }] }

marketplace.register(input)

Register as a service provider.

await marketplace.register({
  name: 'my-tool',
  description: 'Custom analysis tool',
  category: 'data',
  pricePerCall: '0.02',
  tools: [{ name: 'analyze', description: 'Run analysis' }],
  gatewayEndpoint: 'https://my-gateway.example.com/mcp',
  paymentAddress: 'B5dax...',
});

marketplace.feedback(serviceName, input)

Submit reputation feedback (requires txHash proof of payment).

await marketplace.feedback('nvidia-codereview', {
  score: 5,
  comment: 'Accurate and fast',
  txHash: 'abc123...',
});

Utility

  • marketplace.walletAddress -- sender public key (base58)
  • marketplace.hasPaymentKey -- whether a signing key is configured
  • marketplace.clearCache() -- flush the discovery cache

How Payment Works (x402 Flow)

Agent A                    Registry                  Gateway (Agent B)
  |                          |                            |
  |-- GET /discover?q=... -->|                            |
  |<-- ServiceListing[] -----|                            |
  |                          |                            |
  |  (sign USDC payment)     |                            |
  |                          |                            |
  |-- POST tools/call -------|--------[X-Payment]-------->|
  |                          |                            |
  |                          |  (verify payment, execute) |
  |                          |                            |
  |<-- JSON-RPC result ------|----------------------------|
  |                          |                            |
  |-- POST /reputation ----->|                            |
  1. Discover: Query the registry for services matching your needs
  2. Sign: Ed25519-sign a USDC payment payload with your Solana keypair
  3. Call: Send MCP tools/call JSON-RPC with the payment in the X-Payment header
  4. Execute: The gateway verifies payment, runs the tool, returns results
  5. Feedback: Optionally rate the service (txHash proves you paid)

Supported Chains

| Chain | Token | Status | |-------|-------|--------| | Solana | USDC | Supported | | Base | USDC | Planned |

Architecture

The SDK is split into focused modules:

  • index.ts -- AgentMarketplace class, unifies everything
  • discovery.ts -- Registry API client with LRU caching
  • payment.ts -- x402 Ed25519 payment signing (Solana)
  • transport.ts -- MCP JSON-RPC over HTTP with payment headers
  • reputation.ts -- Post-call feedback submission
  • cache.ts -- Generic LRU cache with TTL
  • types.ts -- All TypeScript interfaces

License

MIT