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