aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-02-14 20:34:04 -0800
committerAdam Soltys <[email protected]>2024-02-14 20:34:04 -0800
commitdf38624511d55e819cccd2a54c53b06c59e2ee67 (patch)
tree251c2e9a41aea163120cc3c3c12944ed5ff1cbf2
parent996d76afcb8a253a54eaedda3adaa5a495082146 (diff)
downloadcoinos-server-df38624511d55e819cccd2a54c53b06c59e2ee67.tar.gz
coinos-server-df38624511d55e819cccd2a54c53b06c59e2ee67.zip
remove classic functionality
-rw-r--r--index.js1
-rw-r--r--lib/payments.js1
-rw-r--r--routes/invoices.js24
-rw-r--r--routes/lnurl.js2
-rw-r--r--routes/payments.js20
-rw-r--r--routes/users.js1
6 files changed, 2 insertions, 47 deletions
diff --git a/index.js b/index.js
index 57825fe6..40fb3f18 100644
--- a/index.js
+++ b/index.js
@@ -51,7 +51,6 @@ app.get("/locations", locations.list);
app.get("/invoice/:id", invoices.get);
app.post("/invoice", optional, invoices.create);
-app.get("/invoice/classic/:username", invoices.classic);
app.get("/info", payments.info);
app.post("/payments", auth, payments.create);
diff --git a/lib/payments.js b/lib/payments.js
index 2b2ed2af..2f603c98 100644
--- a/lib/payments.js
+++ b/lib/payments.js
@@ -24,7 +24,6 @@ export let types = {
bitcoin: "bitcoin",
lightning: "lightning",
fund: "fund",
- classic: "classic",
liquid: "liquid",
};
diff --git a/routes/invoices.js b/routes/invoices.js
index 85c9166f..5d22fa5a 100644
--- a/routes/invoices.js
+++ b/routes/invoices.js
@@ -21,18 +21,7 @@ export default {
"username",
"pubkey",
]);
- } else if (config.classic) {
- try {
- invoice = await got(`${config.classic}/invoice/${id}`).json();
- if (invoice) {
- invoice.id = invoice.uuid;
- invoice.classic = true;
- invoice.user.id = invoice.user.uuid;
- invoice.user.username += "@classic";
- }
- } catch (e) {}
}
-
if (invoice) res.send(invoice);
else res.code(500).send("invoice not found");
},
@@ -45,17 +34,4 @@ export default {
bail(res, e.message);
}
},
-
- async classic({ params: { username } }, res) {
- let invoice = await got
- .post(`${config.classic}/invoice`, {
- json: {
- invoice: { amount: 0, network: "lightning" },
- user: { username },
- },
- })
- .json();
-
- res.send(invoice);
- },
};
diff --git a/routes/lnurl.js b/routes/lnurl.js
index c48e5356..2a8f5564 100644
--- a/routes/lnurl.js
+++ b/routes/lnurl.js
@@ -11,7 +11,7 @@ import { types } from "$lib/payments";
import crypto from "crypto";
import config from "$config";
-let { admin, classic } = config;
+let { admin } = config;
let { URL } = process.env;
let host = URL.split("/").at(-1);
diff --git a/routes/payments.js b/routes/payments.js
index 52def94b..9e4122f6 100644
--- a/routes/payments.js
+++ b/routes/payments.js
@@ -47,25 +47,7 @@ export default {
let p;
- if (username && username.endsWith("@classic")) {
- let { username: source } = user;
- username = username.replace("@classic", "");
- p = await debit({
- hash,
- amount,
- memo: username,
- rate,
- user,
- type: types.classic,
- });
-
- await got
- .post(`${config.classic}/admin/credit`, {
- json: { username, amount, source },
- headers: { authorization: `Bearer ${config.admin}` },
- })
- .json();
- } else if (payreq) {
+ if (payreq) {
p = await sendLightning({ user, pr: payreq, amount, maxfee, memo });
}
diff --git a/routes/users.js b/routes/users.js
index 97a0c9a7..b30beb54 100644
--- a/routes/users.js
+++ b/routes/users.js
@@ -29,7 +29,6 @@ import { mail, templates } from "$lib/mail";
import got from "got";
import upload from "$lib/upload";
-let { classic } = config;
const { encode, decode, fromWords, toWords } = bech32;
export default {