aboutsummaryrefslogtreecommitdiffstats
path: root/payments.js
blob: 519cd1b456e1c37b07472783a36caebbef809661 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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")(app, db, lnb));
  app.post("/sendCoins", auth, require("./sendCoins")(app, bc, db, emit));
  app.post("/addInvoice", auth, require("./addInvoice")(app, db, lnb));
};