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

moltspay

v0.9.3

Published

Payment infrastructure for AI Agents - Server & Client SDK

Readme

MoltsPay

Blockchain payment infrastructure for AI Agents. Turn any skill into a paid service with one JSON file.

Features

  • 🔌 Skill Integration - Add moltspay.services.json to any existing skill
  • 🎫 x402 Protocol - HTTP-native payments (402 Payment Required)
  • 💨 Gasless - Both client and server pay no gas (CDP facilitator handles it)
  • Payment Verification - Automatic on-chain verification
  • 🔒 Secure Wallet - Limits, whitelist, and audit logging
  • ⛓️ Multi-chain - Base, Polygon, Ethereum (mainnet & testnet)
  • 🤖 Agent-to-Agent - Complete A2A payment flow support

Installation

npm install moltspay@latest

Quick Start

For Service Providers (Selling)

1. Have an existing skill with exported functions:

// index.js (your existing skill)
export async function textToVideo({ prompt }) {
  // your implementation
  return { video_url: "https://..." };
}

2. Add moltspay.services.json:

{
  "provider": {
    "name": "My Video Service",
    "wallet": "0xYOUR_WALLET_ADDRESS"
  },
  "services": [{
    "id": "text-to-video",
    "function": "textToVideo",
    "price": 0.99,
    "currency": "USDC"
  }]
}

3. Start server:

npx moltspay start ./my-skill --port 3000

That's it! Your skill now accepts x402 payments.

For Clients (Buying)

1. Initialize wallet (one time):

npx moltspay init --chain base
# Output: Wallet address 0xABC123...

2. Fund your wallet: Ask your owner to send USDC to your wallet address. No ETH needed!

3. Use paid services:

npx moltspay pay https://server.com text-to-video --prompt "a cat dancing"

Skill Structure

MoltsPay reads your skill's existing structure:

my-skill/
├── package.json           # MoltsPay reads "main" field
├── index.js               # Your existing exports
└── moltspay.services.json # Only file you add!

Entry point discovery:

  1. If package.json exists → uses main field
  2. Otherwise → defaults to index.js

Your functions stay untouched. Just add the JSON config.

Services Manifest Schema

{
  "$schema": "https://moltspay.com/schemas/services.json",
  "provider": {
    "name": "Service Name",
    "description": "Optional description",
    "wallet": "0x...",
    "chain": "base"
  },
  "services": [{
    "id": "service-id",
    "name": "Human Readable Name",
    "description": "What it does",
    "function": "exportedFunctionName",
    "price": 0.99,
    "currency": "USDC",
    "input": {
      "prompt": { "type": "string", "required": true }
    },
    "output": {
      "result_url": { "type": "string" }
    }
  }]
}

Validate Your Config

npx moltspay validate ./my-skill
# or
npx moltspay validate ./moltspay.services.json

Server Setup (Mainnet)

1. Get CDP credentials from https://portal.cdp.coinbase.com/

2. Create ~/.moltspay/.env:

USE_MAINNET=true
CDP_API_KEY_ID=your-key-id
CDP_API_KEY_SECRET=your-secret

3. Start server:

npx moltspay start ./my-skill --port 3000

Server does NOT need a private key - the x402 facilitator handles settlement.

How x402 Works

Client                         Server                      CDP Facilitator
  │                              │                              │
  │ POST /execute                │                              │
  │ ─────────────────────────>   │                              │
  │                              │                              │
  │ 402 + payment requirements   │                              │
  │ <─────────────────────────   │                              │
  │                              │                              │
  │ [Sign EIP-3009 - NO GAS]     │                              │
  │                              │                              │
  │ POST + X-Payment header      │                              │
  │ ─────────────────────────>   │ Verify signature             │
  │                              │ ─────────────────────────>   │
  │                              │                              │
  │                              │ Execute transfer (pays gas)  │
  │                              │ <─────────────────────────   │
  │                              │                              │
  │ 200 OK + result              │                              │
  │ <─────────────────────────   │                              │

Client needs: USDC balance only (no ETH/gas) Server needs: CDP credentials only (no private key)

CLI Reference

# === Client Commands ===
npx moltspay init                    # Create wallet
npx moltspay status                  # Check balance
npx moltspay config                  # Update limits
npx moltspay services <url>          # List provider's services
npx moltspay pay <url> <service>     # Pay and execute service

# === Server Commands ===
npx moltspay start <skill-dir>       # Start server
npx moltspay stop                    # Stop server
npx moltspay validate <path>         # Validate manifest

# === Options ===
--port <port>                        # Server port (default 3000)
--chain <chain>                      # Chain: base, polygon, ethereum
--max-per-tx <amount>                # Spending limit per transaction
--max-per-day <amount>               # Daily spending limit

Programmatic Usage

Client

import { MoltsPayClient } from 'moltspay/client';

const client = new MoltsPayClient({ chain: 'base' });

// Pay for a service
const result = await client.execute('https://server.com', 'text-to-video', {
  prompt: 'a cat dancing'
});

console.log(result.video_url);

Server

import { MoltsPayServer } from 'moltspay/server';

const server = new MoltsPayServer('./moltspay.services.json');

// Register custom handler (optional - usually loaded from skill)
server.skill('text-to-video', async (params) => {
  // implementation
  return { video_url: '...' };
});

server.listen(3000);

Supported Chains

| Chain | ID | Type | |-------|-----|------| | base | 8453 | Mainnet | | polygon | 137 | Mainnet | | ethereum | 1 | Mainnet | | base_sepolia | 84532 | Testnet |

Example: Zen7 Video Generation

Live service at https://juai8.com/zen7/

Services:

  • text-to-video - $0.99 USDC
  • image-to-video - $1.49 USDC

Test it:

npx moltspay services https://juai8.com/zen7
npx moltspay pay https://juai8.com/zen7 text-to-video --prompt "a happy cat"

Links

  • npm: https://www.npmjs.com/package/moltspay
  • GitHub: https://github.com/Yaqing2023/moltspay
  • x402 Protocol: https://www.x402.org/

License

MIT