You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

14 lines
400 B

import fs from 'fs'
import grpc from 'grpc'
import config from '../config'
const walletUnlocker = (rpcpath, host) => {
const lndConfig = config.lnd()
const lndCert = fs.readFileSync(lndConfig.cert)
const credentials = grpc.credentials.createSsl(lndCert)
const rpc = grpc.load(lndConfig.rpcProtoPath)
return new rpc.lnrpc.WalletUnlocker(host, credentials)
}
export default walletUnlocker