@lightninglabs/lnc-web
Version:
Lightning Node Connect npm module for web
57 lines • 1.94 kB
TypeScript
import { FaradayApi, LitApi, LndApi, LoopApi, PoolApi, TaprootAssetsApi } from '@lightninglabs/lnc-core';
import { CredentialStore, LncConfig } from './types/lnc';
/** The default values for the LncConfig options. */
export declare const DEFAULT_CONFIG: Required<LncConfig>;
/**
* Legacy LNC facade: password-only, exposes public `credentials` object,
* and does not include passkey/session/auth-orchestration API.
*/
export default class LNC {
credentials: CredentialStore;
lnd: LndApi;
loop: LoopApi;
pool: PoolApi;
faraday: FaradayApi;
tapd: TaprootAssetsApi;
lit: LitApi;
private wasmManager;
constructor(lncConfig?: LncConfig);
get isReady(): boolean;
get isConnected(): boolean;
get status(): string;
get expiry(): Date;
get isReadOnly(): boolean;
hasPerms(permission: string): boolean;
/**
* Downloads the WASM client binary.
*/
preload(): Promise<void>;
/**
* Loads keys from storage and runs the WASM client binary.
*/
run(): Promise<void>;
/**
* Connects to the LNC proxy server.
* @returns a promise that resolves when the connection is established
*/
connect(): Promise<void>;
/**
* Disconnects from the proxy server.
*/
disconnect(): void;
/**
* Waits until the WASM client is executed and ready to accept connection info.
*/
waitTilReady(): Promise<void>;
/**
* Emulates a GRPC request but uses the WASM client instead to communicate
* with the LND node.
*/
request<TRes>(method: string, request?: object): Promise<TRes>;
/**
* Subscribes to a GRPC server-streaming endpoint and executes the
* `onMessage` handler when a new message is received from the server.
*/
subscribe<TRes>(method: string, request?: object, onMessage?: (res: TRes) => void, onError?: (res: Error) => void): void;
}
//# sourceMappingURL=lnc.d.ts.map