|
@ -15,6 +15,7 @@ import payinvoice from './payinvoice' |
|
|
import payments from './payments' |
|
|
import payments from './payments' |
|
|
import peers from './peers' |
|
|
import peers from './peers' |
|
|
import pendingchannels from './pendingchannels' |
|
|
import pendingchannels from './pendingchannels' |
|
|
|
|
|
import sendcoins from './sendcoins' |
|
|
import walletbalance from './walletbalance' |
|
|
import walletbalance from './walletbalance' |
|
|
|
|
|
|
|
|
export default function (lnd, event, msg, data) { |
|
|
export default function (lnd, event, msg, data) { |
|
@ -91,6 +92,13 @@ export default function (lnd, event, msg, data) { |
|
|
.then(({ payment_route }) => event.sender.send('paymentSuccessful', Object.assign(data, { payment_route }))) |
|
|
.then(({ payment_route }) => event.sender.send('paymentSuccessful', Object.assign(data, { payment_route }))) |
|
|
.catch(error => console.log('payinvoice error: ', error)) |
|
|
.catch(error => console.log('payinvoice error: ', error)) |
|
|
break |
|
|
break |
|
|
|
|
|
case 'sendCoins': |
|
|
|
|
|
// Transaction looks like { txid: String }
|
|
|
|
|
|
// { addr, amount } = data
|
|
|
|
|
|
sendcoins(lnd, data) |
|
|
|
|
|
.then((transaction) => event.sender.send('sendSuccessful', transaction) |
|
|
|
|
|
.catch(error => console.log('sendcoins error: ', error)) |
|
|
|
|
|
break |
|
|
case 'openChannel': |
|
|
case 'openChannel': |
|
|
// Response is empty. Streaming updates on channel status and updates
|
|
|
// Response is empty. Streaming updates on channel status and updates
|
|
|
// { pubkey, localamt, pushamt } = data
|
|
|
// { pubkey, localamt, pushamt } = data
|
|
|