x402-proxy 0.8.0 → 0.8.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/CHANGELOG.md +12 -1
- package/README.md +6 -7
- package/dist/bin/cli.js +17 -7
- package/dist/openclaw/plugin.js +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.8.1] - 2026-03-24
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- Curl-style short flags: `-X` (method), `-H` (header), `-d` (body) for the `fetch` command
|
|
14
|
+
- `-H` preprocessing in CLI entry point to work around Stricli reserving `-H` for `--help-all`
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
- SSE streaming resilience: swallow Node.js "terminated" errors when server closes connection after final event, so payment logging still completes
|
|
18
|
+
- Bumped `mppx` to ^0.4.9 (fixes 204-safe SSE receipt wrapping and idempotent voucher replay)
|
|
19
|
+
|
|
10
20
|
## [0.8.0] - 2026-03-21
|
|
11
21
|
|
|
12
22
|
### Added
|
|
@@ -204,7 +214,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
204
214
|
- `appendHistory` / `readHistory` / `calcSpend` - JSONL transaction history
|
|
205
215
|
- Re-exports from `@x402/fetch`, `@x402/svm`, `@x402/evm`
|
|
206
216
|
|
|
207
|
-
[Unreleased]: https://github.com/cascade-protocol/x402-proxy/compare/v0.8.
|
|
217
|
+
[Unreleased]: https://github.com/cascade-protocol/x402-proxy/compare/v0.8.1...HEAD
|
|
218
|
+
[0.8.1]: https://github.com/cascade-protocol/x402-proxy/compare/v0.8.0...v0.8.1
|
|
208
219
|
[0.8.0]: https://github.com/cascade-protocol/x402-proxy/compare/v0.7.1...v0.8.0
|
|
209
220
|
[0.7.1]: https://github.com/cascade-protocol/x402-proxy/compare/v0.7.0...v0.7.1
|
|
210
221
|
[0.7.0]: https://github.com/cascade-protocol/x402-proxy/compare/v0.6.0...v0.7.0
|
package/README.md
CHANGED
|
@@ -40,10 +40,10 @@ Works like curl. Response body streams to stdout, payment info goes to stderr.
|
|
|
40
40
|
# GET request
|
|
41
41
|
$ npx x402-proxy https://twitter.surf.cascade.fyi/users/cascade_fyi
|
|
42
42
|
|
|
43
|
-
# POST with body and headers
|
|
44
|
-
$ npx x402-proxy
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
# POST with body and headers (curl-style short flags: -X, -H, -d)
|
|
44
|
+
$ npx x402-proxy -X POST \
|
|
45
|
+
-H "Content-Type: application/json" \
|
|
46
|
+
-d '{"url":"https://x402.org"}' \
|
|
47
47
|
https://web.surf.cascade.fyi/v1/crawl
|
|
48
48
|
|
|
49
49
|
# Force a specific network
|
|
@@ -54,9 +54,8 @@ $ npx x402-proxy --verbose https://api.example.com/data
|
|
|
54
54
|
|
|
55
55
|
# Use MPP protocol for streaming payments
|
|
56
56
|
$ npx x402-proxy --protocol mpp \
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
--body '{"model":"minimax/minimax-m2.5","stream":true,"messages":[{"role":"user","content":"Hello"}]}' \
|
|
57
|
+
-X POST -H "Content-Type: application/json" \
|
|
58
|
+
-d '{"model":"minimax/minimax-m2.5","stream":true,"messages":[{"role":"user","content":"Hello"}]}' \
|
|
60
59
|
https://inference.surf.cascade.fyi/v1/chat/completions
|
|
61
60
|
|
|
62
61
|
# Pipe-safe
|
package/dist/bin/cli.js
CHANGED
|
@@ -367,6 +367,10 @@ Examples:
|
|
|
367
367
|
default: false
|
|
368
368
|
}
|
|
369
369
|
},
|
|
370
|
+
aliases: {
|
|
371
|
+
X: "method",
|
|
372
|
+
d: "body"
|
|
373
|
+
},
|
|
370
374
|
positional: {
|
|
371
375
|
kind: "tuple",
|
|
372
376
|
parameters: [{
|
|
@@ -497,7 +501,13 @@ Examples:
|
|
|
497
501
|
verbose("opening SSE session...");
|
|
498
502
|
const tokens = await mppHandler.sse(parsedUrl.toString(), init);
|
|
499
503
|
verbose("SSE stream opened, reading tokens...");
|
|
500
|
-
|
|
504
|
+
try {
|
|
505
|
+
for await (const token of tokens) process.stdout.write(token);
|
|
506
|
+
} catch (streamErr) {
|
|
507
|
+
const msg = streamErr instanceof Error ? streamErr.message : String(streamErr);
|
|
508
|
+
verbose(`SSE stream error: ${msg}`);
|
|
509
|
+
if (!msg.includes("terminated")) throw streamErr;
|
|
510
|
+
}
|
|
501
511
|
verbose("SSE stream complete");
|
|
502
512
|
} finally {
|
|
503
513
|
await closeMppSession(mppHandler);
|
|
@@ -829,7 +839,7 @@ Add to your MCP client config (Claude, Cursor, etc.):
|
|
|
829
839
|
}
|
|
830
840
|
const remoteClient = new Client({
|
|
831
841
|
name: "x402-proxy",
|
|
832
|
-
version: "0.8.
|
|
842
|
+
version: "0.8.1"
|
|
833
843
|
});
|
|
834
844
|
const x402Mcp = new x402MCPClient(remoteClient, x402PaymentClient, {
|
|
835
845
|
autoPayment: true,
|
|
@@ -867,7 +877,7 @@ Add to your MCP client config (Claude, Cursor, etc.):
|
|
|
867
877
|
}
|
|
868
878
|
const localServer = new Server({
|
|
869
879
|
name: "x402-proxy",
|
|
870
|
-
version: "0.8.
|
|
880
|
+
version: "0.8.1"
|
|
871
881
|
}, { capabilities: {
|
|
872
882
|
tools: tools.length > 0 ? {} : void 0,
|
|
873
883
|
resources: remoteResources.length > 0 ? {} : void 0
|
|
@@ -962,7 +972,7 @@ Add to your MCP client config (Claude, Cursor, etc.):
|
|
|
962
972
|
}));
|
|
963
973
|
const remoteClient = new Client({
|
|
964
974
|
name: "x402-proxy",
|
|
965
|
-
version: "0.8.
|
|
975
|
+
version: "0.8.1"
|
|
966
976
|
});
|
|
967
977
|
await connectTransport(remoteClient);
|
|
968
978
|
const mppClient = McpClient.wrap(remoteClient, { methods: wrappedMethods });
|
|
@@ -977,7 +987,7 @@ Add to your MCP client config (Claude, Cursor, etc.):
|
|
|
977
987
|
}
|
|
978
988
|
const localServer = new Server({
|
|
979
989
|
name: "x402-proxy",
|
|
980
|
-
version: "0.8.
|
|
990
|
+
version: "0.8.1"
|
|
981
991
|
}, { capabilities: {
|
|
982
992
|
tools: tools.length > 0 ? {} : void 0,
|
|
983
993
|
resources: remoteResources.length > 0 ? {} : void 0
|
|
@@ -1189,7 +1199,7 @@ const routes = buildRouteMap({
|
|
|
1189
1199
|
});
|
|
1190
1200
|
const app = buildApplication(routes, {
|
|
1191
1201
|
name: "x402-proxy",
|
|
1192
|
-
versionInfo: { currentVersion: "0.8.
|
|
1202
|
+
versionInfo: { currentVersion: "0.8.1" },
|
|
1193
1203
|
scanner: { caseStyle: "allow-kebab-for-camel" }
|
|
1194
1204
|
});
|
|
1195
1205
|
|
|
@@ -1201,7 +1211,7 @@ function buildContext(process) {
|
|
|
1201
1211
|
|
|
1202
1212
|
//#endregion
|
|
1203
1213
|
//#region src/bin/cli.ts
|
|
1204
|
-
await run(app, process.argv.slice(2), buildContext(process));
|
|
1214
|
+
await run(app, process.argv.slice(2).map((a) => a === "-H" ? "--header" : a), buildContext(process));
|
|
1205
1215
|
|
|
1206
1216
|
//#endregion
|
|
1207
1217
|
export { };
|
package/dist/openclaw/plugin.js
CHANGED
|
@@ -726,7 +726,7 @@ function createWalletCommand(ctx) {
|
|
|
726
726
|
try {
|
|
727
727
|
const snap = await getWalletSnapshot(ctx.rpcUrl, walletAddress, ctx.historyPath);
|
|
728
728
|
const solscanUrl = `https://solscan.io/account/${walletAddress}`;
|
|
729
|
-
const lines = [`x402-proxy v0.8.
|
|
729
|
+
const lines = [`x402-proxy v0.8.1`];
|
|
730
730
|
const defaultModel = ctx.allModels[0];
|
|
731
731
|
if (defaultModel) lines.push("", `**Model** - ${defaultModel.name} (${defaultModel.provider})`);
|
|
732
732
|
lines.push("", `**[Wallet](${solscanUrl})**`, `\`${walletAddress}\``);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "x402-proxy",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "curl for x402 paid APIs. Auto-pays any endpoint on Base, Solana, and Tempo. Also works as an OpenClaw plugin.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@x402/evm": "^2.6.0",
|
|
40
40
|
"@x402/fetch": "^2.6.0",
|
|
41
41
|
"@x402/mcp": "^2.6.0",
|
|
42
|
-
"mppx": "^0.4.
|
|
42
|
+
"mppx": "^0.4.9",
|
|
43
43
|
"@x402/svm": "^2.6.0",
|
|
44
44
|
"ethers": "^6.0.0",
|
|
45
45
|
"picocolors": "^1.1.1",
|