OMPX JavaScript SDK
    Preparing search index...

    Class X402Adapter

    Index

    Constructors

    Properties

    id: "x402" = ...

    Methods

    • Build the PAYMENT-REQUIRED header value for a 402 response. Returns headers to be added to the response.

      Parameters

      Returns Record<string, string>

    • Build error response headers (402 with error info in PAYMENT-RESPONSE).

      Parameters

      • error: string

      Returns Record<string, string>

    • Build the PAYMENT-RESPONSE header for a successful settlement response.

      Parameters

      Returns Record<string, string>

    • Parse the PAYMENT-SIGNATURE header from an incoming request (server-side). Returns null if no X402 credential is present.

      Parameters

      • request: Request

      Returns ParsedCredential | null