Using a SHHH V8.4 wallet? This page covers
X402Client, which signs
payments for legacy CHIPI v29 and READY (Argent X) wallets. SHHH
V8.4 wallets — the default for new wallets since v14.5.0 — use
X402ShhhClient instead, because V8.4
rejects the raw {r, s} signature shape X402Client produces.Overview
The x402 client automatically handles HTTP 402 responses. When a server requires payment, the client:- Parses the payment requirement from the
PAYMENT-REQUIREDheader - Validates the amount against your configured limits
- Signs the payment using your Starknet account
- Retries the request with the
X-PAYMENTheader
React — useX402Payment Hook
The easiest way to use x402 in a React/Next.js app:
Hook Configuration
Hook Return Values
Node.js — X402Client
For server-side or CLI applications:
Configuration Options
Python
Safety Features
Amount Limits
Always setmaxPaymentAmount to prevent unexpected charges:
