@warppay402/server 1.0.1 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # @warppay402/server ⚡
2
2
 
3
- > Instant x402 V2 monetization SDK and self-hosted infrastructure for Model Context Protocol (MCP) AI tools, Hono HTTP APIs, Cloudflare Monetization Gateway, and Base.
3
+ > Instant x402 V2 monetization SDK and self-hosted infrastructure for Model Context Protocol (MCP) AI tools, Hono HTTP APIs, Cloudflare Monetization Gateway, Base, and Solana.
4
4
 
5
- `@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 signatures, enforces platform fee splits, protects against prompt injection threats, and prevents signature replay attacks.
5
+ `@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 / Solana L1 signatures, enforces platform fee splits, protects against prompt injection threats, and prevents signature replay attacks.
6
6
 
7
7
  Official Site: [https://www.warppay402.com](https://www.warppay402.com)
8
8
 
@@ -11,9 +11,9 @@ Official Site: [https://www.warppay402.com](https://www.warppay402.com)
11
11
  ## Features
12
12
 
13
13
  - **x402 V2 Compliant:** Standardized payment challenge headers (`PAYMENT-REQUIRED`, `PAYMENT-SIGNATURE`, `PAYMENT-RESPONSE`).
14
- - **Base Network Native:** Uses USDC on Base mainnet (`eip155:8453`) by default.
15
- - **Gasless Off-Chain Signing:** Clients sign `TransferWithAuthorization` payloads without paying gas fees.
16
- - **Automated Platform Fee Split:** Configurable fee split in basis points (e.g. 50 BPS = 0.5%) routed directly during facilitator settlement.
14
+ - **Multi-Chain Native:** Multi-chain challenge generation supporting **Base Mainnet** (`eip155:8453`) and **Solana Mainnet-Beta** (`solana:5eykt...`) out of the box.
15
+ - **Gasless Off-Chain Signing:** Clients sign `TransferWithAuthorization` (Base) or pre-signed SPL-USDC transactions (Solana) without non-custodial friction.
16
+ - **Automated Platform Fee Split:** Configurable fee split in basis points (e.g., 50 BPS = 0.5%) routed directly during facilitator settlement.
17
17
  - **x402-Guard Security:** Pre-flight middleware protecting endpoints against prompt injection attacks, payload buffer overruns, and high-velocity traffic spikes.
18
18
  - **MCP Native Decorator:** Seamlessly wraps tools written for the Model Context Protocol.
19
19
  - **Replay Protection:** Includes built-in `MemoryNonceStore` and distributed `RedisNonceStore` drivers to prevent double-spending or signature reuse.
@@ -26,21 +26,43 @@ Official Site: [https://www.warppay402.com](https://www.warppay402.com)
26
26
  ```bash
27
27
  npm install @warppay402/server
28
28
  ```
29
- ## Usage Case 1: Monetizing Hono HTTP APIs
29
+
30
+ ## Usage Case 1: Monetizing Multi-Chain Hono HTTP APIs
31
+
30
32
  ```typescript
31
33
  import { Hono } from "hono";
32
34
  import { monetize } from "@warppay402/server";
33
35
 
34
36
  const app = new Hono();
35
37
 
38
+ const monetizeConfig = {
39
+ payTo: "0xYourMerchantWalletAddress", // Default Base EVM Wallet
40
+ platformWallet: "0xYourPlatformTreasuryWallet",
41
+ platformFeeBps: 50, // 0.5% fee split
42
+ guard: true, // Enables x402-guard security scanning
43
+ facilitatorUrl: "http://localhost:3001",
44
+ // Multi-Chain 402 Challenge Configuration
45
+ accepts: [
46
+ {
47
+ scheme: "exact",
48
+ network: "eip155:8453", // Base Mainnet
49
+ asset: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", // Base USDC
50
+ payTo: "0xYourMerchantWalletAddress",
51
+ },
52
+ {
53
+ scheme: "exact",
54
+ network: "solana:5eykt4wA89m8E5b9B5658p445VTc28", // Solana Mainnet-Beta
55
+ asset: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", // SPL-USDC
56
+ payTo: "YourSolanaPhantomPublicKey",
57
+ }
58
+ ]
59
+ };
60
+
36
61
  app.use(
37
62
  "/api/data",
38
63
  monetize({
64
+ ...monetizeConfig,
39
65
  price: "0.01", // $0.01 USDC
40
- payTo: "0xYourMerchantWalletAddress",
41
- platformWallet: "0xYourPlatformTreasuryWallet",
42
- platformFeeBps: 50, // 0.5% cut
43
- guard: true // Enables x402-guard security scanning
44
66
  })
45
67
  );
46
68
 
@@ -48,7 +70,9 @@ app.get("/api/data", (c) => c.json({ status: "success", content: "Monetized Payl
48
70
 
49
71
  export default app;
50
72
  ```
73
+
51
74
  ## Usage Case 2: Monetizing MCP (Model Context Protocol) Tools
75
+
52
76
  ```typescript
53
77
  import { createMonetizedMCPTool } from "@warppay402/server";
54
78
 
@@ -61,7 +85,9 @@ const originalTool = {
61
85
  }
62
86
  };
63
87
 
88
+
64
89
  export const monetizedTool = createMonetizedMCPTool(originalTool, {
90
+
65
91
  price: "0.02", // $0.02 USDC
66
92
  payTo: "0xYourMerchantWalletAddress",
67
93
  platformWallet: "0xYourPlatformTreasuryWallet",
@@ -70,6 +96,7 @@ export const monetizedTool = createMonetizedMCPTool(originalTool, {
70
96
  ```
71
97
 
72
98
  ## Usage Case 3: Distributed Nonce Locking with Redis / Upstash
99
+
73
100
  ```typescript
74
101
  import { Redis } from "@upstash/redis";
75
102
  import { monetize, RedisNonceStore } from "@warppay402/server";
@@ -90,4 +117,5 @@ app.use(
90
117
  })
91
118
  );
92
119
  ```
120
+
93
121
  ## License: MIT © WarpPay402
@@ -4,11 +4,11 @@ import { monetize } from "../index.js";
4
4
  import { Hono } from "hono";
5
5
  const app = new Hono();
6
6
  // Define the developer's wallet address (where 99.5% of funds go)
7
- const developerWallet = "0x2bd4e0ea72e21155ec41f8613eafd433193c4d8b";
7
+ const developerWallet = "0xYOUR_NEW_WALLET_ADDRESS";
8
8
  app.use("/api/weather", monetize({
9
9
  price: "0.01",
10
10
  payTo: developerWallet,
11
- platformWallet: "0x2bd4e0ea72e21155ec41f8613eafd433193c4d8b",
11
+ platformWallet: "0xYOUR_NEW_WALLET_ADDRESS",
12
12
  platformFeeBps: 50,
13
13
  facilitatorUrl: "https://warppay402.com"
14
14
  }));
@@ -4,12 +4,9 @@ import { Hono } from "hono";
4
4
  import { createWalletClient, http, parseAbi, verifyTypedData } from "viem";
5
5
  import { privateKeyToAccount } from "viem/accounts";
6
6
  import { base } from "viem/chains";
7
+ import { Connection, VersionedTransaction } from "@solana/web3.js";
7
8
  const app = new Hono();
8
- // Log every incoming request URL to debug the exact path hit by the SDK
9
- app.use("*", async (c, next) => {
10
- console.log(`[Facilitator Debug] Incoming ${c.req.method} request to path: ${c.req.path}`);
11
- await next();
12
- });
9
+ // Base Viem Setup
13
10
  const FACILITATOR_PRIVATE_KEY = process.env.FACILITATOR_PRIVATE_KEY;
14
11
  if (!FACILITATOR_PRIVATE_KEY) {
15
12
  console.error("Please set FACILITATOR_PRIVATE_KEY with a Base gas-holding key.");
@@ -21,29 +18,50 @@ const walletClient = createWalletClient({
21
18
  chain: base,
22
19
  transport: http(process.env.RPC_URL || "https://mainnet.base.org"),
23
20
  });
21
+ // Solana RPC Setup
22
+ const solanaConnection = new Connection(process.env.SOLANA_RPC_URL || "https://api.mainnet-beta.solana.com", "confirmed");
24
23
  const usdcAbi = parseAbi([
25
24
  "function transferWithAuthorization(address from, address to, uint256 value, uint256 validAfter, uint256 validBefore, bytes32 nonce, uint8 v, bytes32 r, bytes32 s) external",
26
25
  ]);
27
- // Shared handler logic for signature verification and on-chain broadcasting
28
26
  const handleSettle = async (c) => {
29
27
  try {
30
28
  const body = await c.req.json();
31
- // Extract authorization & signature regardless of payload nesting depth
29
+ // Check if request is a Solana Settlement
30
+ const isSolana = body.network?.includes("solana") ||
31
+ body.paymentRequirements?.network?.includes("solana") ||
32
+ body.paymentPayload?.network?.includes("solana");
33
+ if (isSolana) {
34
+ // 1. Extract serialized Solana transaction
35
+ const serializedTx = body.signature || body.paymentPayload?.signature || body.serializedTransaction;
36
+ if (!serializedTx) {
37
+ return c.json({ success: false, error: "Missing Solana transaction payload" }, 400);
38
+ }
39
+ // 2. Decode and broadcast Versioned Transaction to Solana L1
40
+ const txBuffer = Buffer.from(serializedTx, "base64");
41
+ const transaction = VersionedTransaction.deserialize(txBuffer);
42
+ const txHash = await solanaConnection.sendRawTransaction(transaction.serialize(), {
43
+ skipPreflight: false,
44
+ preflightCommitment: "confirmed",
45
+ });
46
+ return c.json({
47
+ success: true,
48
+ txHash,
49
+ network: "solana:5eykt4wA89m8E5b9B5658p445VTc28",
50
+ });
51
+ }
52
+ // Default EVM (Base) Settlement Path
32
53
  const authorization = body.authorization ||
33
54
  body.payload?.authorization ||
34
55
  body.paymentPayload?.authorization ||
35
- body.paymentPayload?.payload?.authorization ||
36
- body.payload?.payload?.authorization;
56
+ body.paymentPayload?.payload?.authorization;
37
57
  const signature = body.signature ||
38
58
  body.payload?.signature ||
39
59
  body.paymentPayload?.signature ||
40
- body.paymentPayload?.payload?.signature ||
41
- body.payload?.payload?.signature;
60
+ body.paymentPayload?.payload?.signature;
42
61
  if (!signature || !authorization) {
43
- console.log("[Facilitator Debug] Received Body:", JSON.stringify(body, null, 2));
44
62
  return c.json({ success: false, error: "Missing signature or authorization payload" }, 400);
45
63
  }
46
- // 1. Verify EIP-712 Signature Off-Chain
64
+ // Verify & Broadcast EVM EIP-712
47
65
  const domain = {
48
66
  name: "USD Coin",
49
67
  version: "2",
@@ -78,11 +96,9 @@ const handleSettle = async (c) => {
78
96
  if (!isValid) {
79
97
  return c.json({ success: false, error: "Invalid EIP-712 signature" }, 402);
80
98
  }
81
- // 2. Extract v, r, s
82
99
  const r = `0x${signature.slice(2, 66)}`;
83
100
  const s = `0x${signature.slice(66, 130)}`;
84
101
  const v = parseInt(signature.slice(130, 132), 16);
85
- // 3. Broadcast to Base Mainnet using transferWithAuthorization
86
102
  const txHash = await walletClient.writeContract({
87
103
  address: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
88
104
  abi: usdcAbi,
@@ -109,7 +125,6 @@ const handleSettle = async (c) => {
109
125
  return c.json({ success: false, error: err.message }, 500);
110
126
  }
111
127
  };
112
- // Listen on all standard routes to prevent 404 mismatch
113
128
  app.post("/", handleSettle);
114
129
  app.post("/settle", handleSettle);
115
130
  app.post("/verify", handleSettle);
@@ -2,7 +2,7 @@ import { MemoryNonceStore } from "./monetize";
2
2
  const DEFAULT_USDC_BASE = "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913";
3
3
  const DEFAULT_NETWORK = "eip155:8453";
4
4
  const DEFAULT_FACILITATOR = "https://warppay402.com";
5
- const DEFAULT_PLATFORM_WALLET = "0x2bd4e0ea72e21155ec41f8613eafd433193c4d8b";
5
+ const DEFAULT_PLATFORM_WALLET = "0xYOUR_NEW_WALLET_ADDRESS";
6
6
  const defaultMemoryStore = new MemoryNonceStore();
7
7
  function parseTokenUnits(priceStr) {
8
8
  const normalized = String(priceStr).trim();
@@ -34,5 +34,6 @@ export interface MonetizeOptions {
34
34
  timeoutMs?: number;
35
35
  enableCorsHeaders?: boolean;
36
36
  guard?: boolean | GuardOptions;
37
+ accepts?: Array<Record<string, any>>;
37
38
  }
38
39
  export declare function monetize(options: MonetizeOptions): (c: Context, next: Next) => Promise<void | Response>;
package/dist/monetize.js CHANGED
@@ -55,7 +55,7 @@ const defaultMemoryStore = new MemoryNonceStore();
55
55
  const DEFAULT_USDC_BASE = "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913";
56
56
  const DEFAULT_NETWORK = "eip155:8453";
57
57
  const DEFAULT_FACILITATOR = "https://warppay402.com";
58
- const DEFAULT_PLATFORM_WALLET = "0x2bd4e0ea72e21155ec41f8613eafd433193c4d8b";
58
+ const DEFAULT_PLATFORM_WALLET = "0xYOUR_NEW_WALLET_ADDRESS";
59
59
  function toBase64(str) {
60
60
  const bytes = new TextEncoder().encode(str);
61
61
  let binary = "";
@@ -74,8 +74,11 @@ function parseTokenUnits(priceStr) {
74
74
  return BigInt(whole + paddedFraction);
75
75
  }
76
76
  export function monetize(options) {
77
- if (!options.payTo || !options.payTo.startsWith("0x") || options.payTo.length !== 42) {
78
- throw new Error("[Monetize] A valid 42-character EVM wallet address is required for 'payTo'.");
77
+ // NEW MULTI-CHAIN ADDRESS CHECK
78
+ const isEvm = options.payTo?.startsWith("0x") && options.payTo.length === 42;
79
+ const isSolana = options.payTo && options.payTo.length >= 32 && options.payTo.length <= 44;
80
+ if (!isEvm && !isSolana) {
81
+ throw new Error("[Monetize] 'payTo' must be a valid EVM address (0x...) or Solana public key.");
79
82
  }
80
83
  const asset = options.asset || DEFAULT_USDC_BASE;
81
84
  const network = options.network || DEFAULT_NETWORK;
@@ -119,7 +122,7 @@ export function monetize(options) {
119
122
  description: options.description || "Monetized API Access",
120
123
  mimeType: "application/json"
121
124
  },
122
- accepts: [
125
+ accepts: options.accepts || [
123
126
  {
124
127
  scheme: "exact",
125
128
  network,
@@ -6,13 +6,13 @@ if (!PRIVATE_KEY) {
6
6
  console.error("Please set process.env.PRIVATE_KEY");
7
7
  process.exit(1);
8
8
  }
9
- const account = privateKeyToAccount(PRIVATE_KEY);
9
+ const account = privateKeyToAccount(PRIVATE_KEY.startsWith("0x") ? PRIVATE_KEY : `0x${PRIVATE_KEY}`);
10
10
  const walletClient = createWalletClient({
11
11
  account,
12
12
  chain: base,
13
13
  transport: http("https://mainnet.base.org")
14
14
  });
15
- const API_URL = process.env.API_URL || "http://localhost:3000/api/weather";
15
+ const API_URL = process.env.API_URL || "http://localhost:3005/public_data_feed/base-usdc-token-contract.json";
16
16
  async function executeAgentPayment() {
17
17
  console.log(`[Agent] Probing endpoint: ${API_URL}`);
18
18
  // Step 1: Retrieve 402 challenge
@@ -27,7 +27,9 @@ async function executeAgentPayment() {
27
27
  }
28
28
  const challenge = JSON.parse(atob(paymentRequiredHeader));
29
29
  const requirement = challenge.accepts[0];
30
- console.log(`[Agent] Payment required: $${Number(requirement.amount) / 1e6} USDC on Base`);
30
+ // Resolve amount safely (default to 1000 base units / 0.001 USDC if undefined)
31
+ const baseUnits = BigInt(requirement.amount || "1000");
32
+ console.log(`[Agent] Payment required: $${Number(baseUnits) / 1e6} USDC on Base`);
31
33
  // Step 2: Sign EIP-712 payment authorization
32
34
  const domain = {
33
35
  name: "USD Coin",
@@ -49,12 +51,13 @@ async function executeAgentPayment() {
49
51
  const nonce = `0x${Array.from(crypto.getRandomValues(new Uint8Array(32)))
50
52
  .map((b) => b.toString(16).padStart(2, "0"))
51
53
  .join("")}`;
54
+ const maxTimeout = requirement.maxTimeoutSeconds || 300;
52
55
  const authorization = {
53
56
  from: account.address,
54
57
  to: requirement.payTo,
55
- value: requirement.amount,
58
+ value: baseUnits.toString(),
56
59
  validAfter: (now - 60).toString(),
57
- validBefore: (now + requirement.maxTimeoutSeconds).toString(),
60
+ validBefore: (now + maxTimeout).toString(),
58
61
  nonce
59
62
  };
60
63
  const signatureHex = await walletClient.signTypedData({
@@ -64,13 +67,13 @@ async function executeAgentPayment() {
64
67
  message: {
65
68
  from: account.address,
66
69
  to: requirement.payTo,
67
- value: BigInt(requirement.amount),
70
+ value: baseUnits,
68
71
  validAfter: BigInt(now - 60),
69
- validBefore: BigInt(now + requirement.maxTimeoutSeconds),
72
+ validBefore: BigInt(now + maxTimeout),
70
73
  nonce
71
74
  }
72
75
  });
73
- // Step 3: Construct root-level payment payload compatible with XPay relayer
76
+ // Step 3: Construct payment payload
74
77
  const paymentSignaturePayload = JSON.stringify({
75
78
  x402Version: 2,
76
79
  scheme: "exact",
@@ -89,6 +92,6 @@ async function executeAgentPayment() {
89
92
  });
90
93
  const responseData = await paidRes.json();
91
94
  console.log(`[Server Status]: ${paidRes.status}`);
92
- console.log("[Server Payload]:", responseData);
95
+ console.log("[Server Payload]:", JSON.stringify(responseData, null, 2));
93
96
  }
94
97
  executeAgentPayment().catch(console.error);
package/dist/server.js CHANGED
@@ -4,10 +4,12 @@ import { monetize } from "./monetize.js";
4
4
  import { Hono } from "hono";
5
5
  const app = new Hono();
6
6
  // Define the developer's wallet address (where 99.5% of funds go)
7
- const developerWallet = "0x2bd4e0ea72e21155ec41f8613eafd433193c4d8b";
7
+ const developerWallet = "0xYOUR_NEW_WALLET_ADDRESS";
8
8
  // 1. PUBLIC HEALTH & MCP DISCOVERY ROUTES (No 402 Payment Required)
9
9
  app.get("/", (c) => c.json({ status: "ok", service: "WarpPay402 Gateway" }));
10
10
  app.get("/health", (c) => c.json({ status: "healthy" }));
11
+ // Redirect root /mcp.json to /.well-known/mcp.json
12
+ app.get("/mcp.json", (c) => c.redirect("/.well-known/mcp.json"));
11
13
  // Standard OpenClaw & Smithery plugin manifest routes
12
14
  app.get("/openclaw.plugin.json", (c) => c.json({
13
15
  name: "warppay402-server",
@@ -63,7 +65,7 @@ app.post("/mcp", async (c) => {
63
65
  app.use("/api/weather", monetize({
64
66
  price: "0.01",
65
67
  payTo: developerWallet,
66
- platformWallet: "0x2bd4e0ea72e21155ec41f8613eafd433193c4d8b",
68
+ platformWallet: "0xYOUR_NEW_WALLET_ADDRESS",
67
69
  platformFeeBps: 50,
68
70
  facilitatorUrl: "https://warppay402.com"
69
71
  }));
@@ -1 +1 @@
1
- {"version":"7.0.2","root":["../demo.ts","../facilitator.ts","../guard.ts","../index.ts","../mcpWrapper.ts","../monetize.ts","../pay_client.ts","../server.ts","../examples/basic-monetized-server.ts"],"packageJsons":["../node_modules/@hono/node-server/package.json","../node_modules/@noble/curves/esm/package.json","../node_modules/@noble/curves/package.json","../node_modules/@noble/hashes/esm/package.json","../node_modules/@noble/hashes/package.json","../node_modules/@scure/bip32/lib/esm/package.json","../node_modules/@scure/bip32/package.json","../node_modules/@scure/bip39/esm/package.json","../node_modules/@scure/bip39/package.json","../node_modules/@types/node/package.json","../node_modules/abitype/package.json","../node_modules/dotenv/package.json","../node_modules/eventemitter3/package.json","../node_modules/hono/dist/types/package.json","../node_modules/hono/package.json","../node_modules/ox/AbiFunction/package.json","../node_modules/ox/BlockOverrides/package.json","../node_modules/ox/Hex/package.json","../node_modules/ox/RpcResponse/package.json","../node_modules/ox/WebAuthnP256/package.json","../node_modules/ox/package.json","../node_modules/ox/tempo/KeyAuthorization/package.json","../node_modules/ox/tempo/MultisigConfig/package.json","../node_modules/ox/tempo/SignatureEnvelope/package.json","../node_modules/ox/tempo/TempoAddress/package.json","../node_modules/ox/tempo/TokenId/package.json","../node_modules/ox/tempo/TxEnvelopeTempo/package.json","../node_modules/ox/tempo/package.json","../node_modules/typescript/package.json","../node_modules/undici-types/package.json","../node_modules/viem/_types/package.json","../node_modules/viem/accounts/package.json","../node_modules/viem/chains/package.json","../node_modules/viem/package.json","../package.json"],"missingPackageJsons":["../node_modules/@hono/node-server/dist/package.json","../node_modules/@noble/curves/_shortw_utils/package.json","../node_modules/@noble/curves/abstract/bls/package.json","../node_modules/@noble/curves/abstract/edwards/package.json","../node_modules/@noble/curves/abstract/montgomery/package.json","../node_modules/@noble/curves/esm/abstract/package.json","../node_modules/@noble/hashes/utils/package.json","../node_modules/@scure/bip39/esm/wordlists/package.json","../node_modules/@scure/bip39/wordlists/czech/package.json","../node_modules/@scure/bip39/wordlists/english/package.json","../node_modules/@scure/bip39/wordlists/french/package.json","../node_modules/@scure/bip39/wordlists/italian/package.json","../node_modules/@scure/bip39/wordlists/japanese/package.json","../node_modules/@scure/bip39/wordlists/korean/package.json","../node_modules/@scure/bip39/wordlists/portuguese/package.json","../node_modules/@scure/bip39/wordlists/simplified-chinese/package.json","../node_modules/@scure/bip39/wordlists/spanish/package.json","../node_modules/@scure/bip39/wordlists/traditional-chinese/package.json","../node_modules/@types/assert/package.json","../node_modules/@types/assert/strict/package.json","../node_modules/@types/async_hooks/package.json","../node_modules/@types/buffer/package.json","../node_modules/@types/child_process/package.json","../node_modules/@types/cluster/package.json","../node_modules/@types/console/package.json","../node_modules/@types/constants/package.json","../node_modules/@types/crypto/package.json","../node_modules/@types/dgram/package.json","../node_modules/@types/diagnostics_channel/package.json","../node_modules/@types/dns/package.json","../node_modules/@types/dns/promises/package.json","../node_modules/@types/domain/package.json","../node_modules/@types/events/package.json","../node_modules/@types/fs/package.json","../node_modules/@types/fs/promises/package.json","../node_modules/@types/http/package.json","../node_modules/@types/http2/package.json","../node_modules/@types/https/package.json","../node_modules/@types/inspector/package.json","../node_modules/@types/inspector/promises/package.json","../node_modules/@types/module/package.json","../node_modules/@types/net/package.json","../node_modules/@types/node/assert/package.json","../node_modules/@types/node/dns/package.json","../node_modules/@types/node/fs/package.json","../node_modules/@types/node/inspector/package.json","../node_modules/@types/node/path/package.json","../node_modules/@types/node/readline/package.json","../node_modules/@types/node/stream/package.json","../node_modules/@types/node/test/package.json","../node_modules/@types/node/timers/package.json","../node_modules/@types/node/util/package.json","../node_modules/@types/node/web-globals/package.json","../node_modules/@types/node/zlib/package.json","../node_modules/@types/os/package.json","../node_modules/@types/path/package.json","../node_modules/@types/path/posix/package.json","../node_modules/@types/path/win32/package.json","../node_modules/@types/perf_hooks/package.json","../node_modules/@types/process/package.json","../node_modules/@types/punycode/package.json","../node_modules/@types/querystring/package.json","../node_modules/@types/readline/package.json","../node_modules/@types/readline/promises/package.json","../node_modules/@types/repl/package.json","../node_modules/@types/stream/consumers/package.json","../node_modules/@types/stream/iter/package.json","../node_modules/@types/stream/package.json","../node_modules/@types/stream/promises/package.json","../node_modules/@types/stream/web/package.json","../node_modules/@types/string_decoder/package.json","../node_modules/@types/timers/package.json","../node_modules/@types/timers/promises/package.json","../node_modules/@types/tls/package.json","../node_modules/@types/trace_events/package.json","../node_modules/@types/tty/package.json","../node_modules/@types/url/package.json","../node_modules/@types/util/package.json","../node_modules/@types/util/types/package.json","../node_modules/@types/v8/package.json","../node_modules/@types/vm/package.json","../node_modules/@types/wasi/package.json","../node_modules/@types/worker_threads/package.json","../node_modules/@types/zlib/package.json","../node_modules/abitype/dist/package.json","../node_modules/abitype/dist/types/exports/package.json","../node_modules/abitype/dist/types/human-readable/errors/package.json","../node_modules/abitype/dist/types/human-readable/package.json","../node_modules/abitype/dist/types/human-readable/types/package.json","../node_modules/abitype/dist/types/package.json","../node_modules/assert/package.json","../node_modules/assert/strict/package.json","../node_modules/async_hooks/package.json","../node_modules/buffer/package.json","../node_modules/child_process/package.json","../node_modules/cluster/package.json","../node_modules/console/package.json","../node_modules/constants/package.json","../node_modules/crypto/package.json","../node_modules/dgram/package.json","../node_modules/diagnostics_channel/package.json","../node_modules/dns/package.json","../node_modules/dns/promises/package.json","../node_modules/domain/package.json","../node_modules/dotenv/config/package.json","../node_modules/events/package.json","../node_modules/fs/package.json","../node_modules/fs/promises/package.json","../node_modules/hono/dist/types/client/package.json","../node_modules/hono/dist/types/helper/package.json","../node_modules/hono/dist/types/helper/websocket/package.json","../node_modules/hono/dist/types/request/package.json","../node_modules/hono/dist/types/utils/package.json","../node_modules/hono/ws/package.json","../node_modules/http/package.json","../node_modules/http2/package.json","../node_modules/https/package.json","../node_modules/inspector/package.json","../node_modules/inspector/promises/package.json","../node_modules/module/package.json","../node_modules/net/package.json","../node_modules/os/package.json","../node_modules/ox/_types/core/internal/mnemonic/package.json","../node_modules/ox/_types/core/internal/package.json","../node_modules/ox/_types/core/internal/rpcSchemas/package.json","../node_modules/ox/_types/core/package.json","../node_modules/ox/_types/package.json","../node_modules/ox/_types/tempo/package.json","../node_modules/ox/_types/webauthn/package.json","../node_modules/path/package.json","../node_modules/path/posix/package.json","../node_modules/path/win32/package.json","../node_modules/perf_hooks/package.json","../node_modules/process/package.json","../node_modules/punycode/package.json","../node_modules/querystring/package.json","../node_modules/readline/package.json","../node_modules/readline/promises/package.json","../node_modules/repl/package.json","../node_modules/stream/consumers/package.json","../node_modules/stream/iter/package.json","../node_modules/stream/package.json","../node_modules/stream/promises/package.json","../node_modules/stream/web/package.json","../node_modules/string_decoder/package.json","../node_modules/timers/package.json","../node_modules/timers/promises/package.json","../node_modules/tls/package.json","../node_modules/trace_events/package.json","../node_modules/tty/package.json","../node_modules/url/package.json","../node_modules/util/package.json","../node_modules/util/types/package.json","../node_modules/v8/package.json","../node_modules/viem/_types/account-abstraction/accounts/package.json","../node_modules/viem/_types/account-abstraction/package.json","../node_modules/viem/_types/account-abstraction/types/package.json","../node_modules/viem/_types/accounts/package.json","../node_modules/viem/_types/accounts/utils/package.json","../node_modules/viem/_types/actions/ens/package.json","../node_modules/viem/_types/actions/package.json","../node_modules/viem/_types/actions/public/package.json","../node_modules/viem/_types/actions/siwe/package.json","../node_modules/viem/_types/actions/test/package.json","../node_modules/viem/_types/actions/token/package.json","../node_modules/viem/_types/actions/wallet/package.json","../node_modules/viem/_types/celo/package.json","../node_modules/viem/_types/chains/definitions/package.json","../node_modules/viem/_types/chains/definitions/skale/package.json","../node_modules/viem/_types/chains/package.json","../node_modules/viem/_types/clients/decorators/package.json","../node_modules/viem/_types/clients/package.json","../node_modules/viem/_types/clients/transports/package.json","../node_modules/viem/_types/constants/package.json","../node_modules/viem/_types/errors/package.json","../node_modules/viem/_types/experimental/erc7895/actions/package.json","../node_modules/viem/_types/experimental/erc7895/package.json","../node_modules/viem/_types/experimental/package.json","../node_modules/viem/_types/op-stack/package.json","../node_modules/viem/_types/op-stack/types/package.json","../node_modules/viem/_types/tempo/package.json","../node_modules/viem/_types/tokens/package.json","../node_modules/viem/_types/types/package.json","../node_modules/viem/_types/utils/abi/package.json","../node_modules/viem/_types/utils/address/package.json","../node_modules/viem/_types/utils/authorization/package.json","../node_modules/viem/_types/utils/blob/package.json","../node_modules/viem/_types/utils/block/package.json","../node_modules/viem/_types/utils/chain/package.json","../node_modules/viem/_types/utils/data/package.json","../node_modules/viem/_types/utils/encoding/package.json","../node_modules/viem/_types/utils/ens/avatar/package.json","../node_modules/viem/_types/utils/ens/package.json","../node_modules/viem/_types/utils/errors/package.json","../node_modules/viem/_types/utils/formatters/package.json","../node_modules/viem/_types/utils/hash/package.json","../node_modules/viem/_types/utils/kzg/package.json","../node_modules/viem/_types/utils/package.json","../node_modules/viem/_types/utils/promise/package.json","../node_modules/viem/_types/utils/rpc/package.json","../node_modules/viem/_types/utils/signature/package.json","../node_modules/viem/_types/utils/siwe/package.json","../node_modules/viem/_types/utils/transaction/package.json","../node_modules/viem/_types/utils/unit/package.json","../node_modules/viem/_types/zksync/accounts/package.json","../node_modules/viem/_types/zksync/actions/package.json","../node_modules/viem/_types/zksync/constants/package.json","../node_modules/viem/_types/zksync/decorators/package.json","../node_modules/viem/_types/zksync/errors/package.json","../node_modules/viem/_types/zksync/package.json","../node_modules/viem/_types/zksync/types/package.json","../node_modules/viem/_types/zksync/utils/abi/package.json","../node_modules/viem/_types/zksync/utils/bridge/package.json","../node_modules/viem/_types/zksync/utils/package.json","../node_modules/viem/_types/zksync/utils/paymaster/package.json","../node_modules/vm/package.json","../node_modules/wasi/package.json","../node_modules/worker_threads/package.json","../node_modules/zlib/package.json","../node_modules/zod/package.json"]}
1
+ {"version":"7.0.2","root":["../demo.ts","../facilitator.ts","../guard.ts","../index.ts","../mcpWrapper.ts","../monetize.ts","../pay_client.ts","../server.ts","../examples/basic-monetized-server.ts"],"packageJsons":["../node_modules/@hono/node-server/package.json","../node_modules/@noble/curves/esm/package.json","../node_modules/@noble/curves/package.json","../node_modules/@noble/hashes/esm/package.json","../node_modules/@noble/hashes/package.json","../node_modules/@scure/bip32/lib/esm/package.json","../node_modules/@scure/bip32/package.json","../node_modules/@scure/bip39/esm/package.json","../node_modules/@scure/bip39/package.json","../node_modules/@solana/web3.js/package.json","../node_modules/@types/node/package.json","../node_modules/abitype/package.json","../node_modules/buffer/package.json","../node_modules/dotenv/package.json","../node_modules/eventemitter3/package.json","../node_modules/hono/dist/types/package.json","../node_modules/hono/package.json","../node_modules/ox/AbiFunction/package.json","../node_modules/ox/BlockOverrides/package.json","../node_modules/ox/Hex/package.json","../node_modules/ox/RpcResponse/package.json","../node_modules/ox/WebAuthnP256/package.json","../node_modules/ox/package.json","../node_modules/ox/tempo/KeyAuthorization/package.json","../node_modules/ox/tempo/MultisigConfig/package.json","../node_modules/ox/tempo/SignatureEnvelope/package.json","../node_modules/ox/tempo/TempoAddress/package.json","../node_modules/ox/tempo/TokenId/package.json","../node_modules/ox/tempo/TxEnvelopeTempo/package.json","../node_modules/ox/tempo/package.json","../node_modules/typescript/package.json","../node_modules/undici-types/package.json","../node_modules/viem/_types/package.json","../node_modules/viem/accounts/package.json","../node_modules/viem/chains/package.json","../node_modules/viem/package.json","../package.json"],"missingPackageJsons":["../node_modules/@hono/node-server/dist/package.json","../node_modules/@noble/curves/_shortw_utils/package.json","../node_modules/@noble/curves/abstract/bls/package.json","../node_modules/@noble/curves/abstract/edwards/package.json","../node_modules/@noble/curves/abstract/montgomery/package.json","../node_modules/@noble/curves/esm/abstract/package.json","../node_modules/@noble/hashes/utils/package.json","../node_modules/@scure/bip39/esm/wordlists/package.json","../node_modules/@scure/bip39/wordlists/czech/package.json","../node_modules/@scure/bip39/wordlists/english/package.json","../node_modules/@scure/bip39/wordlists/french/package.json","../node_modules/@scure/bip39/wordlists/italian/package.json","../node_modules/@scure/bip39/wordlists/japanese/package.json","../node_modules/@scure/bip39/wordlists/korean/package.json","../node_modules/@scure/bip39/wordlists/portuguese/package.json","../node_modules/@scure/bip39/wordlists/simplified-chinese/package.json","../node_modules/@scure/bip39/wordlists/spanish/package.json","../node_modules/@scure/bip39/wordlists/traditional-chinese/package.json","../node_modules/@solana/web3.js/lib/package.json","../node_modules/@types/assert/package.json","../node_modules/@types/assert/strict/package.json","../node_modules/@types/async_hooks/package.json","../node_modules/@types/child_process/package.json","../node_modules/@types/cluster/package.json","../node_modules/@types/console/package.json","../node_modules/@types/constants/package.json","../node_modules/@types/crypto/package.json","../node_modules/@types/dgram/package.json","../node_modules/@types/diagnostics_channel/package.json","../node_modules/@types/dns/package.json","../node_modules/@types/dns/promises/package.json","../node_modules/@types/domain/package.json","../node_modules/@types/events/package.json","../node_modules/@types/fs/package.json","../node_modules/@types/fs/promises/package.json","../node_modules/@types/http/package.json","../node_modules/@types/http2/package.json","../node_modules/@types/https/package.json","../node_modules/@types/inspector/package.json","../node_modules/@types/inspector/promises/package.json","../node_modules/@types/module/package.json","../node_modules/@types/net/package.json","../node_modules/@types/node/assert/package.json","../node_modules/@types/node/dns/package.json","../node_modules/@types/node/fs/package.json","../node_modules/@types/node/inspector/package.json","../node_modules/@types/node/path/package.json","../node_modules/@types/node/readline/package.json","../node_modules/@types/node/stream/package.json","../node_modules/@types/node/test/package.json","../node_modules/@types/node/timers/package.json","../node_modules/@types/node/util/package.json","../node_modules/@types/node/web-globals/package.json","../node_modules/@types/node/zlib/package.json","../node_modules/@types/os/package.json","../node_modules/@types/path/package.json","../node_modules/@types/path/posix/package.json","../node_modules/@types/path/win32/package.json","../node_modules/@types/perf_hooks/package.json","../node_modules/@types/process/package.json","../node_modules/@types/punycode/package.json","../node_modules/@types/querystring/package.json","../node_modules/@types/readline/package.json","../node_modules/@types/readline/promises/package.json","../node_modules/@types/repl/package.json","../node_modules/@types/stream/consumers/package.json","../node_modules/@types/stream/iter/package.json","../node_modules/@types/stream/package.json","../node_modules/@types/stream/promises/package.json","../node_modules/@types/stream/web/package.json","../node_modules/@types/string_decoder/package.json","../node_modules/@types/timers/package.json","../node_modules/@types/timers/promises/package.json","../node_modules/@types/tls/package.json","../node_modules/@types/trace_events/package.json","../node_modules/@types/tty/package.json","../node_modules/@types/url/package.json","../node_modules/@types/util/package.json","../node_modules/@types/util/types/package.json","../node_modules/@types/v8/package.json","../node_modules/@types/vm/package.json","../node_modules/@types/wasi/package.json","../node_modules/@types/worker_threads/package.json","../node_modules/@types/zlib/package.json","../node_modules/abitype/dist/package.json","../node_modules/abitype/dist/types/exports/package.json","../node_modules/abitype/dist/types/human-readable/errors/package.json","../node_modules/abitype/dist/types/human-readable/package.json","../node_modules/abitype/dist/types/human-readable/types/package.json","../node_modules/abitype/dist/types/package.json","../node_modules/assert/package.json","../node_modules/assert/strict/package.json","../node_modules/async_hooks/package.json","../node_modules/child_process/package.json","../node_modules/cluster/package.json","../node_modules/console/package.json","../node_modules/constants/package.json","../node_modules/crypto/package.json","../node_modules/dgram/package.json","../node_modules/diagnostics_channel/package.json","../node_modules/dns/package.json","../node_modules/dns/promises/package.json","../node_modules/domain/package.json","../node_modules/dotenv/config/package.json","../node_modules/events/package.json","../node_modules/fs/package.json","../node_modules/fs/promises/package.json","../node_modules/hono/dist/types/client/package.json","../node_modules/hono/dist/types/helper/package.json","../node_modules/hono/dist/types/helper/websocket/package.json","../node_modules/hono/dist/types/request/package.json","../node_modules/hono/dist/types/utils/package.json","../node_modules/hono/ws/package.json","../node_modules/http/package.json","../node_modules/http2/package.json","../node_modules/https/package.json","../node_modules/inspector/package.json","../node_modules/inspector/promises/package.json","../node_modules/module/package.json","../node_modules/net/package.json","../node_modules/os/package.json","../node_modules/ox/_types/core/internal/mnemonic/package.json","../node_modules/ox/_types/core/internal/package.json","../node_modules/ox/_types/core/internal/rpcSchemas/package.json","../node_modules/ox/_types/core/package.json","../node_modules/ox/_types/package.json","../node_modules/ox/_types/tempo/package.json","../node_modules/ox/_types/webauthn/package.json","../node_modules/path/package.json","../node_modules/path/posix/package.json","../node_modules/path/win32/package.json","../node_modules/perf_hooks/package.json","../node_modules/process/package.json","../node_modules/punycode/package.json","../node_modules/querystring/package.json","../node_modules/readline/package.json","../node_modules/readline/promises/package.json","../node_modules/repl/package.json","../node_modules/stream/consumers/package.json","../node_modules/stream/iter/package.json","../node_modules/stream/package.json","../node_modules/stream/promises/package.json","../node_modules/stream/web/package.json","../node_modules/string_decoder/package.json","../node_modules/timers/package.json","../node_modules/timers/promises/package.json","../node_modules/tls/package.json","../node_modules/trace_events/package.json","../node_modules/tty/package.json","../node_modules/url/package.json","../node_modules/util/package.json","../node_modules/util/types/package.json","../node_modules/v8/package.json","../node_modules/viem/_types/account-abstraction/accounts/package.json","../node_modules/viem/_types/account-abstraction/package.json","../node_modules/viem/_types/account-abstraction/types/package.json","../node_modules/viem/_types/accounts/package.json","../node_modules/viem/_types/accounts/utils/package.json","../node_modules/viem/_types/actions/ens/package.json","../node_modules/viem/_types/actions/package.json","../node_modules/viem/_types/actions/public/package.json","../node_modules/viem/_types/actions/siwe/package.json","../node_modules/viem/_types/actions/test/package.json","../node_modules/viem/_types/actions/token/package.json","../node_modules/viem/_types/actions/wallet/package.json","../node_modules/viem/_types/celo/package.json","../node_modules/viem/_types/chains/definitions/package.json","../node_modules/viem/_types/chains/definitions/skale/package.json","../node_modules/viem/_types/chains/package.json","../node_modules/viem/_types/clients/decorators/package.json","../node_modules/viem/_types/clients/package.json","../node_modules/viem/_types/clients/transports/package.json","../node_modules/viem/_types/constants/package.json","../node_modules/viem/_types/errors/package.json","../node_modules/viem/_types/experimental/erc7895/actions/package.json","../node_modules/viem/_types/experimental/erc7895/package.json","../node_modules/viem/_types/experimental/package.json","../node_modules/viem/_types/op-stack/package.json","../node_modules/viem/_types/op-stack/types/package.json","../node_modules/viem/_types/tempo/package.json","../node_modules/viem/_types/tokens/package.json","../node_modules/viem/_types/types/package.json","../node_modules/viem/_types/utils/abi/package.json","../node_modules/viem/_types/utils/address/package.json","../node_modules/viem/_types/utils/authorization/package.json","../node_modules/viem/_types/utils/blob/package.json","../node_modules/viem/_types/utils/block/package.json","../node_modules/viem/_types/utils/chain/package.json","../node_modules/viem/_types/utils/data/package.json","../node_modules/viem/_types/utils/encoding/package.json","../node_modules/viem/_types/utils/ens/avatar/package.json","../node_modules/viem/_types/utils/ens/package.json","../node_modules/viem/_types/utils/errors/package.json","../node_modules/viem/_types/utils/formatters/package.json","../node_modules/viem/_types/utils/hash/package.json","../node_modules/viem/_types/utils/kzg/package.json","../node_modules/viem/_types/utils/package.json","../node_modules/viem/_types/utils/promise/package.json","../node_modules/viem/_types/utils/rpc/package.json","../node_modules/viem/_types/utils/signature/package.json","../node_modules/viem/_types/utils/siwe/package.json","../node_modules/viem/_types/utils/transaction/package.json","../node_modules/viem/_types/utils/unit/package.json","../node_modules/viem/_types/zksync/accounts/package.json","../node_modules/viem/_types/zksync/actions/package.json","../node_modules/viem/_types/zksync/constants/package.json","../node_modules/viem/_types/zksync/decorators/package.json","../node_modules/viem/_types/zksync/errors/package.json","../node_modules/viem/_types/zksync/package.json","../node_modules/viem/_types/zksync/types/package.json","../node_modules/viem/_types/zksync/utils/abi/package.json","../node_modules/viem/_types/zksync/utils/bridge/package.json","../node_modules/viem/_types/zksync/utils/package.json","../node_modules/viem/_types/zksync/utils/paymaster/package.json","../node_modules/vm/package.json","../node_modules/wasi/package.json","../node_modules/worker_threads/package.json","../node_modules/zlib/package.json","../node_modules/zod/package.json"]}
@@ -1,10 +1,16 @@
1
1
  {
2
+ "id": "warppay402-server",
2
3
  "name": "warppay402-server",
3
- "version": "1.0.0",
4
- "description": "Instant MCP Tool & x402 Monetization SDK for Cloudflare Gateway and Base",
4
+ "version": "1.1.0",
5
+ "description": "Self-hosted x402 monetization server for MCP tools and HTTP APIs: Non-custodial, multi-chain payments across Base Mainnet and Solana L1.",
5
6
  "main": "dist/index.js",
6
7
  "type": "mcp-server",
7
8
  "config": {
8
9
  "url": "https://api.warppay402.com/.well-known/mcp.json"
10
+ },
11
+ "configSchema": {
12
+ "type": "object",
13
+ "additionalProperties": false,
14
+ "properties": {}
9
15
  }
10
16
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@warppay402/server",
3
- "version": "1.0.1",
3
+ "version": "1.1.1",
4
4
  "description": "Instant MCP Tool & x402 Monetization SDK for Cloudflare Gateway and Base",
5
5
  "homepage": "https://www.warppay402.com",
6
6
  "main": "./dist/index.js",
@@ -15,11 +15,14 @@
15
15
  },
16
16
  "openclaw": {
17
17
  "type": "mcp-server",
18
+ "extensions": [
19
+ "./dist/index.js"
20
+ ],
18
21
  "compat": {
19
22
  "pluginApi": ">=1.0.0"
20
23
  },
21
24
  "build": {
22
- "openclawVersion": "1.0.0"
25
+ "openclawVersion": "1.1.0"
23
26
  },
24
27
  "config": {
25
28
  "url": "https://api.warppay402.com/.well-known/mcp.json"
@@ -34,7 +37,12 @@
34
37
  "usdc",
35
38
  "hono",
36
39
  "ai-agents",
37
- "warppay402"
40
+ "warppay402",
41
+ "solana",
42
+ "middleware",
43
+ "cloudfare",
44
+ "ai-agents",
45
+ "model-context-protocal"
38
46
  ],
39
47
  "repository": {
40
48
  "type": "git",
@@ -52,6 +60,7 @@
52
60
  },
53
61
  "dependencies": {
54
62
  "@hono/node-server": "^2.1.0",
63
+ "@solana/web3.js": "^1.98.4",
55
64
  "@xpaysh/x402": "^0.1.2",
56
65
  "dotenv": "^17.4.2",
57
66
  "hono": "^4.13.0",
@@ -63,4 +72,4 @@
63
72
  "typescript": "^7.0.2",
64
73
  "vitest": "^4.1.10"
65
74
  }
66
- }
75
+ }