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

@warppay402/server

v1.2.8

Published

Instant MCP Tool & x402 Monetization SDK for Cloudflare Gateway, Base, and Arc Mainnet

Readme

@warppay402/server ⚡

Instant x402 V2 monetization SDK and self-hosted infrastructure for Model Context Protocol (MCP) AI tools, Hono HTTP APIs, Cloudflare Monetization Gateway, Base, Solana, Arbitrum, and Arc Mainnet.

@warppay402/server allows developers to monetize any MCP tool or HTTP API route in a few lines of code. It automatically generates standard x402 V2 HTTP payment challenges, verifies gasless EIP-712 / native USDC signatures, enforces platform fee splits, protects against prompt injection threats, and prevents signature replay attacks.

Official Site: https://www.warppay402.com


Features

  • x402 V2 Compliant: Standardized payment challenge headers (PAYMENT-REQUIRED, PAYMENT-SIGNATURE, PAYMENT-RESPONSE).
  • Multi-Chain Native: Multi-chain challenge generation supporting Base Mainnet (eip155:8453), Arbitrum One (eip155:42161), Solana Mainnet-Beta (solana:5eykt...), and Arc Mainnet (eip155:5042) out of the box.
  • Native USDC Gas & Off-Chain Signing: Supports gasless TransferWithAuthorization (Base/Arbitrum), SPL-USDC (Solana), and direct native USDC value transfers (Arc Mainnet).
  • Automated Platform Fee Split: Configurable fee split in basis points (e.g., 50 BPS = 0.5%) routed directly during facilitator settlement.
  • x402-Guard Security: Pre-flight middleware protecting endpoints against prompt injection attacks, payload buffer overruns, and high-velocity traffic spikes.
  • MCP Native Decorator: Seamlessly wraps tools written for the Model Context Protocol.
  • Replay Protection: Includes built-in MemoryNonceStore and distributed RedisNonceStore drivers to prevent double-spending or signature reuse.
  • Edge Compatible: Zero Node.js-only API dependencies; runs seamlessly on Cloudflare Workers, Vercel Edge, Node.js (18+), and Deno.

Installation

npm install @warppay402/server

Usage Case 1: Monetizing Multi-Chain Hono HTTP APIs

import { Hono } from "hono";
import { monetize, DEFAULT_NETWORK_ARC, DEFAULT_USDC_ARC } from "@warppay402/server";

const app = new Hono();

const monetizeConfig = {
  payTo: "0xYourMerchantWalletAddress", // Default Base EVM Wallet
  platformWallet: "0xYourPlatformTreasuryWallet",
  platformFeeBps: 50, // 0.5% fee split
  guard: true, // Enables x402-guard security scanning
  facilitatorUrl: "http://localhost:3001",
  // Multi-Chain 402 Challenge Configuration
  accepts: [
    {
      scheme: "exact",
      network: "eip155:8453", // Base Mainnet
      asset: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", // Base USDC
      payTo: "0xYourMerchantWalletAddress",
    },
    {
      scheme: "exact",
      network: "eip155:5042", // Arc Mainnet
      asset: "0x0000000000000000000000000000000000000000", // Native USDC
      payTo: "0xYourMerchantWalletAddress",
    },
    {
      scheme: "exact",
      network: "solana:5eykt4wA89m8E5b9B5658p445VTc28", // Solana Mainnet-Beta
      asset: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", // SPL-USDC
      payTo: "YourSolanaPhantomPublicKey",
    }
  ]
};

app.use(
  "/api/data",
  monetize({
    ...monetizeConfig,
    price: "0.01", // $0.01 USDC
  })
);

app.get("/api/data", (c) => c.json({ status: "success", content: "Monetized Payload" }));

export default app;

Usage Case 2: Monetizing MCP (Model Context Protocol) Tools

import { createMonetizedMCPTool } from "@warppay402/server";

const originalTool = {
  name: "web_scraper",
  description: "Extract clean Markdown content from URLs",
  inputSchema: { type: "object", properties: { url: { type: "string" } } },
  handler: async ({ url }: { url: string }) => {
    return { markdown: "# Cleaned Markdown Content" };
  }
};

export const monetizedTool = createMonetizedMCPTool(originalTool, {
  price: "0.02", // $0.02 USDC
  payTo: "0xYourMerchantWalletAddress",
  platformWallet: "0xYourPlatformTreasuryWallet",
  platformFeeBps: 50
});

Usage Case 3: Distributed Nonce Locking with Redis / Upstash

import { Redis } from "@upstash/redis";
import { monetize, RedisNonceStore } from "@warppay402/server";

const redis = new Redis({
  url: process.env.UPSTASH_REDIS_REST_URL!,
  token: process.env.UPSTASH_REDIS_REST_TOKEN!
});

app.use(
  "/api/v1/compute",
  monetize({
    price: "0.10",
    payTo: "0xYourMerchantWalletAddress",
    platformWallet: "0xYourPlatformTreasuryWallet",
    nonceStore: new RedisNonceStore(redis),
    nonceTtlSeconds: 300
  })
);

License: MIT © WarpPay402