|
@ -7,24 +7,27 @@ import walletUnlockerMethods from './walletUnlockerMethods' |
|
|
// use mainLog because lndLog is reserved for the lnd binary itself
|
|
|
// use mainLog because lndLog is reserved for the lnd binary itself
|
|
|
import { mainLog } from '../utils/log' |
|
|
import { mainLog } from '../utils/log' |
|
|
|
|
|
|
|
|
const initLnd = callback => { |
|
|
const initLnd = () => { |
|
|
const lndConfig = config.lnd() |
|
|
const lndConfig = config.lnd() |
|
|
const lnd = lightning(lndConfig.lightningRpc, lndConfig.lightningHost) |
|
|
const lnd = lightning(lndConfig.lightningRpc, lndConfig.lightningHost) |
|
|
|
|
|
|
|
|
const lndSubscribe = mainWindow => subscribe(mainWindow, lnd, mainLog) |
|
|
const lndSubscribe = mainWindow => subscribe(mainWindow, lnd, mainLog) |
|
|
const lndMethods = (event, msg, data) => methods(lnd, mainLog, event, msg, data) |
|
|
const lndMethods = (event, msg, data) => methods(lnd, mainLog, event, msg, data) |
|
|
|
|
|
|
|
|
callback(lndSubscribe, lndMethods) |
|
|
return { |
|
|
|
|
|
lndSubscribe, |
|
|
|
|
|
lndMethods |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const initWalletUnlocker = callback => { |
|
|
const initWalletUnlocker = () => { |
|
|
const lndConfig = config.lnd() |
|
|
const lndConfig = config.lnd() |
|
|
|
|
|
|
|
|
const walletUnlockerObj = walletUnlocker(lndConfig.lightningRpc, lndConfig.lightningHost) |
|
|
const walletUnlockerObj = walletUnlocker(lndConfig.lightningRpc, lndConfig.lightningHost) |
|
|
const walletUnlockerMethodsCallback = (event, msg, data) => |
|
|
const walletUnlockerMethodsCallback = (event, msg, data) => |
|
|
walletUnlockerMethods(walletUnlockerObj, mainLog, event, msg, data) |
|
|
walletUnlockerMethods(walletUnlockerObj, mainLog, event, msg, data) |
|
|
|
|
|
|
|
|
callback(walletUnlockerMethodsCallback) |
|
|
return walletUnlockerMethodsCallback |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|