See a full working demo at github.com/SemanticPay/x402-usdt0-demo
Buyer
WalletAccountEvm satisfies the ClientEvmSigner interface that x402 expects. No adapter needed.
Seller
Option 1: Hosted facilitator
Use Semantic’s facilitator to handle verification and settlement. Your server never interacts with the chain directly.- Automatic verification of buyer payment signatures
- No gas fees, no native token required in your wallet
- No transaction monitoring or retry logic
- No facilitator infrastructure to deploy
paymentMiddleware pointing to Semantic’s facilitator:
Option 2: Self-hosted facilitator
Run your own facilitator for full control over verification and settlement. The@semanticio/wdk-wallet-evm-x402-facilitator module wraps a WDK wallet as an x402 FacilitatorEvmSigner.
1. Create the facilitator signer
2. Initialize the facilitator
Register the signer with anx402Facilitator instance. Lifecycle hooks are optional but useful for logging:
3. Wire into Express
SamepaymentMiddleware pattern as the hosted facilitator, but instead of an HTTPFacilitatorClient, pass the in-process facilitator directly to x402ResourceServer. Verification and settlement happen locally.
For a complete working example, see server.js.
@semanticio/wdk-wallet-evm-x402-facilitator is currently in beta. Test thoroughly before using in production.