salt-sdk - v0.0.45
    Preparing search index...

    Class PaymentRequiredErrorSealed

    Thrown when an API request returns a 402 Payment Required status. Carries the raw response headers/body needed to build an x402 payment — hand getHeader and .body straight to x402HTTPClient.getPaymentRequiredResponse.

    This is a subclass of ApiError and is thrown automatically whenever new ApiError(402, body) is constructed. Callers can catch it either as an ApiError (with status === 402) or specifically as PaymentRequiredError.

    Fees for how to provide a payer or pre-sign a payment

    Hierarchy (View Summary)

    Index
    • Parameters

      • Optionalbody: unknown
      • Optionalurl: string
      • Optionalmethod: string
      • Optionalheaders: Headers

      Returns PaymentRequiredError

    body?: unknown

    The full parsed JSON response body, when available.

    code?: string

    Application error code from the response body, if present. E.g. "INSUFFICIENT_FUNDS", "CALL_EXCEPTION".

    headers?: Headers

    Raw response headers, when available — e.g. to read PAYMENT-REQUIRED off a 402.

    message: string
    method?: string

    The HTTP method (e.g. GET, POST), when available.

    name: string
    stack?: string
    status: number

    HTTP status code (e.g. 500, 404).

    url?: string

    The request URL, when available.

    • Case-insensitive response header lookup, null when unavailable — the shape x402HTTPClient.getPaymentRequiredResponse expects.

      Parameters

      • name: string

      Returns string | null