diff options
| -rw-r--r-- | index.js | 1 | ||||
| -rw-r--r-- | lib/payments.js | 1 | ||||
| -rw-r--r-- | routes/invoices.js | 24 | ||||
| -rw-r--r-- | routes/lnurl.js | 2 | ||||
| -rw-r--r-- | routes/payments.js | 20 | ||||
| -rw-r--r-- | routes/users.js | 1 |
6 files changed, 2 insertions, 47 deletions
@@ -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 { |
