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

@agentpay-dev/sdk

v0.1.0

Published

AgentPay SDK �?Give your Agent a wallet in 3 lines of code

Downloads

121

Readme

@agentpay-dev/sdk

SDK for building AI Agents that pay and get paid via CKB Fiber Network

Features

  • AgentWallet �?Client-side SDK for calling paid Agent services
  • ServiceProvider �?Server-side SDK for receiving paid service requests
  • HubClient �?Managed Fiber access (no node required)
  • Hold Scheme �?Trustless escrow: lock �?verify �?settle/cancel
  • Production-hardened �?Input validation, timeouts, CORS, body limits
  • Fiber v0.7.1 Compatible �?Auto hex conversion for all RPC calls

6 Ways to Use AgentPay

| Method | Best For | Example | |---|---|---| | SDK | TypeScript apps | new AgentWallet(...) | | MCP | Claude/GPT AI | npx agentpay-mcp | | Skills | Any AI framework | .agent/skills/agentpay-payment/ | | x402 | HTTP 402 middleware | /x402/create-hold | | Hub | No node needed | createHubWallet(...) | | Docker | Self-hosted node | pnpm setup |

Install

npm install @agentpay-dev/sdk @agentpay-dev/core

Quick Start

As a Caller (pay for services)

import { AgentWallet } from '@agentpay-dev/sdk';

const wallet = new AgentWallet({ fiberRpcUrl: 'http://127.0.0.1:8227' });

const result = await wallet.payAndCall(
  'http://translate-bot:3001',
  'translate',
  { text: 'Hello World', target: 'zh' },
  { maxBudget: '1000000000' },
);

console.log(result.output);  // { translated: '[zh] Hello World' }
console.log(result.amount);  // '100000000' (actual cost)

As a Provider (earn from services)

import { ServiceProvider } from '@agentpay-dev/sdk';

const provider = new ServiceProvider({
  services: [{
    name: 'translate',
    description: 'Translate text between languages',
    pricing: { model: 'per-call', amount: '100000000', asset: 'CKB' },
    input_schema: { text: 'string', target: 'string' },
    output_schema: { translated: 'string' },
  }],
});

provider.onTask('translate', async (input) => {
  const { text, target } = input as { text: string; target: string };
  return { translated: `[${target}] ${text}` };
});

provider.listen(3001);

Hold Scheme (escrow)

// Provider creates hold invoice
const { invoice_address, preimage, payment_hash } =
  await wallet.createHoldInvoice('100000000', 'Translation job');

// Client pays the invoice (funds locked)
await clientWallet.rpc.sendPayment({ invoice: invoice_address });

// Provider does the work, then settles (collects funds)
await wallet.rpc.settleInvoice({ payment_hash, payment_preimage: preimage });

// OR cancel (refund to client)
await wallet.rpc.cancelInvoice({ payment_hash });

Via Hub (no Fiber node needed)

import { createHubWallet } from '@agentpay-dev/sdk';

const wallet = createHubWallet({
  hubUrl: 'http://hub.agentpay.dev:4000',
  apiKey: 'ap_your_key_here',
});

const result = await wallet.payAndCall(
  'http://translate-bot:3001', 'translate',
  { text: 'Hello', target: 'zh' },
);

Protocol Flow (Hold Scheme)

Caller                    Provider                  Fiber
  |                       |---- newInvoice(hash) ---->|  (hold)
  |<-- INVOICE -----------|                           |
  |---- sendPayment ------+-------------------------->|  (locked)
  |--- TASK_INPUT ------->|                           |
  |                       |---- execute task          |
  |                       |---- settleInvoice ------->|  (settled)
  |<-- TASK_RESULT -------|                           |

License

MIT