Update dependencies (#121)

This commit is contained in:
Aaron Dewes 2021-01-04 13:49:42 +01:00 committed by GitHub
parent b8cd8d05b0
commit cf40d77b01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 10738 additions and 4687 deletions

View File

@ -1,16 +1,16 @@
{
"parser": "babel-eslint",
"parser": "@babel/eslint-parser",
"plugins": [
"prettier"
],
"extends": ["prettier"],
"rules": {
'prettier/prettier': [
'warn',
"prettier/prettier": [
"warn",
{
singleQuote: true,
printWidth: 140,
trailingComma: 'all'
"singleQuote": true,
"printWidth": 140,
"trailingComma": "all"
}
]
},

View File

@ -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));
}
}

View File

@ -154,7 +154,9 @@ router.post('/addinvoice', postLimiter, async function(req, res) {
const invoice = new Invo(redis, bitcoinclient, lightning);
const r_preimage = invoice.makePreimageHex();
lightning.addInvoice({ memo: req.body.memo, value: req.body.amt, expiry: 3600 * 24, r_preimage: Buffer.from(r_preimage, 'hex').toString('base64') }, async function(err, info) {
lightning.addInvoice(
{ memo: req.body.memo, value: req.body.amt, expiry: 3600 * 24, r_preimage: Buffer.from(r_preimage, 'hex').toString('base64') },
async function (err, info) {
if (err) return errorLnd(res);
info.pay_req = info.payment_request; // client backwards compatibility
@ -162,7 +164,8 @@ router.post('/addinvoice', postLimiter, async function(req, res) {
await invoice.savePreimage(r_preimage);
res.send(info);
});
},
);
});
router.post('/payinvoice', async function (req, res) {
@ -334,7 +337,8 @@ router.get('/checkpayment/:payment_hash', async function(req, res) {
}
let paid = true;
if (!(await u.getPaymentHashPaid(req.params.payment_hash))) { // Not found on cache
if (!(await u.getPaymentHashPaid(req.params.payment_hash))) {
// Not found on cache
paid = await u.syncInvoicePaid(req.params.payment_hash);
}
res.send({ paid: paid });

View File

@ -6,7 +6,7 @@ process.on('uncaughtException', function(err) {
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
let express = require('express');
let morgan = require('morgan');
let uuid = require('node-uuid');
import { v4 as uuidv4 } from 'uuid';
let logger = require('./utils/logger');
morgan.token('id', function getId(req) {
@ -24,7 +24,7 @@ const limiter = rateLimit({
app.use(limiter);
app.use(function (req, res, next) {
req.id = uuid.v4();
req.id = uuidv4();
next();
});

View File

@ -1,8 +1,18 @@
// setup lnd rpc
const config = require('./config');
var fs = require('fs');
var grpc = require('grpc');
var lnrpc = grpc.load('rpc.proto').lnrpc;
var grpc = require('@grpc/grpc-js');
const protoLoader = require('@grpc/proto-loader');
const loaderOptions = {
keepCase: true,
longs: String,
enums: String,
defaults: true,
oneofs: true
};
const packageDefinition = protoLoader.loadSync('rpc.proto', loaderOptions);
var lnrpc = grpc.loadPackageDefinition(packageDefinition).lnrpc;
process.env.GRPC_SSL_CIPHER_SUITES = 'HIGH+ECDSA';
var lndCert;
if (process.env.TLSCERT) {

11747
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -12,31 +12,32 @@
"author": "Igor Korsakov <overtorment@gmail.com>",
"license": "MIT",
"dependencies": {
"@babel/core": "^7.0.0",
"@babel/cli": "^7.0.0",
"babel-eslint": "^10.1.0",
"@babel/node": "^7.0.0",
"@babel/polyfill": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"@babel/register": "^7.0.0",
"@babel/cli": "^7.12.10",
"@babel/core": "^7.12.10",
"@babel/eslint-parser": "^7.12.1",
"@babel/node": "^7.12.10",
"@babel/preset-env": "^7.12.11",
"@babel/register": "^7.12.10",
"@grpc/grpc-js": "^1.2.2",
"@grpc/proto-loader": "^0.5.5",
"bignumber.js": "^9.0.1",
"bolt11": "^1.2.6",
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.15.0",
"eslint-plugin-prettier": "^3.1.4",
"express": "^4.16.4",
"bolt11": "^1.2.7",
"core-js": "^3.8.1",
"eslint": "^7.16.0",
"eslint-config-prettier": "^7.1.0",
"eslint-plugin-prettier": "^3.3.0",
"express": "^4.17.1",
"express-rate-limit": "^5.2.3",
"frisbee": "^3.1.4",
"grpc": "^1.24.4",
"ioredis": "^4.19.2",
"jayson": "^3.3.4",
"morgan": "^1.9.1",
"mustache": "^4.0.1",
"node-uuid": "^1.4.8",
"prettier": "^2.2.0",
"ioredis": "^4.19.4",
"jayson": "^3.4.4",
"morgan": "^1.10.0",
"mustache": "^4.1.0",
"prettier": "^2.2.1",
"qr-image": "3.2.0",
"request": "^2.88.0",
"request": "^2.88.2",
"request-promise": "^4.2.6",
"uuid": "^8.3.2",
"winston": "^3.3.3"
}
}

3394
rpc.proto

File diff suppressed because it is too large Load Diff

View File

@ -38,7 +38,7 @@ let lightning = require('../lightning');
let payment = new Paym(redis, bitcoinclient, lightning);
payment.setInvoice(lockedPayment.pay_req);
if (daysPassed > (1 / 24) && daysPassed <= 1) {
if (daysPassed > 1 / 24 && daysPassed <= 1) {
// if (!await payment.isExpired()) {
let sendResult;
console.log('attempting to pay to route');

View File

@ -12,7 +12,7 @@
<meta content="800" property="og:image:width">
<meta content="800" property="og:image:height">
<link rel="icon" href="/static/favicon.png">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
<title>LNDhub - Open source Bank</title>
<!-- Custom styles for this template -->
<link href="/static/css/lndhub.css" rel="stylesheet">
@ -91,6 +91,6 @@
<!-- Place this tag in your head or just before your close body tag. -->
<script async defer src="https://buttons.github.io/buttons.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV" crossorigin="anonymous"></script>
</body>
</html>

View File

@ -7,16 +7,13 @@
*
+ + + + + + + + + + + + + + + + + + + + + */
let fs = require('fs');
let winston = require('winston');
let createLogger = winston.createLogger;
let format = winston.format;
let transports = winston.transports;
import { createLogger, format, transports } from 'winston';
/* + + + + + + + + + + + + + + + + + + + + +
// Start
+ + + + + + + + + + + + + + + + + + + + + */
const { combine, timestamp, printf } = format;
const logFormat = printf(info => {
const logFormat = printf((info) => {
return `${info.timestamp} : ${info.level}: [${info.label}] : ${info.message}`;
});
const logger = createLogger({