xud
Version:
Exchange Union Daemon
44 lines (43 loc) • 1.5 kB
TypeScript
/// <reference types="node" />
import { EventEmitter } from 'events';
import NodeKey from '../nodekey/NodeKey';
import SwapClientManager from '../swaps/SwapClientManager';
interface InitService {
once(event: 'nodekey', listener: (nodeKey: NodeKey) => void): this;
emit(event: 'nodekey', nodeKey: NodeKey): boolean;
}
/** A class containing the methods available for a locked, uninitialized instance of xud. */
declare class InitService extends EventEmitter {
private swapClientManager;
private nodeKeyPath;
private nodeKeyExists;
private databasePath;
/** Whether there is a pending `CreateNode` or `UnlockNode` call. */
private pendingCall;
constructor(swapClientManager: SwapClientManager, nodeKeyPath: string, nodeKeyExists: boolean, databasePath: string);
createNode: (args: {
password: string;
}) => Promise<{
initializedLndWallets: string[];
initializedConnext: boolean;
mnemonic: string[];
}>;
unlockNode: (args: {
password: string;
}) => Promise<{
unlockedLndClients: string[];
lockedLndClients: string[];
}>;
restoreNode: (args: {
password: string;
xudDatabase: Uint8Array;
lndBackupsMap: Map<string, Uint8Array>;
seedMnemonicList: string[];
}) => Promise<{
initializedLndWallets: string[];
initializedConnext: boolean;
}>;
private newWalletValidation;
private prepareCall;
}
export default InitService;