@warppay402/server 1.0.0 → 1.1.0
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 +38 -10
- package/dist/facilitator.js +31 -16
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/monetize.d.ts +1 -0
- package/dist/monetize.js +6 -3
- package/dist/server.js +57 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/openclaw.plugin.json +16 -0
- package/package.json +22 -4
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
|
|
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
|
-
- **
|
|
15
|
-
- **Gasless Off-Chain Signing:** Clients sign `TransferWithAuthorization`
|
|
16
|
-
- **Automated Platform Fee Split:** Configurable fee split in basis points (e.g
|
|
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
|
-
|
|
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
|
package/dist/facilitator.js
CHANGED
|
@@ -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
|
-
//
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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);
|
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/monetize.d.ts
CHANGED
|
@@ -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
|
@@ -74,8 +74,11 @@ function parseTokenUnits(priceStr) {
|
|
|
74
74
|
return BigInt(whole + paddedFraction);
|
|
75
75
|
}
|
|
76
76
|
export function monetize(options) {
|
|
77
|
-
|
|
78
|
-
|
|
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,
|
package/dist/server.js
CHANGED
|
@@ -5,6 +5,63 @@ 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
|
+
// Redirect root /mcp.json to /.well-known/mcp.json
|
|
12
|
+
app.get("/mcp.json", (c) => c.redirect("/.well-known/mcp.json"));
|
|
13
|
+
// Standard OpenClaw & Smithery plugin manifest routes
|
|
14
|
+
app.get("/openclaw.plugin.json", (c) => c.json({
|
|
15
|
+
name: "warppay402-server",
|
|
16
|
+
version: "1.0.0",
|
|
17
|
+
description: "Instant MCP Tool & x402 Monetization SDK for Cloudflare Gateway and Base",
|
|
18
|
+
main: "dist/index.js",
|
|
19
|
+
type: "mcp-server",
|
|
20
|
+
config: {
|
|
21
|
+
url: "https://api.warppay402.com/.well-known/mcp.json"
|
|
22
|
+
}
|
|
23
|
+
}));
|
|
24
|
+
app.get("/.well-known/mcp.json", (c) => c.json({
|
|
25
|
+
schema_version: "v1",
|
|
26
|
+
name_for_model: "warppay_weather",
|
|
27
|
+
name_for_human: "WarpPay Weather Tool",
|
|
28
|
+
description_for_model: "Monetized weather data API on Base Mainnet via x402 micro-payments.",
|
|
29
|
+
api: {
|
|
30
|
+
type: "openapi",
|
|
31
|
+
url: "https://api.warppay402.com/api/weather"
|
|
32
|
+
}
|
|
33
|
+
}));
|
|
34
|
+
// MCP JSON-RPC protocol endpoint for tool discovery
|
|
35
|
+
app.post("/mcp", async (c) => {
|
|
36
|
+
try {
|
|
37
|
+
const body = await c.req.json();
|
|
38
|
+
if (body.method === "tools/list" || body.method === "initialize") {
|
|
39
|
+
return c.json({
|
|
40
|
+
jsonrpc: "2.0",
|
|
41
|
+
id: body.id ?? 1,
|
|
42
|
+
result: {
|
|
43
|
+
tools: [
|
|
44
|
+
{
|
|
45
|
+
name: "get_weather",
|
|
46
|
+
description: "Fetch live city weather (Costs $0.01 USDC via x402)",
|
|
47
|
+
inputSchema: {
|
|
48
|
+
type: "object",
|
|
49
|
+
properties: {
|
|
50
|
+
city: { type: "string", description: "City name, e.g., Austin" }
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
return c.json({ jsonrpc: "2.0", id: body.id ?? 1, error: { code: -32601, message: "Method not found" } });
|
|
59
|
+
}
|
|
60
|
+
catch {
|
|
61
|
+
return c.json({ jsonrpc: "2.0", id: 1, error: { code: -32700, message: "Parse error" } });
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
// 2. MONETIZED API ROUTES (x402 Payment Guarded)
|
|
8
65
|
app.use("/api/weather", monetize({
|
|
9
66
|
price: "0.01",
|
|
10
67
|
payTo: developerWallet,
|
|
@@ -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"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "warppay402-server",
|
|
3
|
+
"name": "warppay402-server",
|
|
4
|
+
"version": "1.1.0",
|
|
5
|
+
"description": "Instant MCP Tool & x402 Monetization SDK for Cloudflare Gateway and Base",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"type": "mcp-server",
|
|
8
|
+
"config": {
|
|
9
|
+
"url": "https://api.warppay402.com/.well-known/mcp.json"
|
|
10
|
+
},
|
|
11
|
+
"configSchema": {
|
|
12
|
+
"type": "object",
|
|
13
|
+
"additionalProperties": false,
|
|
14
|
+
"properties": {}
|
|
15
|
+
}
|
|
16
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@warppay402/server",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
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,21 @@
|
|
|
13
13
|
"default": "./dist/index.js"
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
|
+
"openclaw": {
|
|
17
|
+
"type": "mcp-server",
|
|
18
|
+
"extensions": [
|
|
19
|
+
"./dist/index.js"
|
|
20
|
+
],
|
|
21
|
+
"compat": {
|
|
22
|
+
"pluginApi": ">=1.0.0"
|
|
23
|
+
},
|
|
24
|
+
"build": {
|
|
25
|
+
"openclawVersion": "1.1.0"
|
|
26
|
+
},
|
|
27
|
+
"config": {
|
|
28
|
+
"url": "https://api.warppay402.com/.well-known/mcp.json"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
16
31
|
"license": "MIT",
|
|
17
32
|
"keywords": [
|
|
18
33
|
"x402",
|
|
@@ -22,14 +37,16 @@
|
|
|
22
37
|
"usdc",
|
|
23
38
|
"hono",
|
|
24
39
|
"ai-agents",
|
|
25
|
-
"warppay402"
|
|
40
|
+
"warppay402",
|
|
41
|
+
"solana"
|
|
26
42
|
],
|
|
27
43
|
"repository": {
|
|
28
44
|
"type": "git",
|
|
29
45
|
"url": "git+https://github.com/golfgolfgolf200/warppay402-server.git"
|
|
30
46
|
},
|
|
31
47
|
"files": [
|
|
32
|
-
"dist"
|
|
48
|
+
"dist",
|
|
49
|
+
"openclaw.plugin.json"
|
|
33
50
|
],
|
|
34
51
|
"scripts": {
|
|
35
52
|
"build": "tsc --build",
|
|
@@ -39,6 +56,7 @@
|
|
|
39
56
|
},
|
|
40
57
|
"dependencies": {
|
|
41
58
|
"@hono/node-server": "^2.1.0",
|
|
59
|
+
"@solana/web3.js": "^1.98.4",
|
|
42
60
|
"@xpaysh/x402": "^0.1.2",
|
|
43
61
|
"dotenv": "^17.4.2",
|
|
44
62
|
"hono": "^4.13.0",
|
|
@@ -50,4 +68,4 @@
|
|
|
50
68
|
"typescript": "^7.0.2",
|
|
51
69
|
"vitest": "^4.1.10"
|
|
52
70
|
}
|
|
53
|
-
}
|
|
71
|
+
}
|