Options
All
  • Public
  • Public/Protected
  • All
Menu

A class containing the methods available for a locked, uninitialized instance of xud.

Hierarchy

  • EventEmitter
    • InitService

Index

Constructors

constructor

Properties

Private databasePath

databasePath: string

Private nodeKeyExists

nodeKeyExists: boolean

Private nodeKeyPath

nodeKeyPath: string

Private pendingCall

pendingCall: boolean = false

Whether there is a pending CreateNode or UnlockNode call.

Private swapClientManager

swapClientManager: SwapClientManager

Static defaultMaxListeners

defaultMaxListeners: number

Static Readonly errorMonitor

errorMonitor: keyof symbol

This symbol shall be used to install a listener for only monitoring 'error' events. Listeners installed using this symbol are called before the regular 'error' listeners are called.

Installing a listener using this symbol does not change the behavior once an 'error' event is emitted, therefore the process will still crash if no regular 'error' listener is installed.

Methods

addListener

  • addListener(event: string | symbol, listener: (...args: any[]) => void): this
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

createNode

  • createNode(args: { password: string }): Promise<{ initializedLndWallets: string[]; mnemonic: string[] }>
  • Parameters

    • args: { password: string }
      • password: string

    Returns Promise<{ initializedLndWallets: string[]; mnemonic: string[] }>

emit

  • emit(event: "nodekey", nodeKey: NodeKey): boolean

eventNames

  • eventNames(): Array<string | symbol>
  • Returns Array<string | symbol>

getMaxListeners

  • getMaxListeners(): number

listenerCount

  • listenerCount(type: string | symbol): number
  • Parameters

    • type: string | symbol

    Returns number

listeners

  • listeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

Private newWalletValidation

  • newWalletValidation(password: string): void

off

  • off(event: string | symbol, listener: (...args: any[]) => void): this
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

on

  • on(event: string | symbol, listener: (...args: any[]) => void): this
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

once

  • once(event: "nodekey", listener: (nodeKey: NodeKey) => void): this

Private prepareCall

  • prepareCall(ignoreUnavailableClients?: boolean): Promise<void>

prependListener

  • prependListener(event: string | symbol, listener: (...args: any[]) => void): this
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

prependOnceListener

  • prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

rawListeners

  • rawListeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

removeAllListeners

  • removeAllListeners(event?: string | symbol): this
  • Parameters

    • Optional event: string | symbol

    Returns this

removeListener

  • removeListener(event: string | symbol, listener: (...args: any[]) => void): this
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

restoreNode

  • restoreNode(args: { lndBackupsMap: Map<string, Uint8Array>; password: string; seedMnemonicList: string[]; xudDatabase: Uint8Array }): Promise<{ restoredLndWallets: string[] }>
  • Parameters

    • args: { lndBackupsMap: Map<string, Uint8Array>; password: string; seedMnemonicList: string[]; xudDatabase: Uint8Array }
      • lndBackupsMap: Map<string, Uint8Array>
      • password: string
      • seedMnemonicList: string[]
      • xudDatabase: Uint8Array

    Returns Promise<{ restoredLndWallets: string[] }>

setMaxListeners

  • setMaxListeners(n: number): this
  • Parameters

    • n: number

    Returns this

unlockNode

  • unlockNode(args: { password: string }): Promise<{ lockedLndClients: string[]; unlockedLndClients: string[] }>
  • Parameters

    • args: { password: string }
      • password: string

    Returns Promise<{ lockedLndClients: string[]; unlockedLndClients: string[] }>

Static listenerCount

  • listenerCount(emitter: EventEmitter, event: string | symbol): number
  • deprecated

    since v4.0.0

    Parameters

    • emitter: EventEmitter
    • event: string | symbol

    Returns number

Generated using TypeDoc