aboutsummaryrefslogtreecommitdiffstats
path: root/routes
diff options
context:
space:
mode:
Diffstat (limited to 'routes')
-rw-r--r--routes/liquid/receive.js5
-rw-r--r--routes/payments.js5
-rw-r--r--routes/users.js14
3 files changed, 5 insertions, 19 deletions
diff --git a/routes/liquid/receive.js b/routes/liquid/receive.js
index 05ecc21f..fa7ff7d4 100644
--- a/routes/liquid/receive.js
+++ b/routes/liquid/receive.js
@@ -4,8 +4,7 @@ const zmq = require("zeromq");
const { Op } = require("sequelize");
const { fromBase58 } = require("bip32");
const bitcoin = require("bitcoinjs-lib");
-const elements = require("elementsjs-lib");
-const { networks } = require("liquidjs-lib");
+const { Block, networks } = require("@asoltys/liquidjs-lib");
const network =
networks[
@@ -192,7 +191,7 @@ zmqRawBlock.on("message", async (topic, message, sequence) => {
where: { confirmed: 0 }
});
- const block = elements.Block.fromHex(message.toString("hex"), true);
+ const block = Block.fromHex(message.toString("hex"), true);
let hash, json;
diff --git a/routes/payments.js b/routes/payments.js
index e8e94d8a..005223af 100644
--- a/routes/payments.js
+++ b/routes/payments.js
@@ -1,5 +1,4 @@
-const BitcoinCore = require("bitcoin-core");
-const lnd = require("../lib/lnd");
+const BitcoinCore = require("@asoltys/bitcoin-core");
const { Op } = require("sequelize");
const { join } = require("path");
const fs = require("fs");
@@ -93,7 +92,7 @@ ah(async () => {
const lnapath = join(require("os").homedir(), ".lightningreg/regtest");
lna = require("clightning-client")(lnapath);
} else {
- lna = lnd(config.lna);
+ throw new Error("lnd not supported");
}
app.post("/lightning/channel", require("./lightning/channel"));
diff --git a/routes/users.js b/routes/users.js
index 09ba5d43..71f4b89a 100644
--- a/routes/users.js
+++ b/routes/users.js
@@ -2,11 +2,10 @@ const axios = require("axios");
const bcrypt = require("bcrypt");
const jwt = require("jsonwebtoken");
const authenticator = require("otplib").authenticator;
-const randomWord = require("random-words");
const getAccount = require("../lib/account");
const Sequelize = require("sequelize");
const bitcoin = require("bitcoinjs-lib");
-const liquid = require("liquidjs-lib");
+const liquid = require("@asoltys/liquidjs-lib");
const { fromBase58, fromPrivateKey } = require("bip32");
const { Mutex } = require("async-mutex");
const bip32 = require("bip32");
@@ -46,17 +45,6 @@ app.get(
})
);
-app.get(
- "/challenge",
- ah(async (req, res) => {
- const ip = req.headers["x-forwarded-for"] || req.connection.remoteAddress;
- challenge[ip] = randomWord();
- l.info("setting up challenge", ip, challenge[ip]);
- const data = await textToImage.generate(challenge[ip]);
- res.send(data);
- })
-);
-
app.post(
"/register",
ah(async (req, res) => {