-
-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Typescript Typedef for NativeModule LndMobile
- Loading branch information
Showing
3 changed files
with
49 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
export enum ELndMobileStatusCodes { | ||
STATUS_SERVICE_BOUND = 1, | ||
STATUS_PROCESS_STARTED = 2, | ||
STATUS_WALLET_UNLOCKED = 4, | ||
} | ||
|
||
export interface ILndMobile { | ||
// General | ||
init(): Promise<void>; | ||
checkLndMobileServiceConnected(): Promise<boolean>; | ||
sendPongToLndMobileservice(): Promise<{ data: string }>; | ||
checkStatus(): Promise<ELndMobileStatusCodes>; | ||
writeConfigFile(): Promise<string>; | ||
startLnd(torEnabled: boolean): Promise<{ data: string }> | ||
stopLnd(): Promise<{ data: string }>; | ||
initWallet(seed: string[], password: string, recoveryWindow: number, channelBackupsBase64: string | null): Promise<{ data: string }>; | ||
unlockWallet(password: string): Promise<{ data: string }> | ||
killLnd(): Promise<boolean>; | ||
restartApp(): void; | ||
saveChannelsBackup(base64Backups: string): Promise<string>; | ||
log(level: "v" | "d" | "i" | "w" | "e", tag: string, msg: string): void; | ||
saveLogs(): Promise<string>; | ||
copyLndLog(): Promise<string>; | ||
tailLog(numberOfLines: number): Promise<string>; | ||
getTorEnabled(): Promise<boolean>; | ||
observeLndLogFile(): Promise<boolean>; | ||
DEBUG_getWalletPasswordFromKeychain(): Promise<string>; | ||
|
||
// Send gRPC LND API request | ||
sendCommand(method: string, base64Payload: string): Promise<{ data: string }>; | ||
sendStreamCommand(method: string, base64Payload: string, streamOnlyOnce: boolean): Promise<"done">; | ||
|
||
// Android-specific | ||
getIntentStringData(): Promise<string | null>; | ||
getIntentNfcData(): Promise<string | null>; | ||
DEBUG_deleteWallet(): Promise<boolean>; | ||
DEBUG_deleteDatafolder(): Promise<null>; | ||
DEBUG_listProcesses(): Promise<string>; | ||
checkLndProcessExist(): Promise<boolean>; | ||
deleteTLSCerts(): Promise<boolean>; | ||
unbindLndMobileService(): Promise<void>; // TODO(hsjoberg): function looks broken | ||
} | ||
|
||
declare module "react-native" { | ||
interface NativeModulesStatic { | ||
LndMobile: ILndMobile; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters