Skip to content

PaymentGate

Defined in: gate.ts:128

The PQ-402 resource-server flow (x402 authorization flow): answer 402, check the request binding and replay, verify, open the sealed request, run the handler, seal the response, settle, sign the receipt.

new PaymentGate(options): PaymentGate

Defined in: gate.ts:133

PaymentGateOptions

PaymentGate

handle(req, handler): Promise<GateResponse>

Defined in: gate.ts:184

GateRequest

Handler

Promise<GateResponse>


requirementsFor(route): Promise<PaymentRequirements[]>

Defined in: gate.ts:162

One accepts entry per scheme this gate offers, same price and payee.

PaidRoute

Promise<PaymentRequirements[]>


routeOf(method, target): PaidRoute | undefined

Defined in: gate.ts:142

string

string

PaidRoute | undefined


sealingInfo(route): SealingInfo | undefined

Defined in: gate.ts:148

The pq402-sealing info this gate declares for a route, if sealing is on.

PaidRoute

SealingInfo | undefined