middleware/src
Namespaces
Functions
createHTTPFacilitatorHandler()
createHTTPFacilitatorHandler(Defined in: packages/middleware/src/http-handler.ts:69 Creates afacilitatorURL,opts):FacilitatorHandler
FacilitatorHandler that delegates to a remote facilitator
via HTTP.
The glue layer constructs valid x402PaymentRequirements from
ResourcePricing using the handler’s declared schemes, then passes
them to getRequirements. This handler POSTs those to the
facilitator’s /accepts endpoint for enrichment.
Cache key stability: caching assumes that identical accepts arrays
produce identical facilitator responses. If the facilitator returns
time-dependent values (e.g. recentBlockhash), use a short maxAge
or disable caching.
Parameters
facilitatorURL
string
opts
CreateHTTPFacilitatorHandlerOpts
Returns
FacilitatorHandler