Class ManagerExternal

Hierarchy

  • ApiConnection
    • ManagerExternal

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>

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

  • Type Parameters

    • ResponseType = unknown

    Parameters

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

    Returns Promise<ResponseType>

  • Get the current Bitcoin price in another currency

    Returns

    The value as a number

    Parameters

    • currency: string = 'USD'

      The three-letter code of the currency you want

    Returns Promise<number>

  • Type Parameters

    • ResponseType = unknown

    Parameters

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

    Returns Promise<ResponseType>

Generated using TypeDoc