aboutsummaryrefslogtreecommitdiffstats
path: root/routes/info.js
diff options
context:
space:
mode:
Diffstat (limited to 'routes/info.js')
-rw-r--r--routes/info.js32
1 files changed, 0 insertions, 32 deletions
diff --git a/routes/info.js b/routes/info.js
deleted file mode 100644
index f2e262f6..00000000
--- a/routes/info.js
+++ /dev/null
@@ -1,32 +0,0 @@
-import { archive } from "$lib/db";
-import db from "$lib/db";
-import ln from "$lib/ln";
-
-export default {
- async balances(req, res) {
- let lnchannel;
- let lnwallet;
-
- let total = 0;
-
- for await (let k of db.scanIterator({ MATCH: "balance:*" })) {
- total += parseInt(await db.get(k));
- }
-
- for await (let k of archive.scanIterator({ MATCH: "balance:*" })) {
- total += parseInt(await archive.get(k));
- }
-
- const funds = await ln.listfunds();
- lnchannel = parseInt(funds.channels.reduce((a, b) => a + b.channel_sat, 0));
- lnwallet = parseInt(funds.outputs.reduce((a, b) => a + b.value, 0));
-
- const info = {
- lnchannel,
- lnwallet,
- total,
- };
-
- res.send(info);
- },
-};