feat: add x402-browser-proxy sample#29
Merged
Merged
Conversation
MITM proxy that intercepts HTTP 402 responses and auto-signs x402 payments via CWP (CLI Wallet Protocol). Uses companion-wallet or any CWP-compatible provider for signing — no private keys needed. Key components: - cwp-signer.ts: bridges @x402/evm ClientEvmSigner to CWP walletExec - proxy.ts: http-mitm-proxy that intercepts 402s and retries with payment - x402-client.ts: x402 protocol client (CWP-only, no private key path) - test-server.mjs: mock x402 server for testing Adds samples/* to workspaces and eslint config. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
samples/x402-browser-proxy/— a MITM proxy that intercepts HTTP 402 responses and auto-signs x402 payments via CWP (CLI Wallet Protocol)companion-wallet(or any CWP provider) for signing — no private keys neededcwp-signer.tsbridges@x402/evm'sClientEvmSignerinterface to CWPwalletExec, making x402 payments work with any CWP-compatible walletsamples/*to workspaces and eslint configTest plan
npm run build— all packages + sample build successfullynpm run lint— passesnpm run test— all 61 existing tests passnode test-server.mjs --test) — passesx402.payai.network) — passes🤖 Generated with Claude Code