x402 payment protocol client (Coinbase/Linux Foundation).
Handles the HTTP 402 flow using EIP-712 signed ERC-3009
transferWithAuthorization messages. The server returns a
payment-required header with Base64-encoded payment requirements;
this module decodes it, signs with the wallet, and builds the
x-payment header for the retry request.
Header Flow
- Server ->
402+payment-required: <base64 JSON> - Client -> retry +
x-payment: <base64 signed payload> - Server ->
200+x-payment-response: <base64 receipt>