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
584 B

export default function pushopenchannel(lnd, event, payload) {
return new Promise((resolve, reject) => {
try {
const call = lnd.openChannel(payload)
call.on('data', data => event.sender.send('pushchannelupdated', { data }))
call.on('end', () => event.sender.send('pushchannelend'))
call.on('error', error => event.sender.send('pushchannelerror', { error: error.toString() }))
call.on('status', status => event.sender.send('pushchannelstatus', { status }))
resolve(null, payload)
} catch (error) {
reject(error, null)
}
})
}