Skip to main content

Module server

Module server 

Source
Expand description

Axum/Tower server middleware for automatic x402 payment gating.

Provides PaymentGateLayer which wraps an inner service to intercept requests to payment-protected routes, enforce 402 Payment Required responses, verify payments, and settle after successful responses.

Corresponds to Python SDK’s http/x402_http_server.py + http/x402_http_server_base.py.

Structs§

PaymentGateLayer
Tower Layer that adds x402 payment gating to an inner service.
PaymentGateService
Tower Service that enforces x402 payment requirements.

Type Aliases§

RoutesConfig
Route configuration map: pattern → RouteConfig.