|
@ -117,7 +117,6 @@ const keysend = (opts) => { |
|
|
return new Promise(function (resolve, reject) { |
|
|
return new Promise(function (resolve, reject) { |
|
|
return __awaiter(this, void 0, void 0, function* () { |
|
|
return __awaiter(this, void 0, void 0, function* () { |
|
|
let lightning = yield loadLightning(); |
|
|
let lightning = yield loadLightning(); |
|
|
console.log("FIRST OPTS", opts); |
|
|
|
|
|
const randoStr = crypto.randomBytes(32).toString('hex'); |
|
|
const randoStr = crypto.randomBytes(32).toString('hex'); |
|
|
const preimage = ByteBuffer.fromHex(randoStr); |
|
|
const preimage = ByteBuffer.fromHex(randoStr); |
|
|
const options = { |
|
|
const options = { |
|
@ -131,7 +130,6 @@ const keysend = (opts) => { |
|
|
payment_hash: sha.sha256.arrayBuffer(preimage.toBuffer()), |
|
|
payment_hash: sha.sha256.arrayBuffer(preimage.toBuffer()), |
|
|
dest_features: [9], |
|
|
dest_features: [9], |
|
|
}; |
|
|
}; |
|
|
console.log("FINAL OPTIONS", options); |
|
|
|
|
|
const call = lightning.sendPayment(); |
|
|
const call = lightning.sendPayment(); |
|
|
call.on('data', function (payment) { |
|
|
call.on('data', function (payment) { |
|
|
if (payment.payment_error) { |
|
|
if (payment.payment_error) { |
|
|