Documentation
¶
Overview ¶
Package demo implements HTTP handlers for obol sell demo services.
Each demo type returns a JSON response with a standard envelope:
{
"demo": "<type>",
"timestamp": "...",
"payment": { "status": "...", "tx": "...", "payer": "..." },
"data": { ... }
}
The payment block is populated from x402 ForwardAuth headers injected by Traefik after successful payment verification.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BlocksHandler ¶
func BlocksHandler(erpcURL string) http.HandlerFunc
BlocksHandler returns a handler that queries eRPC for basic chain data.
func HelloHandler ¶
func HelloHandler() http.HandlerFunc
HelloHandler returns a proof-of-payment response echoing request details.
func QuantHandler ¶
func QuantHandler(erpcURL string) http.HandlerFunc
QuantHandler returns a handler that performs chain analysis using eRPC data. Unlike a simple RPC passthrough, it fetches multiple data points, computes derived metrics (gas statistics, tx volume), and formats a structured report.
Types ¶
type PaymentInfo ¶
type PaymentInfo struct {
Status string `json:"status"`
Tx string `json:"tx,omitempty"`
Payer string `json:"payer,omitempty"`
}
PaymentInfo captures x402 payment metadata from ForwardAuth headers.