@warppay402/server 1.0.0 → 1.0.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/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { monetize, MemoryNonceStore, RedisNonceStore, type MonetizeOptions, type NonceStore } from "./monetize";
2
- export { createMonetizedMCPTool, type MCPToolDefinition } from "./mcpWrapper";
1
+ export { monetize, MemoryNonceStore, RedisNonceStore, type MonetizeOptions, type NonceStore } from "./monetize.js";
2
+ export { createMonetizedMCPTool, type MCPToolDefinition } from "./mcpWrapper.js";
3
3
  export { x402Guard, scanPayloadForInjection } from "./guard.js";
4
4
  export type { GuardOptions } from "./guard.js";
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
- export { monetize, MemoryNonceStore, RedisNonceStore } from "./monetize";
2
- export { createMonetizedMCPTool } from "./mcpWrapper";
1
+ export { monetize, MemoryNonceStore, RedisNonceStore } from "./monetize.js";
2
+ export { createMonetizedMCPTool } from "./mcpWrapper.js";
3
3
  export { x402Guard, scanPayloadForInjection } from "./guard.js";
package/dist/server.js CHANGED
@@ -5,6 +5,61 @@ 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
7
  const developerWallet = "0x2bd4e0ea72e21155ec41f8613eafd433193c4d8b";
8
+ // 1. PUBLIC HEALTH & MCP DISCOVERY ROUTES (No 402 Payment Required)
9
+ app.get("/", (c) => c.json({ status: "ok", service: "WarpPay402 Gateway" }));
10
+ app.get("/health", (c) => c.json({ status: "healthy" }));
11
+ // Standard OpenClaw & Smithery plugin manifest routes
12
+ app.get("/openclaw.plugin.json", (c) => c.json({
13
+ name: "warppay402-server",
14
+ version: "1.0.0",
15
+ description: "Instant MCP Tool & x402 Monetization SDK for Cloudflare Gateway and Base",
16
+ main: "dist/index.js",
17
+ type: "mcp-server",
18
+ config: {
19
+ url: "https://api.warppay402.com/.well-known/mcp.json"
20
+ }
21
+ }));
22
+ app.get("/.well-known/mcp.json", (c) => c.json({
23
+ schema_version: "v1",
24
+ name_for_model: "warppay_weather",
25
+ name_for_human: "WarpPay Weather Tool",
26
+ description_for_model: "Monetized weather data API on Base Mainnet via x402 micro-payments.",
27
+ api: {
28
+ type: "openapi",
29
+ url: "https://api.warppay402.com/api/weather"
30
+ }
31
+ }));
32
+ // MCP JSON-RPC protocol endpoint for tool discovery
33
+ app.post("/mcp", async (c) => {
34
+ try {
35
+ const body = await c.req.json();
36
+ if (body.method === "tools/list" || body.method === "initialize") {
37
+ return c.json({
38
+ jsonrpc: "2.0",
39
+ id: body.id ?? 1,
40
+ result: {
41
+ tools: [
42
+ {
43
+ name: "get_weather",
44
+ description: "Fetch live city weather (Costs $0.01 USDC via x402)",
45
+ inputSchema: {
46
+ type: "object",
47
+ properties: {
48
+ city: { type: "string", description: "City name, e.g., Austin" }
49
+ }
50
+ }
51
+ }
52
+ ]
53
+ }
54
+ });
55
+ }
56
+ return c.json({ jsonrpc: "2.0", id: body.id ?? 1, error: { code: -32601, message: "Method not found" } });
57
+ }
58
+ catch {
59
+ return c.json({ jsonrpc: "2.0", id: 1, error: { code: -32700, message: "Parse error" } });
60
+ }
61
+ });
62
+ // 2. MONETIZED API ROUTES (x402 Payment Guarded)
8
63
  app.use("/api/weather", monetize({
9
64
  price: "0.01",
10
65
  payTo: developerWallet,
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "warppay402-server",
3
+ "version": "1.0.0",
4
+ "description": "Instant MCP Tool & x402 Monetization SDK for Cloudflare Gateway and Base",
5
+ "main": "dist/index.js",
6
+ "type": "mcp-server",
7
+ "config": {
8
+ "url": "https://api.warppay402.com/.well-known/mcp.json"
9
+ }
10
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@warppay402/server",
3
- "version": "1.0.0",
3
+ "version": "1.0.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",
@@ -13,6 +13,18 @@
13
13
  "default": "./dist/index.js"
14
14
  }
15
15
  },
16
+ "openclaw": {
17
+ "type": "mcp-server",
18
+ "compat": {
19
+ "pluginApi": ">=1.0.0"
20
+ },
21
+ "build": {
22
+ "openclawVersion": "1.0.0"
23
+ },
24
+ "config": {
25
+ "url": "https://api.warppay402.com/.well-known/mcp.json"
26
+ }
27
+ },
16
28
  "license": "MIT",
17
29
  "keywords": [
18
30
  "x402",
@@ -29,7 +41,8 @@
29
41
  "url": "git+https://github.com/golfgolfgolf200/warppay402-server.git"
30
42
  },
31
43
  "files": [
32
- "dist"
44
+ "dist",
45
+ "openclaw.plugin.json"
33
46
  ],
34
47
  "scripts": {
35
48
  "build": "tsc --build",