Update dependencies (#121)
This commit is contained in:
@@ -103,7 +103,7 @@ export class Invo {
|
||||
num_max_invoices: 99000111,
|
||||
reversed: true,
|
||||
},
|
||||
function(err, response) {
|
||||
function (err, response) {
|
||||
if (err) return reject(err);
|
||||
resolve(response);
|
||||
},
|
||||
|
||||
@@ -22,8 +22,8 @@ export class Paym {
|
||||
|
||||
async decodePayReqViaRpc(invoice) {
|
||||
let that = this;
|
||||
return new Promise(function(resolve, reject) {
|
||||
that._lightning.decodePayReq({ pay_req: invoice }, function(err, info) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
that._lightning.decodePayReq({ pay_req: invoice }, function (err, info) {
|
||||
if (err) return reject(err);
|
||||
that._decoded = info;
|
||||
return resolve(info);
|
||||
@@ -42,8 +42,8 @@ export class Paym {
|
||||
fee_limit: { fixed: Math.floor(this._decoded.num_satoshis * 0.01) + 1 },
|
||||
};
|
||||
let that = this;
|
||||
return new Promise(function(resolve, reject) {
|
||||
that._lightning.queryRoutes(request, function(err, response) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
that._lightning.queryRoutes(request, function (err, response) {
|
||||
if (err) return reject(err);
|
||||
resolve(response);
|
||||
});
|
||||
@@ -62,8 +62,8 @@ export class Paym {
|
||||
console.log('sendToRouteSync:', { request });
|
||||
|
||||
let that = this;
|
||||
return new Promise(function(resolve, reject) {
|
||||
that._lightning.sendToRouteSync(request, function(err, response) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
that._lightning.sendToRouteSync(request, function (err, response) {
|
||||
if (err) reject(err);
|
||||
resolve(that.processSendPaymentResponse(response));
|
||||
});
|
||||
@@ -133,7 +133,7 @@ export class Paym {
|
||||
|
||||
async listPayments() {
|
||||
return new Promise((resolve, reject) => {
|
||||
this._lightning.listPayments({}, function(err, response) {
|
||||
this._lightning.listPayments({}, function (err, response) {
|
||||
if (err) return reject(err);
|
||||
resolve(response);
|
||||
});
|
||||
|
||||
@@ -232,8 +232,8 @@ export class User {
|
||||
|
||||
async lookupInvoice(payment_hash) {
|
||||
let that = this;
|
||||
return new Promise(function(resolve, reject) {
|
||||
that._lightning.lookupInvoice({ r_hash_str: payment_hash }, function(err, response) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
that._lightning.lookupInvoice({ r_hash_str: payment_hash }, function (err, response) {
|
||||
if (err) resolve({});
|
||||
resolve(response);
|
||||
});
|
||||
@@ -557,11 +557,7 @@ export class User {
|
||||
}
|
||||
|
||||
_hash(string) {
|
||||
return crypto
|
||||
.createHash('sha256')
|
||||
.update(string)
|
||||
.digest()
|
||||
.toString('hex');
|
||||
return crypto.createHash('sha256').update(string).digest().toString('hex');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -577,6 +573,6 @@ export class User {
|
||||
}
|
||||
|
||||
static async _sleep(s) {
|
||||
return new Promise(r => setTimeout(r, s * 1000));
|
||||
return new Promise((r) => setTimeout(r, s * 1000));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user