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.
 
 
 

16 lines
550 B

export default function pushinvoices(lnd, event) {
return new Promise((resolve, reject) => {
try {
const call = lnd.subscribeInvoices({})
call.on('data', data => event.sender.send('pushinvoicesupdated', { data }))
call.on('end', () => event.sender.send('pushinvoicesend'))
call.on('error', error => event.sender.send('pushinvoiceserror', { error }))
call.on('status', status => event.sender.send('pushinvoicesstatus', { status }))
resolve(null)
} catch (error) {
reject(error, null)
}
})
}