aboutsummaryrefslogtreecommitdiffstats
path: root/routes/lightning
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2023-01-11 22:09:48 -0800
committerAdam Soltys <[email protected]>2023-01-12 15:44:13 -0800
commitc3565838644123e77881ff4f8536792f074047b9 (patch)
tree96da43fd19940d2f0836e43a511f0a1fb365044d /routes/lightning
parentded2c69ce89438326523a512b570be6eee4b23f0 (diff)
downloadcoinos-server-c3565838644123e77881ff4f8536792f074047b9.tar.gz
coinos-server-c3565838644123e77881ff4f8536792f074047b9.zip
migrating to redis
Diffstat (limited to 'routes/lightning')
-rw-r--r--routes/lightning/channel.js29
-rw-r--r--routes/lightning/channelRequest.js24
-rw-r--r--routes/lightning/index.js2
3 files changed, 0 insertions, 55 deletions
diff --git a/routes/lightning/channel.js b/routes/lightning/channel.js
deleted file mode 100644
index d5d5b7b2..00000000
--- a/routes/lightning/channel.js
+++ /dev/null
@@ -1,29 +0,0 @@
-import axios from "axios";
-import ln from "$lib/ln";
-
-export default async (req, res) => {
- const { params } = req.body;
- const [public_key, socket] = params.uri.split("@");
-
- l("connecting to peer", req.user.username, public_key, socket);
- let result;
-
- const { callback, k1 } = params;
- let remoteid;
- try {
- remoteid = (await ln.getinfo()).id;
- } catch (e) {
- err("problem getting lightning node info", e.message);
- return res.code(500).send(e.message);
- }
-
- let url = `${callback}?k1=${k1}&remoteid=${remoteid}&private=0`;
-
- try {
- let response = await axios.get(url);
- res.send(response.data);
- } catch (e) {
- err("problem sending channel request", e.message);
- return res.code(500).send({ status: "ERROR", reason: e.message });
- }
-};
diff --git a/routes/lightning/channelRequest.js b/routes/lightning/channelRequest.js
deleted file mode 100644
index 74e4cbba..00000000
--- a/routes/lightning/channelRequest.js
+++ /dev/null
@@ -1,24 +0,0 @@
-import { lnurlServer } from "$routes/lnurl";
-import { err } from "$lib/logging";
-
-export const channelRequest = async (req, res) => {
- let { localAmt, pushAmt } = req.body;
-
- pushAmt = 0;
-
- try {
- if (localAmt < 20000)
- throw new Error("amount must be greater than 20000 SAT");
- if (localAmt > 1000000) throw new Error("amount must be <= 1000000");
-
- const result = await lnurlServer.generateNewUrl("channelRequest", {
- localAmt,
- pushAmt
- });
-
- res.send(result);
- } catch (e) {
- err("problem generating channel request", e.message);
- res.code(500).send(e.message);
- }
-};
diff --git a/routes/lightning/index.js b/routes/lightning/index.js
index b4611ef5..ddc10bfe 100644
--- a/routes/lightning/index.js
+++ b/routes/lightning/index.js
@@ -1,11 +1,9 @@
-import channel from "./channel";
import invoice from "./invoice";
import query from "./query";
import send from "./send";
import parse from "./parse";
export default {
- channel,
invoice,
query,
send,