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.
19 lines
533 B
19 lines
533 B
import bitcore from 'bitcore-lib'
|
|
import pushopenchannel from '../push/openchannel'
|
|
|
|
const BufferUtil = bitcore.util.buffer
|
|
|
|
export default function openchannel(lnd, event, payload) {
|
|
const { pubkey, localamt, pushamt } = payload
|
|
const res = {
|
|
node_pubkey: BufferUtil.hexToBuffer(pubkey),
|
|
local_funding_amount: Number(localamt),
|
|
push_sat: Number(pushamt)
|
|
}
|
|
|
|
return new Promise((resolve, reject) =>
|
|
pushopenchannel(lnd, event, res)
|
|
.then(data => resolve(data))
|
|
.catch(error => reject(error))
|
|
)
|
|
}
|
|
|