diff options
| author | Adam Soltys <[email protected]> | 2020-03-11 15:10:40 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2020-03-11 15:10:40 -0700 |
| commit | c0888fab024cc9f7c99812bfabf9d7774312dbf7 (patch) | |
| tree | cad95683af97432f6092a2c2bae10fbb7a588db5 /payments.js | |
| parent | bf2b51f0c2ae9b8f0f330dde6411e45fc0da8a25 (diff) | |
| download | coinos-server-c0888fab024cc9f7c99812bfabf9d7774312dbf7.tar.gz coinos-server-c0888fab024cc9f7c99812bfabf9d7774312dbf7.zip | |
refactor
Diffstat (limited to 'payments.js')
| -rw-r--r-- | payments.js | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/payments.js b/payments.js deleted file mode 100644 index c2d9d306..00000000 --- a/payments.js +++ /dev/null @@ -1,41 +0,0 @@ -const createLnrpc = require("./lib/createLnrpc"); -const config = require("./config"); -const lnd = require("./lnd"); - -module.exports = async (app, auth, addresses, bc, db, emit, seen, payments) => { - const lna = await createLnrpc(config.lna); - const lnb = await createLnrpc(config.lnb); - - const lnaraw = lnd(config.lna); - const lnbraw = lnd(config.lnb); - - require("./bitcoinPayments")(app, bc, db, addresses, payments, emit); - require("./liquidPayments")(app, db, addresses, payments, emit); - require("./lightningPayments")(app, db, lna, lnb, emit, payments); - - app.post( - "/queryRoutes", - auth, - require("./queryRoutes")(lnaraw) - ); - app.post( - "/sendPayment", - auth, - require("./sendPayment")(app, db, emit, seen, lnaraw, lnb) - ); - app.post("/payUser", auth, require("./payUser")(app, db, lna, lnb)); - app.post("/sendCoins", auth, require("./sendCoins")(addresses, app, bc, db, emit)); - app.post("/estimateBitcoinFee", auth, require("./estimateBitcoinFee")(app, bc, db, emit)); - app.post("/sendLiquid", auth, require("./sendLiquid")(addresses, app, db, emit)); - app.post("/estimateLiquidFee", auth, require("./estimateLiquidFee")(app, db, emit)); - app.post("/addInvoice", auth, require("./addInvoice")(app, db, lnb)); - app.get("/payments", auth, async (req, res) => { - const payments = await db.Payment.findAll({ - where: { user_id: req.user.id }, - order: [['id', 'DESC']], - }); - - emit(req.user.username, "payments", payments); - res.send(payments); - }); -}; |
