aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-01-22 20:05:14 -0800
committerAdam Soltys <[email protected]>2024-01-22 20:05:14 -0800
commitad6bbbd558781b9ae1c24cb67f18aaf2c7faa0aa (patch)
tree680021c17fe708529256c47e7446c6bf81949a2f
parent7c6915be8c34495502f6ee21e67fc7fd02a5203d (diff)
downloadcoinos-server-ad6bbbd558781b9ae1c24cb67f18aaf2c7faa0aa.tar.gz
coinos-server-ad6bbbd558781b9ae1c24cb67f18aaf2c7faa0aa.zip
info endpoint
-rw-r--r--index.js3
-rw-r--r--routes/payments.js4
2 files changed, 6 insertions, 1 deletions
diff --git a/index.js b/index.js
index f3d1aa13..48246f42 100644
--- a/index.js
+++ b/index.js
@@ -4,7 +4,7 @@ import { auth, optional } from "$lib/auth";
import { fillPool } from "$lib/nostr";
import { listenForLightning } from "$lib/lightning";
import { getLocations } from "$lib/locations";
- import { catchUp } from "$lib/payments";
+import { catchUp } from "$lib/payments";
import { getRates } from "$lib/rates";
import { sendHeartbeat } from "$lib/sockets";
import { err } from "$lib/logging";
@@ -53,6 +53,7 @@ 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);
app.get("/payments", auth, payments.list);
app.get("/payments/:hash", auth, payments.get);
diff --git a/routes/payments.js b/routes/payments.js
index ae58c14a..768307c0 100644
--- a/routes/payments.js
+++ b/routes/payments.js
@@ -22,6 +22,10 @@ import bc from "$lib/bitcoin";
import ln from "$lib/ln";
export default {
+ async info({ body, user }, res) {
+ res.send(await ln.getinfo());
+ },
+
async create({ body, user }, res) {
let { amount, hash, maxfee, fund, memo, payreq, rate, username } = body;