x402-proxy 0.5.1 → 0.6.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/CHANGELOG.md +28 -1
- package/README.md +11 -2
- package/dist/bin/cli.js +472 -167
- package/dist/{derive-CISr_ond.js → derive-ibF2UinV.js} +2 -2
- package/dist/index.d.ts +43 -8
- package/dist/index.js +104 -13
- package/dist/{setup-gla-Qyqi.js → setup-hJGkO2Lo.js} +1 -1
- package/dist/setup-j_xQ14-4.js +4 -0
- package/dist/{status-BoH_1kIH.js → status-JNGv2Ghp.js} +12 -6
- package/dist/{status-BVIU3-b6.js → status-w5y-fhhe.js} +1 -1
- package/dist/wallet-DjixXCHy.js +4 -0
- package/dist/{wallet-BMYYtAP6.js → wallet-DxKCHa7U.js} +45 -11
- package/package.json +7 -6
- package/skills/SKILL.md +9 -6
- package/dist/setup-Crq9TylJ.js +0 -4
- package/dist/wallet-BoY0fgX7.js +0 -4
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,31 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.6.0] - 2026-03-19
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- MPP (Machine Payments Protocol) support via `mppx` SDK - pay-per-token streaming and charge-per-request on the Tempo network
|
|
14
|
+
- `--protocol` flag for `fetch` and `mcp` commands - choose between `x402` and `mpp` payment protocols
|
|
15
|
+
- MPP streaming: `--protocol mpp` with `"stream": true` in body uses session-based SSE with mid-stream voucher cycling
|
|
16
|
+
- MPP MCP proxy: `--protocol mpp` on `mcp` command wraps tool calls with MPP payments via `mppx/mcp-sdk`
|
|
17
|
+
- Auto-detect fallback: if x402 returns 402 and server advertises MPP via `WWW-Authenticate: Payment`, falls through to MPP automatically
|
|
18
|
+
- Tempo USDC balance shown in `wallet` and `status` commands
|
|
19
|
+
- `preferredProtocol` and `mppSessionBudget` config options
|
|
20
|
+
- `detectProtocols()`, `createMppProxyHandler()`, `TEMPO_NETWORK` exported from library
|
|
21
|
+
- `MppPaymentInfo`, `MppProxyHandler`, `DetectedProtocols` types exported
|
|
22
|
+
|
|
23
|
+
### Changed
|
|
24
|
+
- `PaymentInfo` type now includes `protocol: "x402"` discriminator
|
|
25
|
+
- `extractTxSignature()` now also extracts references from MPP `Payment-Receipt` headers
|
|
26
|
+
- 402 error display shows Tempo balances and MPP-accepting endpoints
|
|
27
|
+
- `appendHistory` creates parent directory automatically (removed `ensureConfigDir` calls)
|
|
28
|
+
- Balance fetching consolidated into `fetchAllBalances()` helper
|
|
29
|
+
|
|
30
|
+
## [0.5.2] - 2026-03-19
|
|
31
|
+
|
|
32
|
+
### Fixed
|
|
33
|
+
- Package exports missing top-level `types` condition - TypeScript with `moduleResolution: "bundler"` could not resolve type declarations
|
|
34
|
+
|
|
10
35
|
## [0.5.1] - 2026-03-19
|
|
11
36
|
|
|
12
37
|
### Fixed
|
|
@@ -147,7 +172,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
147
172
|
- `appendHistory` / `readHistory` / `calcSpend` - JSONL transaction history
|
|
148
173
|
- Re-exports from `@x402/fetch`, `@x402/svm`, `@x402/evm`
|
|
149
174
|
|
|
150
|
-
[Unreleased]: https://github.com/cascade-protocol/x402-proxy/compare/v0.
|
|
175
|
+
[Unreleased]: https://github.com/cascade-protocol/x402-proxy/compare/v0.6.0...HEAD
|
|
176
|
+
[0.6.0]: https://github.com/cascade-protocol/x402-proxy/compare/v0.5.2...v0.6.0
|
|
177
|
+
[0.5.2]: https://github.com/cascade-protocol/x402-proxy/compare/v0.5.1...v0.5.2
|
|
151
178
|
[0.5.1]: https://github.com/cascade-protocol/x402-proxy/compare/v0.5.0...v0.5.1
|
|
152
179
|
[0.5.0]: https://github.com/cascade-protocol/x402-proxy/compare/v0.4.2...v0.5.0
|
|
153
180
|
[0.4.2]: https://github.com/cascade-protocol/x402-proxy/compare/v0.4.1...v0.4.2
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# x402-proxy
|
|
2
2
|
|
|
3
|
-
`curl` for [x402](https://www.x402.org/) paid APIs. Auto-pays HTTP 402 responses with USDC on Base and
|
|
3
|
+
`curl` for [x402](https://www.x402.org/) paid APIs. Auto-pays HTTP 402 responses with USDC on Base, Solana, and Tempo - zero crypto code on the buyer side. Supports both [x402](https://www.x402.org/) and [MPP](https://mpp.dev/) payment protocols.
|
|
4
4
|
|
|
5
5
|
## Quick Start
|
|
6
6
|
|
|
@@ -10,7 +10,7 @@ npx x402-proxy https://twitter.surf.cascade.fyi/users/cascade_fyi
|
|
|
10
10
|
|
|
11
11
|
That's it. The endpoint returns 402, x402-proxy pays and streams the response.
|
|
12
12
|
|
|
13
|
-
No wallet? It'll walk you through setup automatically. One mnemonic derives both EVM (Base) and Solana keypairs. Fund
|
|
13
|
+
No wallet? It'll walk you through setup automatically. One mnemonic derives both EVM (Base/Tempo) and Solana keypairs. Fund any chain and go.
|
|
14
14
|
|
|
15
15
|
## MCP Proxy
|
|
16
16
|
|
|
@@ -49,6 +49,13 @@ $ npx x402-proxy --method POST \
|
|
|
49
49
|
# Force a specific network
|
|
50
50
|
$ npx x402-proxy --network base https://api.example.com/data
|
|
51
51
|
|
|
52
|
+
# Use MPP protocol for streaming payments
|
|
53
|
+
$ npx x402-proxy --protocol mpp \
|
|
54
|
+
--method POST \
|
|
55
|
+
--header "Content-Type: application/json" \
|
|
56
|
+
--body '{"model":"minimax/minimax-m2.5","stream":true,"messages":[{"role":"user","content":"Hello"}]}' \
|
|
57
|
+
https://inference.surf.cascade.fyi/v1/chat/completions
|
|
58
|
+
|
|
52
59
|
# Pipe-safe
|
|
53
60
|
$ npx x402-proxy https://api.example.com/data | jq '.results'
|
|
54
61
|
```
|
|
@@ -100,7 +107,9 @@ Resolution order: flags > env vars > mnemonic env > `wallet.json` file.
|
|
|
100
107
|
```ts
|
|
101
108
|
import {
|
|
102
109
|
createX402ProxyHandler,
|
|
110
|
+
createMppProxyHandler,
|
|
103
111
|
extractTxSignature,
|
|
112
|
+
detectProtocols,
|
|
104
113
|
appendHistory,
|
|
105
114
|
readHistory,
|
|
106
115
|
calcSpend,
|