diff options
| author | Adam Soltys <[email protected]> | 2025-04-07 13:13:36 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2025-04-07 13:13:47 -0700 |
| commit | fb5ae5bb2e3471df9471cb334e0c31fc6c9dcfcb (patch) | |
| tree | 3993c5008a6b09af34346d47503510a47e5d2fe4 | |
| parent | 425e712177de6f2d47e7d0486a347f0cbf4e0d0d (diff) | |
| download | coinos-server-fb5ae5bb2e3471df9471cb334e0c31fc6c9dcfcb.tar.gz coinos-server-fb5ae5bb2e3471df9471cb334e0c31fc6c9dcfcb.zip | |
credits
| -rw-r--r-- | index.ts | 1 | ||||
| -rw-r--r-- | routes/users.ts | 8 |
2 files changed, 9 insertions, 0 deletions
@@ -103,6 +103,7 @@ app.post("/account/delete", auth, users.deleteAccount); app.get("/users", auth, users.list); app.get("/me", auth, users.me); +app.get("/credits", auth, users.credits); app.get("/users/:key", users.get); app.post("/register", users.create); app.post("/disable2fa", auth, users.disable2fa); diff --git a/routes/users.ts b/routes/users.ts index e26083e3..e12202d8 100644 --- a/routes/users.ts +++ b/routes/users.ts @@ -968,4 +968,12 @@ export default { await db.sRem(`${uid}:pins`, id); res.send({}); }, + + async credits(req, res) { + const { id } = req.user; + const bitcoin = await g(`credit:bitcoin:${id}`); + const lightning = await g(`credit:lightning:${id}`); + const liquid = await g(`credit:liquid:${id}`); + res.send({ bitcoin, lightning, liquid }); + }, }; |
