Class Middleware

Hierarchy

  • ApiConnection
    • Middleware

Constructors

Properties

_jwt: string = ''
_onAuthFailed?: ((url: string) => void)

Type declaration

    • (url: string): void
    • Callback to run when a request returns status 401 (optional)

      Parameters

      • url: string

      Returns void

_requestFunc?: RequestFunction

Custom request function (optional)

lightning: MiddlewareLND
liquid: MiddlewareLiquid

Accessors

  • set jwt(newJwt: string): void
  • Parameters

    • newJwt: string

    Returns void

  • set onAuthFailed(callback: ((url: string) => void)): void
  • Parameters

    • callback: ((url: string) => void)
        • (url: string): void
        • Parameters

          • url: string

          Returns void

    Returns void

Methods

  • Type Parameters

    • ResponseType = unknown

    Parameters

    • url: string
    • method: "GET" | "POST" | "PUT" | "DELETE" = 'GET'
    • body: unknown = {}
    • auth: boolean = true
    • blob: boolean = false

    Returns Promise<ResponseType>

  • Type Parameters

    • ResponseType = unknown

    Parameters

    • url: string
    • body: unknown = {}
    • auth: boolean = true
    • blob: boolean = false

    Returns Promise<ResponseType>

  • Type Parameters

    • ResponseType = unknown

    Parameters

    • url: string
    • auth: boolean = true
    • blob: boolean = false

    Returns Promise<ResponseType>

  • Ping a node and get version information

    Returns

    Version information about the node

    Returns Promise<{ features?: string[]; isCitadel?: true; version: string }>

  • Type Parameters

    • ResponseType = unknown

    Parameters

    • url: string
    • body: unknown = {}
    • auth: boolean = true
    • blob: boolean = false

    Returns Promise<ResponseType>

  • Type Parameters

    • ResponseType = unknown

    Parameters

    • url: string
    • body: unknown = {}
    • auth: boolean = true
    • blob: boolean = false

    Returns Promise<ResponseType>

Generated using TypeDoc