Skip to main content

middleware/src

Namespaces

Functions

createHTTPFacilitatorHandler()

createHTTPFacilitatorHandler(facilitatorURL, opts): FacilitatorHandler
Defined in: packages/middleware/src/http-handler.ts:69 Creates a 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

References

createRemoteX402Handlers

Re-exports createRemoteX402Handlers