diff options
| author | Adam Soltys <[email protected]> | 2020-01-26 20:22:47 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2020-01-26 20:22:47 -0800 |
| commit | c7a01f30d468405857d231e3e9dcf489d465ccf0 (patch) | |
| tree | c1af32492a1e207f054abe27daf9e68dedb8208c /users.js | |
| parent | 9c2a909dc707c3f2baad8f86cbeea54606dbea41 (diff) | |
| download | coinos-server-c7a01f30d468405857d231e3e9dcf489d465ccf0.tar.gz coinos-server-c7a01f30d468405857d231e3e9dcf489d465ccf0.zip | |
liquid support
Diffstat (limited to 'users.js')
| -rw-r--r-- | users.js | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -15,6 +15,21 @@ const liquid = new BitcoinCore(config.liquid); const pick = (O, ...K) => K.reduce((o, k) => ((o[k] = O[k]), o), {}); module.exports = (addresses, auth, app, bc, db, emit) => { + app.get("/liquidate", async (req, res) => { + let users = await db.User.findAll(); + for (let i = 0; i < users.length; i++) { + let user = users[i]; + console.log("meow"); + if (!user.confidential) { + user.confidential = await liquid.getNewAddress(); + user.liquid = (await liquid.getAddressInfo(user.confidential)).unconfidential; + await user.save(); + } + }; + res.end(); + }); + + app.post("/register", async (req, res) => { let err = m => res.status(500).send(m); let user = req.body; |
