Skip to content

feat(ws): implement x402 over WebSocket#1231

Open
web3luka wants to merge 11 commits intocoinbase:mainfrom
web3luka:feat/ws-x402-payment-transport
Open

feat(ws): implement x402 over WebSocket#1231
web3luka wants to merge 11 commits intocoinbase:mainfrom
web3luka:feat/ws-x402-payment-transport

Conversation

@web3luka
Copy link
Contributor

@web3luka web3luka commented Feb 18, 2026

Description

This PR introduces WebSocket transport support for x402 in TypeScript via a new @x402/ws package.

Scope

  • add x402WSClient with automatic 402 -> payment -> retry flow
  • add x402WSServer with RPC-style WS request/response dispatching
  • add createWSPaymentWrapper for server-side payment verify/settle around handlers
  • add real EVM integration test for end-to-end paid WS call
  • add real SVM integration test for end-to-end paid WS call
  • add package setup/docs/scripts needed to build and test @x402/ws

Tests

Executed locally:

  • pnpm --filter @x402/ws lint
  • pnpm --filter @x402/ws test
  • pnpm --filter @x402/ws test:integration

Integration run confirms successful paid WS flow and settlement with transaction output.

Checklist

  • I have formatted and linted my code
  • All new and existing tests pass
image image
  • My commits are signed (required for merge)
  • I added a changelog fragment for user-facing changes (docs-only changes can skip)

- add x402WSClient with automatic 402 -> payment -> retry flow
- add x402WSServer with RPC-style WS request/response dispatching
- add createWSPaymentWrapper for server-side verify/settle around handlers
- add real EVM integration test for end-to-end paid WS call
@cb-heimdall
Copy link

cb-heimdall commented Feb 18, 2026

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

@vercel
Copy link

vercel bot commented Feb 18, 2026

@web3luka is attempting to deploy a commit to the Coinbase Team on Vercel.

A member of the Team first needs to authorize it.

@web3luka web3luka marked this pull request as ready for review February 18, 2026 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants