Class ManagerAuth

Hierarchy

  • ApiConnection
    • ManagerAuth

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)

Accessors

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

    • jwt: 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>

  • Change the users password.

    Parameters

    • currentPassword: string

      The current password

    • newPassword: string

      The new password

    • totpToken: string

      The TOTP token

    Returns Promise<void>

  • Type Parameters

    • ResponseType = unknown

    Parameters

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

    Returns Promise<ResponseType>

  • Parameters

    • key: string

    Returns Promise<void>

  • Actually enables TOTP by checking if a correct code is given.

    Parameters

    • key: string

      The TOTP key

    Returns Promise<void>

  • Type Parameters

    • ResponseType = unknown

    Parameters

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

    Returns Promise<ResponseType>

  • Retrieve information about the node's main account.

    Returns

    The user's data

    Returns Promise<user>

  • Check if the node owner has an account

    Returns

    True if the user exists

    Returns Promise<boolean>

  • Login to the node.

    Returns

    A JsonWebToken for the user

    Parameters

    • password: string

      The users password

    • totpToken: string

      The TOTP token

    Returns Promise<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>

  • Refresh the users login JWT

    Returns

    A new JWT for the user

    Returns Promise<string>

  • Register a new user. Currently, this is only possible if no one is registered yet.

    Returns

    A JsonWebToken for the user

    Parameters

    • username: string

      The users name

    • password: string

      The users password

    • seed: string[]

      The mnemonic seed for the users wallet (LND aezeed)

    Returns Promise<{ backupId?: string; jwt: string }>

  • Retrieve the users mnemonic seed.

    Returns

    The mnemonic seed

    Parameters

    • password: string

      The users password as plain text

    • Optional totpToken: string

    Returns Promise<string[]>

  • Sets up TOTP for the user.

    Returns

    The TOTP key

    Returns Promise<string>

  • Check if the login worked and the user is still connected

    Returns

    True if the user is logged in

    Returns Promise<boolean>

Generated using TypeDoc