aboutsummaryrefslogtreecommitdiffstats
path: root/payments.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2019-09-15 23:05:26 -0700
committerAdam Soltys <[email protected]>2019-09-15 23:05:26 -0700
commit765c6a42135b9334b616c26b22c816edd06e382a (patch)
tree05da4f343358fb5e9a9083e348783f0fab973dd8 /payments.js
parent087fdd27f3683a1deb9376b7a72aa608e6fd8e6a (diff)
downloadcoinos-server-765c6a42135b9334b616c26b22c816edd06e382a.tar.gz
coinos-server-765c6a42135b9334b616c26b22c816edd06e382a.zip
refactor
Diffstat (limited to 'payments.js')
-rw-r--r--payments.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/payments.js b/payments.js
new file mode 100644
index 00000000..d2e89b44
--- /dev/null
+++ b/payments.js
@@ -0,0 +1,19 @@
+const createLnrpc = require("./lib/createLnrpc");
+const config = require("./config");
+
+module.exports = async (app, auth, addresses, bc, db, emit, seen, payments) => {
+ const lna = await createLnrpc(config.lna);
+ const lnb = await createLnrpc(config.lnb);
+
+ require("./bitcoinPayments")(app, bc, db, addresses, payments, emit);
+ require("./lightningPayments")(app, db, lna, lnb, emit, payments);
+
+ app.post(
+ "/sendPayment",
+ auth,
+ require("./sendPayment")(app, db, emit, seen, lna, lnb)
+ );
+ app.post("/payUser", auth, require("./payUser")(db, lnb));
+ app.post("/sendCoins", auth, require("./sendCoins")(app, bc, db, emit));
+ app.post("/addInvoice", auth, require("./addInvoice")(app, db, lnb));
+};