aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2022-09-07 13:29:30 -0700
committerAdam Soltys <[email protected]>2022-09-07 13:29:30 -0700
commit3e11c9e4aa3618e58af413c98d6992ae18d444f7 (patch)
treeb5ff453effe14fcec4e988d02c9a9362875502b0
parent06b59b585ac9af7be106b9c1271d251ba20f6630 (diff)
downloadcoinos-server-3e11c9e4aa3618e58af413c98d6992ae18d444f7.tar.gz
coinos-server-3e11c9e4aa3618e58af413c98d6992ae18d444f7.zip
prettier
-rw-r--r--index.js2
-rw-r--r--lib/sockets.js3
-rw-r--r--routes/lnurl.js13
-rw-r--r--routes/referrals.js10
-rw-r--r--sampleconfig/index.js1
5 files changed, 13 insertions, 16 deletions
diff --git a/index.js b/index.js
index 06734322..8262967d 100644
--- a/index.js
+++ b/index.js
@@ -23,7 +23,7 @@ import "./routes/payments";
if (config.bitcoin) store.networks.push("bitcoin");
if (config.liquid) store.networks.push("liquid");
if (config.lna) store.networks.push("lightning");
-// if (config.lnurl) import("./routes/lnurl");
+if (config.lnurl) import("./routes/lnurl");
let host = process.env.HOST || "0.0.0.0";
let port = process.env.PORT || 3119;
diff --git a/lib/sockets.js b/lib/sockets.js
index 252ee552..9ff454aa 100644
--- a/lib/sockets.js
+++ b/lib/sockets.js
@@ -15,7 +15,6 @@ const code = 1000;
const wss = new WebSocket.Server({ clientTracking: false, noServer: true });
-/* eslint-disable-next-line */
const pick = (O, ...K) => K.reduce((o, k) => ((o[k] = O[k]), o), {});
const all = {};
const subscriptions = [];
@@ -34,7 +33,6 @@ export const emit = (username, type, data) => {
(data.address && s.invoice.unconfidential === data.address)
) {
s.ws.send(JSON.stringify({ type, data }));
- // subscriptions.splice(i, 1);
}
}
}
@@ -87,7 +85,6 @@ app.register(async function(app) {
case "login":
let token = data;
- // if (differenceInSeconds(new Date(), lastSeen[token]) < 5) return;
lastSeen[token] = new Date();
try {
diff --git a/routes/lnurl.js b/routes/lnurl.js
index 1cf5e319..54b82ade 100644
--- a/routes/lnurl.js
+++ b/routes/lnurl.js
@@ -1,16 +1,19 @@
-import { emit } from "$lib/sockets";
-import store from "$lib/store";
import app from "$app";
import config from "$config";
+import store from "$lib/store";
+import { optionalAuth, auth } from "$lib/passport";
+
+import lnd from "$lib/lnd";
+import persist from "$lib/persist";
+import { emit } from "$lib/sockets";
+
import axios from "axios";
import lnurl from "lnurl";
import jwt from "jsonwebtoken";
import qs from "query-string";
-import persist from "$lib/persist";
import bolt11 from "bolt11";
-import { optionalAuth, auth } from "$lib/passport";
+
import { createInvoice, getPayments } from "lightning";
-import lnd from "$lib/lnd";
export const logins = persist("data/logins.json");
export const recipients = persist("data/recipients.json");
diff --git a/routes/referrals.js b/routes/referrals.js
index b3d53306..7193964d 100644
--- a/routes/referrals.js
+++ b/routes/referrals.js
@@ -180,12 +180,10 @@ router.get("/verify/:user_id/:token", auth, async (req, res) => {
updated: found.updated_at
});
} else {
- res
- .code(500)
- .send({
- verified: false,
- message: "Referral already " + found[0].status
- });
+ res.code(500).send({
+ verified: false,
+ message: "Referral already " + found[0].status
+ });
}
} else {
res.code(500).send("Invalid referral token");
diff --git a/sampleconfig/index.js b/sampleconfig/index.js
index b39eab5a..0896d541 100644
--- a/sampleconfig/index.js
+++ b/sampleconfig/index.js
@@ -1,4 +1,3 @@
-
const db = {
user: "root",
password: "password",