x402-proxy-openclaw 0.10.9

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 ADDED
@@ -0,0 +1,453 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [0.10.9] - 2026-04-02
11
+
12
+ ### Fixed
13
+ - CI workflow now uses Node 24, matching the publish workflow
14
+
15
+ ## [0.10.8] - 2026-04-02
16
+
17
+ ### Added
18
+ - Separate published OpenClaw plugin package: `x402-proxy-openclaw`
19
+ - Release staging and verification flow that produces `x402-proxy` and `x402-proxy-openclaw` together from the same source package directory
20
+ - MCP payment retry tests covering structured x402 errors and paid tool result metadata preservation
21
+
22
+ ### Changed
23
+ - Build output now stages separate CLI and OpenClaw artifacts before publish, while keeping one shared version and release tag
24
+ - OpenClaw install documentation now points to `openclaw plugins install x402-proxy-openclaw`
25
+
26
+ ### Fixed
27
+ - MCP proxy now preserves structured tool metadata such as `outputSchema`, resource metadata, `structuredContent`, and `_meta` when auto-paying x402 tool calls
28
+ - Paid MCP retries now resend tool calls with the `x402/payment` payload while keeping the original result shape intact
29
+
30
+ ## [0.10.7] - 2026-04-01
31
+
32
+ ### Added
33
+ - `claude` and `claude --model` shown in default `npx x402-proxy` commands output
34
+ - `claude --help` lists available models and usage examples
35
+
36
+ ## [0.10.6] - 2026-04-01
37
+
38
+ ### Fixed
39
+ - Client disconnect now cancels upstream requests via abort signal propagation (prevents resource leaks on dropped connections)
40
+ - Anthropic SSE streaming stops reading after `message_stop` event instead of waiting for connection close
41
+ - Non-LLM endpoint requests (tool discovery, resource listing) no longer write empty records to inference history
42
+ - Empty inference history records (no amount, model, tokens, or tx) filtered out when reading history
43
+ - `formatUsdcValue()` uses `Intl.NumberFormat` for full precision up to 12 decimals instead of truncating to fixed tiers
44
+ - Stream responses guarded against double `res.end()` calls
45
+
46
+ ### Changed
47
+ - Default model for `claude` command changed from `minimax/minimax-m2.7` to `stepfun/step-3.5-flash`
48
+
49
+ ## [0.10.5] - 2026-04-01
50
+
51
+ ### Fixed
52
+ - `--debug` flag now works with inference proxy - route.ts debug check was captured at import time (before `cli.ts` sets the env var), so `dbg()` never fired; now evaluates lazily per call
53
+ - `--debug` on `claude` command now shows proxy logs (sets `quiet: false`)
54
+ - MPP `X-Payer-Address` header injection preserves headers as plain objects instead of converting to `Headers` instance, avoiding mppx headers-spreading bug that silently drops `Content-Type` on SSE requests
55
+
56
+ ## [0.10.4] - 2026-04-01
57
+
58
+ ### Fixed
59
+ - MPP sessions now reuse a single handler across requests instead of creating a new one per request - eliminates redundant escrow deposits and wasted USDC
60
+ - MPP sessions properly settle on process shutdown (`serve` command and OpenClaw plugin both call `close()` on SIGTERM/stop)
61
+ - MPP channelId persisted to `~/.config/x402-proxy/session.json` for tracking; cleared on session close
62
+
63
+ ### Added
64
+ - `--debug` global CLI flag - sets `X402_PROXY_DEBUG=1` for verbose stderr logging of MPP SSE lifecycle, channelId, and proxy routing
65
+ - Debug trace points in inference proxy: upstream routing, SSE start/end, usage stats, errors
66
+
67
+ ### Changed
68
+ - Upgraded `mppx` from ^0.4.9 to ^0.5.1
69
+ - MPP requests now send `X-Payer-Address` header so the server can include the payer's existing `channelId` in 402 challenges, enabling cross-restart session recovery
70
+ - Inference proxy no longer accepts `getEvmKey` option - receives pre-built `getMppHandler` instead
71
+
72
+ ## [0.10.3] - 2026-04-01
73
+
74
+ ### Fixed
75
+ - Anthropic Messages API (`/v1/messages`) SSE streaming - proxy now emits proper `event: {type}` framing and omits the `data: [DONE]` sentinel that breaks the Anthropic SDK parser
76
+ - Anthropic error responses use correct format (`{type:"error",error:{type,message}}`) instead of OpenAI format for `/v1/messages` endpoints
77
+ - MPP streaming usage tracking - token counts were always 0/0 because raw JSON payloads lacked the `data:` prefix the tracker expected
78
+ - Anthropic usage accumulation from `message_start` (input tokens) and `message_delta` (output tokens) events instead of relying on a single final chunk
79
+ - Anthropic thinking mode (`thinking.budget_tokens`) now extracted from request body for history tracking
80
+ - MPP error messages and payment history now show the EVM wallet address instead of the Solana address
81
+
82
+ ## [0.10.2] - 2026-04-01
83
+
84
+ ### Fixed
85
+ - `claude` command proxy logs ("proxy: intercepting ...") no longer corrupt Claude Code's statusline - server now runs in quiet mode
86
+ - `claude` command defaults to MPP protocol (correct for inference proxying) instead of requiring `--protocol mpp`
87
+
88
+ ## [0.10.1] - 2026-04-01
89
+
90
+ ### Changed
91
+ - Dropped `@solana-program/compute-budget` and `@solana-program/token-2022` dependencies - compute budget instructions now use `@solana/kit` built-ins, non-USDC asset path removed (only USDC is supported)
92
+ - Kept `@solana-program/token` (clean peer deps) for `findAssociatedTokenPda` and `getTransferCheckedInstruction`
93
+ - Eliminates `@solana/sysvars` peer dependency warning on `npm install`
94
+
95
+ ## [0.10.0] - 2026-04-01
96
+
97
+ ### Added
98
+ - `serve` command - local HTTP proxy server for paid inference endpoints, auto-detects wallet and preferred network
99
+ - `claude` command - run Claude Code through a paid local proxy with `ANTHROPIC_BASE_URL` auto-configured
100
+ - `--model` flag on `claude` command (default: `minimax/minimax-m2.7`) - sets `ANTHROPIC_CUSTOM_MODEL_OPTION` for non-Anthropic models
101
+ - MPP payment support in OpenClaw plugin - inference proxy and `x_request` tool now handle both x402 (Solana) and MPP (Tempo/Base) protocols
102
+ - `/x_send` slash command with confirmation flow (5-min TTL) for USDC transfers from the OpenClaw gateway
103
+ - Default Surf provider config - plugin works out of the box without explicit provider configuration
104
+ - `defaults.ts` module with provider config types, resolution logic, and built-in model catalog
105
+ - Dual-wallet support in OpenClaw plugin - EVM and Solana addresses resolved independently
106
+ - `addressForNetwork` and `parseMppAmount` exported as shared helpers from `tools.ts`
107
+
108
+ ### Changed
109
+ - OpenClaw plugin migrated to `definePluginEntry` SDK (from hand-rolled types)
110
+ - `x_balance` tool renamed to `x_wallet` (alias: `x_balance`)
111
+ - `x_payment` tool renamed to `x_request` (alias: `x_payment`) with x402/MPP protocol branching
112
+ - `/x_wallet` command: `send` subcommand now redirects to `/x_send`
113
+ - Inference proxy route handler renamed from `createX402RouteHandler` to `createInferenceProxyRouteHandler`
114
+ - SSE token tracking deduplicated into `createSseTracker()` helper shared by x402 and MPP paths
115
+ - Replaced hardcoded `"eip155:4217"` with imported `TEMPO_NETWORK` constant
116
+ - `serve` and `claude` commands handle their own SIGINT/SIGTERM (CLI entry point skips default handler for them)
117
+ - Wallet loading in plugin uses proper promise dedup (`walletLoadPromise`) instead of boolean flag
118
+ - Providers sorted once in route handler closure instead of per-request
119
+
120
+ ### Fixed
121
+ - `preferredNetwork === "undefined"` string comparison in serve command replaced with proper `preferredNetwork || undefined` check
122
+
123
+ ## [0.9.4] - 2026-03-27
124
+
125
+ ### Fixed
126
+ - All example URLs migrated from legacy individual service subdomains (`twitter.surf.cascade.fyi`, `web.surf.cascade.fyi`, `inference.surf.cascade.fyi`) to unified `surf.cascade.fyi/api/v1/` endpoints across CLI help text, README, SKILL.md, and OpenClaw plugin docs
127
+
128
+ ## [0.9.3] - 2026-03-26
129
+
130
+ ### Fixed
131
+ - Solana RPC 429 rate-limit failures on concurrent payments - replaced upstream `ExactSvmScheme` (creates new RPC client per call) with `OptimizedSvmScheme` that shares a single RPC client with `@solana/kit` request coalescing (identical calls in the same microtask merge into one network request)
132
+ - Hardcoded USDC mint metadata (Token Program address, 6 decimals) to skip `fetchMint` RPC call entirely for USDC payments
133
+ - Added RPC failover transport: on 429 from one endpoint, immediately tries the next instead of failing. Two public mainnet RPCs: `api.mainnet.solana.com` (Solana Labs, 100 req/10s) and `public.rpc.solanavibestation.com` (community, 5 RPS)
134
+ - Custom RPC URL (via config or OpenClaw plugin) is tried first, with public RPCs as fallback
135
+
136
+ ### Changed
137
+ - Added `@solana-program/compute-budget`, `@solana-program/token`, `@solana-program/token-2022`, `@x402/core` as direct dependencies (previously transitive via `@x402/svm`)
138
+
139
+ ## [0.9.2] - 2026-03-26
140
+
141
+ ### Changed
142
+ - Upgraded all dependencies to latest: `@x402/*` 2.6.0 -> 2.8.0, `@solana/kit` 6.3.0 -> 6.5.0, `viem` 2.47.6, `@modelcontextprotocol/sdk` 1.28.0, `vitest` 4.1.1, `tsdown` 0.21.5, `@biomejs/biome` 2.4.9, `turbo` 2.8.20, `openclaw` 2026.3.24
143
+ - `pnpm check` now runs tests alongside build, type-check, and biome
144
+ - Biome config scoped to supported file types only (`*.ts`, `*.json`, `*.jsonc`)
145
+
146
+ ## [0.9.1] - 2026-03-26
147
+
148
+ ### Added
149
+ - `setup --non-interactive` flag - auto-generates wallet and outputs addresses as JSON to stdout (`{"base":"0x...","tempo":"0x...","solana":"..."}`)
150
+ - `setup --import-mnemonic` flag - import existing BIP-39 mnemonic non-interactively
151
+ - MCP proxy auto-generates wallet on first run when no wallet exists (no more "No wallet configured" error)
152
+ - OpenClaw integration example in README and SKILL.md: `openclaw mcp set surf '{"command":"npx","args":["-y","x402-proxy","mcp","https://surf.cascade.fyi/mcp"]}'`
153
+
154
+ ### Fixed
155
+ - `npx -y` flag added to all generated MCP configs (`mcp add` command and docs) - prevents npx install prompt from corrupting MCP stdio protocol
156
+ - MCP config examples no longer show `X402_PROXY_WALLET_MNEMONIC` env var as default - wallet file is the primary path, env vars are documented as fallback only
157
+ - All example MCP URLs updated to `https://surf.cascade.fyi/mcp`
158
+ - Non-interactive JSON output uses network names (`base`, `tempo`, `solana`) instead of generic `evm`
159
+
160
+ ## [0.9.0] - 2026-03-25
161
+
162
+ ### Added
163
+ - `mcp add` command - onboarding wizard to install MCP servers into Claude Code, Cursor, VS Code, and 16+ other AI clients via `@getmcp/generators`
164
+ - Auto-detects installed AI clients and highlights them in the selection list
165
+ - Shows config diff preview with green markers before writing
166
+ - Prompts to overwrite if server name already exists (shows current config)
167
+ - Wallet setup runs automatically if not yet configured
168
+ - Balance check and funding hints shown after successful install
169
+ - `-c` / `--config-dir` global flag to override config directory for all commands
170
+ - Custom config directory injected as `XDG_CONFIG_HOME` env var into generated MCP server configs
171
+ - Tempo address shown alongside Base address in setup wizard
172
+
173
+ ### Fixed
174
+ - Solana USDC balance shows `0` instead of `?` for fresh wallets (non-existent ATA means zero balance, not unknown)
175
+ - MPP payment protocol description corrected from "streaming micropayments" to "machine payments over HTTP 402"
176
+
177
+ ## [0.8.6] - 2026-03-25
178
+
179
+ ### Fixed
180
+ - Example URLs in help output and setup wizard: `/user/` corrected to `/users/` (was returning 404)
181
+
182
+ ## [0.8.5] - 2026-03-24
183
+
184
+ ### Fixed
185
+ - OpenClaw plugin: models now appear in `openclaw models` list - replaced invalid `models` field on `registerProvider()` with a `catalog` hook returning `ProviderCatalogResult`, which is required by OpenClaw's provider discovery filter
186
+
187
+ ## [0.8.4] - 2026-03-24
188
+
189
+ ### Fixed
190
+ - Servers returning Solana payment options with EVM-format `payTo` addresses (e.g. `0x...`) no longer crash with a base58 decode error - malformed options are filtered out and valid options are used instead
191
+ - When all payment options from a server have mismatched address formats, a clear error is shown instead of a cryptic codec failure
192
+
193
+ ## [0.8.3] - 2026-03-24
194
+
195
+ ### Added
196
+ - JSON response pretty-printing: non-streaming `application/json` responses auto-formatted with 2-space indent on TTY
197
+ - `--json` flag now works: forces JSON pretty-printing even when piped (non-TTY)
198
+ - Color-coded HTTP status lines: green for 2xx, yellow for 3xx, red for 4xx/5xx
199
+
200
+ ### Fixed
201
+ - MPP streaming payment label unified from `MPP session:` to `Payment: ... MPP` to match non-streaming format
202
+ - MPP streaming status line now starts on a new line instead of appending to last JSON chunk
203
+
204
+ ## [0.8.2] - 2026-03-24
205
+
206
+ ### Fixed
207
+ - JSON request bodies sent without explicit `Content-Type` header now auto-detect as `application/json` instead of defaulting to `text/plain` - fixes servers rejecting JSON bodies on payment retry
208
+
209
+ ## [0.8.1] - 2026-03-24
210
+
211
+ ### Added
212
+ - Curl-style short flags: `-X` (method), `-H` (header), `-d` (body) for the `fetch` command
213
+ - `-H` preprocessing in CLI entry point to work around Stricli reserving `-H` for `--help-all`
214
+
215
+ ### Fixed
216
+ - SSE streaming resilience: swallow Node.js "terminated" errors when server closes connection after final event, so payment logging still completes
217
+ - Bumped `mppx` to ^0.4.9 (fixes 204-safe SSE receipt wrapping and idempotent voucher replay)
218
+
219
+ ## [0.8.0] - 2026-03-21
220
+
221
+ ### Added
222
+ - `config` command with `show`, `set`, and `unset` subcommands for managing configuration from the CLI (no more manual YAML editing)
223
+ - Setup wizard now asks about preferred payment protocol (x402/MPP) and network
224
+ - MCP proxy handles `McpError(-32042)` from dual-protocol servers that throw instead of using `isError`, automatically retrying with x402 payment
225
+ - MPP payment amounts captured from challenges and displayed in payment logs, MCP proxy output, and transaction history
226
+ - `formatAmount()` and `formatUsdcValue()` exported from library for adaptive USDC precision formatting
227
+
228
+ ### Changed
229
+ - USDC amounts displayed with adaptive precision (2-6 decimals based on magnitude) instead of fixed 4 decimals everywhere
230
+ - Zero-balance detection uses numeric comparison instead of string matching
231
+
232
+ ## [0.7.1] - 2026-03-20
233
+
234
+ ### Fixed
235
+ - Non-402 server errors (500, 503, etc.) now indicate whether payment was attempted, helping users distinguish "server down" from "payment failed"
236
+
237
+ ## [0.7.0] - 2026-03-20
238
+
239
+ ### Added
240
+ - `--verbose` flag on `fetch` command - debug logging for protocol negotiation, headers, session lifecycle, and payment flow
241
+ - OpenClaw plugin integration (`x402-proxy/openclaw`) - registers `x_balance` tool, `x_payment` tool, `/x_wallet` command, and HTTP route proxy for upstream x402 endpoints
242
+ - `openclaw.plugin.json` manifest with config schema for providers, keypair path, RPC URL, and dashboard URL
243
+ - `./openclaw` subpath export in package.json
244
+
245
+ ### Fixed
246
+ - MPP SSE requests silently losing `Content-Type` and other headers when `Headers` instances are spread (workaround for mppx SDK bug, upstream fix: wevm/mppx#209)
247
+ - MPP session `close()` errors no longer crash the CLI - wrapped in try/catch with verbose error reporting
248
+ - MPP payment history now includes `amount` (converted from base units) and `channelId` in transaction records
249
+ - MPP streaming history records now use `channelId` as fallback for `tx` field when no receipt reference is available
250
+
251
+ ## [0.6.0] - 2026-03-19
252
+
253
+ ### Added
254
+ - MPP (Machine Payments Protocol) support via `mppx` SDK - pay-per-token streaming and charge-per-request on the Tempo network
255
+ - `--protocol` flag for `fetch` and `mcp` commands - choose between `x402` and `mpp` payment protocols
256
+ - MPP streaming: `--protocol mpp` with `"stream": true` in body uses session-based SSE with mid-stream voucher cycling
257
+ - MPP MCP proxy: `--protocol mpp` on `mcp` command wraps tool calls with MPP payments via `mppx/mcp-sdk`
258
+ - Auto-detect fallback: if x402 returns 402 and server advertises MPP via `WWW-Authenticate: Payment`, falls through to MPP automatically
259
+ - Tempo USDC balance shown in `wallet` and `status` commands
260
+ - `preferredProtocol` and `mppSessionBudget` config options
261
+ - `detectProtocols()`, `createMppProxyHandler()`, `TEMPO_NETWORK` exported from library
262
+ - `MppPaymentInfo`, `MppProxyHandler`, `DetectedProtocols` types exported
263
+
264
+ ### Changed
265
+ - `PaymentInfo` type now includes `protocol: "x402"` discriminator
266
+ - `extractTxSignature()` now also extracts references from MPP `Payment-Receipt` headers
267
+ - 402 error display shows Tempo balances and MPP-accepting endpoints
268
+ - `appendHistory` creates parent directory automatically (removed `ensureConfigDir` calls)
269
+ - Balance fetching consolidated into `fetchAllBalances()` helper
270
+
271
+ ## [0.5.2] - 2026-03-19
272
+
273
+ ### Fixed
274
+ - Package exports missing top-level `types` condition - TypeScript with `moduleResolution: "bundler"` could not resolve type declarations
275
+
276
+ ## [0.5.1] - 2026-03-19
277
+
278
+ ### Fixed
279
+ - Solana USDC balance showing 0.0000 instead of actual balance due to `getTokenAccountsByOwner` being rate-limited (429) on public Solana RPC
280
+ - Replaced with offline ATA derivation via `@solana/kit` + lightweight `getTokenAccountBalance` call that works reliably on any public RPC
281
+ - RPC errors now show `?` instead of silently displaying `0.0000`
282
+
283
+ ## [0.5.0] - 2026-03-16
284
+
285
+ ### Changed
286
+ - MCP proxy graduated from alpha to stable - removed alpha warning and label
287
+ - MCP proxy uses low-level `Server` class instead of `McpServer` to proxy raw JSON schemas verbatim without Zod conversion
288
+ - MCP proxy now forwards blob resource contents (previously only text was proxied)
289
+ - MCP content type widened to pass through all MCP content types (image, audio, resource_link) not just text
290
+
291
+ ### Added
292
+ - MCP proxy forwards `notifications/tools/list_changed` and `notifications/resources/list_changed` from remote servers so local clients stay in sync with dynamic tool/resource updates
293
+
294
+ ## [0.4.2] - 2026-03-16
295
+
296
+ ### Fixed
297
+ - Twitter endpoint URLs updated from `/user/` to `/users/` to match spec change
298
+
299
+ ### Added
300
+ - CHANGELOG.md included in npm package metadata
301
+ - `skills/` directory with SKILL.md and library reference included in npm package
302
+
303
+ ## [0.4.1] - 2026-03-13
304
+
305
+ ### Changed
306
+ - Extracted `createNetworkFilter`, `createNetworkPreference`, `networkToCaipPrefix` as exported functions for testability
307
+ - Publish workflow auto-creates GitHub releases from CHANGELOG.md (no more manual `gh release create`)
308
+ - Release docs updated in CLAUDE.md with `act` dry-run instructions for CI workflows
309
+
310
+ ### Added
311
+ - Tests for network filter, network preference selector, Solana address derivation, and wallet resolution (14 new tests)
312
+
313
+ ## [0.4.0] - 2026-03-13
314
+
315
+ ### Added
316
+ - `--network` flag for `fetch` and `mcp` commands - hard filter that requires a specific network (base, solana, or CAIP-2 ID), fails with clear error if unavailable
317
+ - Human-readable network names in payment output ("Base", "Solana" instead of "eip155:8453")
318
+ - `displayNetwork()` exported from library for mapping CAIP-2 IDs to display names
319
+
320
+ ### Fixed
321
+ - Wildcard scheme registration (`eip155:*`, `solana:*`) via SDK helpers - payment signing now works for any EVM chain a server requests, not just Base
322
+ - Solana address derivation for `--solana-key` flag and `X402_PROXY_WALLET_SOLANA_KEY` env var - balance detection, wallet display, and history recording were broken without it
323
+ - MCP command now auto-detects preferred network based on USDC balance (same fix previously applied to `fetch`)
324
+ - MCP payment history records now include `amount`, `to`, and correct `network` (removed fragile type cast)
325
+ - Removed debug prefix stripping from payment amounts in handler
326
+ - USDC balance display now shows 4 decimal places (was 2)
327
+
328
+ ## [0.3.2] - 2026-03-13
329
+
330
+ ### Added
331
+ - Auto-setup: running `npx x402-proxy <url>` without a wallet launches the setup wizard, then continues with the request
332
+ - 402 error handling parses the endpoint's `PAYMENT-REQUIRED` header to show actual accepted networks and costs
333
+ - CI pipeline (GitHub Actions: check, build, test on push/PR)
334
+ - Automated npm publishing with OIDC provenance on tag push
335
+ - Tests for wallet derivation and transaction history (25 tests)
336
+ - Funding hint in `wallet` when USDC balance is zero
337
+
338
+ ### Changed
339
+ - Version injected at build time from package.json (no more stale hardcoded strings)
340
+ - `wallet fund` command removed (addresses and hint shown in `wallet` directly)
341
+ - All command references use `$ npx x402-proxy` format
342
+
343
+ ## [0.3.1] - 2026-03-12
344
+
345
+ ### Added
346
+ - `wallet export-key mnemonic` - export BIP-39 mnemonic to stdout (pipe-safe, with confirmation prompt)
347
+
348
+ ## [0.3.0] - 2026-03-12
349
+
350
+ ### Added
351
+ - Live wallet balances in `status` and `wallet` commands (USDC + ETH/SOL via RPC)
352
+ - Recent transactions shown in `status` (last 5) and `wallet` (last 10)
353
+ - Network preference (`defaultNetwork` config) - prefers configured chain when endpoint accepts multiple
354
+ - Spend limits (`spendLimitDaily`, `spendLimitPerTx` config) enforced via x402Client policy
355
+ - `--verbose` flag on `wallet` command to show transaction IDs
356
+ - Confirmation prompt on `wallet export-key` when stdout is a terminal
357
+ - Help text with usage examples for `fetch --help` and `mcp --help`
358
+ - Full command reference, "try:" suggestion, and repo link in no-args output
359
+ - Network indicator on transaction lines (base/sol)
360
+ - Setup outro with "try your first request" using real endpoint
361
+
362
+ ### Changed
363
+ - "EVM" label replaced with "Base" throughout (wallet, status, setup)
364
+ - Config directory displayed as `~/.config/...` instead of absolute path
365
+ - Error messages prefixed with `✗`, success with `✓` for accessibility
366
+ - No-args output redesigned: identity header, wallet summary, commands, try suggestion
367
+ - Example URLs use path-based format (`/user/cascade_fyi`) to avoid zsh glob issues
368
+ - `@solana/kit`, `ethers`, `viem` moved from peerDependencies to dependencies (fixes npx ERESOLVE warnings)
369
+ - Wallet subcommand hints shown at bottom of `wallet` output
370
+
371
+ ### Fixed
372
+ - RPC balance failures show "(network error)" instead of silent omission
373
+
374
+ ## [0.2.1] - 2026-03-12
375
+
376
+ ### Changed
377
+ - Package description and keywords aligned with "curl for x402 paid APIs" positioning
378
+ - README rewritten: real endpoint in Quick Start, MCP Proxy elevated above HTTP Requests
379
+ - Stricli commands use explicit generic types (fixes TS 5.9 type inference)
380
+ - `displayStatus()` extracted as callable function from status command
381
+ - `PaymentRequirements.amount` used instead of removed `maxAmountRequired`
382
+
383
+ ### Fixed
384
+ - All `tsc --noEmit` type errors resolved (previously passing only at build time)
385
+ - Biome schema version bumped to match CLI 2.4.6
386
+
387
+ ## [0.2.0] - 2026-03-12
388
+
389
+ ### Added
390
+ - CLI binary accessible via `npx x402-proxy`
391
+ - `fetch` command (default) - curl-like HTTP client with automatic x402 payment
392
+ - `mcp` command - MCP stdio proxy with auto-payment for AI agents
393
+ - `setup` command - interactive onboarding wizard with @clack/prompts
394
+ - `status` command - config, wallet, and spend summary
395
+ - `wallet` subcommand with `info`, `history`, `fund`, `export-key`
396
+ - BIP-39 mnemonic wallet derivation (Solana SLIP-10 + EVM BIP-32 from single seed)
397
+ - XDG-compliant config storage (`~/.config/x402-proxy/`)
398
+ - Wallet resolution cascade: flags > env vars > mnemonic env > wallet.json
399
+ - JSONL payment history with auto-truncation
400
+ - Env var overrides with `X402_PROXY_WALLET_*` prefix
401
+
402
+ ### Changed
403
+ - Package now ships both CLI binary and library
404
+ - Dual tsdown build entries (bin/cli with shebang + index with dts)
405
+
406
+ ## [0.1.0] - 2026-03-10
407
+
408
+ ### Added
409
+ - Initial release (library only)
410
+ - `createX402ProxyHandler` - wraps fetch with automatic x402 payment
411
+ - `extractTxSignature` - extracts TX signature from payment response headers
412
+ - `loadSvmWallet` / `loadEvmWallet` - wallet loading utilities
413
+ - `appendHistory` / `readHistory` / `calcSpend` - JSONL transaction history
414
+ - Re-exports from `@x402/fetch`, `@x402/svm`, `@x402/evm`
415
+
416
+ [Unreleased]: https://github.com/cascade-protocol/x402-proxy/compare/v0.10.9...HEAD
417
+ [0.10.9]: https://github.com/cascade-protocol/x402-proxy/compare/v0.10.8...v0.10.9
418
+ [0.10.8]: https://github.com/cascade-protocol/x402-proxy/compare/v0.10.7...v0.10.8
419
+ [0.10.7]: https://github.com/cascade-protocol/x402-proxy/compare/v0.10.6...v0.10.7
420
+ [0.10.6]: https://github.com/cascade-protocol/x402-proxy/compare/v0.10.5...v0.10.6
421
+ [0.10.5]: https://github.com/cascade-protocol/x402-proxy/compare/v0.10.4...v0.10.5
422
+ [0.10.4]: https://github.com/cascade-protocol/x402-proxy/compare/v0.10.3...v0.10.4
423
+ [0.10.3]: https://github.com/cascade-protocol/x402-proxy/compare/v0.10.2...v0.10.3
424
+ [0.10.2]: https://github.com/cascade-protocol/x402-proxy/compare/v0.10.1...v0.10.2
425
+ [0.10.1]: https://github.com/cascade-protocol/x402-proxy/compare/v0.10.0...v0.10.1
426
+ [0.10.0]: https://github.com/cascade-protocol/x402-proxy/compare/v0.9.4...v0.10.0
427
+ [0.9.4]: https://github.com/cascade-protocol/x402-proxy/compare/v0.9.3...v0.9.4
428
+ [0.9.3]: https://github.com/cascade-protocol/x402-proxy/compare/v0.9.2...v0.9.3
429
+ [0.9.2]: https://github.com/cascade-protocol/x402-proxy/compare/v0.9.1...v0.9.2
430
+ [0.9.1]: https://github.com/cascade-protocol/x402-proxy/compare/v0.9.0...v0.9.1
431
+ [0.9.0]: https://github.com/cascade-protocol/x402-proxy/compare/v0.8.6...v0.9.0
432
+ [0.8.6]: https://github.com/cascade-protocol/x402-proxy/compare/v0.8.5...v0.8.6
433
+ [0.8.5]: https://github.com/cascade-protocol/x402-proxy/compare/v0.8.4...v0.8.5
434
+ [0.8.4]: https://github.com/cascade-protocol/x402-proxy/compare/v0.8.3...v0.8.4
435
+ [0.8.3]: https://github.com/cascade-protocol/x402-proxy/compare/v0.8.2...v0.8.3
436
+ [0.8.2]: https://github.com/cascade-protocol/x402-proxy/compare/v0.8.1...v0.8.2
437
+ [0.8.1]: https://github.com/cascade-protocol/x402-proxy/compare/v0.8.0...v0.8.1
438
+ [0.8.0]: https://github.com/cascade-protocol/x402-proxy/compare/v0.7.1...v0.8.0
439
+ [0.7.1]: https://github.com/cascade-protocol/x402-proxy/compare/v0.7.0...v0.7.1
440
+ [0.7.0]: https://github.com/cascade-protocol/x402-proxy/compare/v0.6.0...v0.7.0
441
+ [0.6.0]: https://github.com/cascade-protocol/x402-proxy/compare/v0.5.2...v0.6.0
442
+ [0.5.2]: https://github.com/cascade-protocol/x402-proxy/compare/v0.5.1...v0.5.2
443
+ [0.5.1]: https://github.com/cascade-protocol/x402-proxy/compare/v0.5.0...v0.5.1
444
+ [0.5.0]: https://github.com/cascade-protocol/x402-proxy/compare/v0.4.2...v0.5.0
445
+ [0.4.2]: https://github.com/cascade-protocol/x402-proxy/compare/v0.4.1...v0.4.2
446
+ [0.4.1]: https://github.com/cascade-protocol/x402-proxy/compare/v0.4.0...v0.4.1
447
+ [0.4.0]: https://github.com/cascade-protocol/x402-proxy/compare/v0.3.2...v0.4.0
448
+ [0.3.2]: https://github.com/cascade-protocol/x402-proxy/compare/v0.3.1...v0.3.2
449
+ [0.3.1]: https://github.com/cascade-protocol/x402-proxy/compare/v0.3.0...v0.3.1
450
+ [0.3.0]: https://github.com/cascade-protocol/x402-proxy/compare/v0.2.1...v0.3.0
451
+ [0.2.1]: https://github.com/cascade-protocol/x402-proxy/compare/v0.2.0...v0.2.1
452
+ [0.2.0]: https://github.com/cascade-protocol/x402-proxy/compare/v0.1.0...v0.2.0
453
+ [0.1.0]: https://github.com/cascade-protocol/x402-proxy/releases/tag/v0.1.0
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.