diff options
| author | Adam Soltys <[email protected]> | 2024-11-21 21:17:20 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2024-11-21 21:17:20 -0800 |
| commit | f0ef70adc613c85f58ccc679f3a4d2d3b2d09e71 (patch) | |
| tree | 164b05a6cc64fbff87ade03684bf3b369623bb18 /routes | |
| parent | ff4d63f395a556543e9a642676f92dea5d1c1645 (diff) | |
| download | coinos-server-f0ef70adc613c85f58ccc679f3a4d2d3b2d09e71.tar.gz coinos-server-f0ef70adc613c85f58ccc679f3a4d2d3b2d09e71.zip | |
migrate to new cashu-ts
Diffstat (limited to 'routes')
| -rw-r--r-- | routes/ecash.ts | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/routes/ecash.ts b/routes/ecash.ts index 101d1aca..35d9f950 100644 --- a/routes/ecash.ts +++ b/routes/ecash.ts @@ -7,15 +7,14 @@ import { bail, fail } from "$lib/utils"; import { v4 } from "uuid"; const { ecash: type } = types; +Error.stackTraceLimit = 100; // Set this to the desired limit + const sendCash = async ({ amount, user }) => { - console.log("HELLO", amount); const id = v4(); const hash = v4(); const p = await debit({ hash, amount, user, type }); - console.log("P", p); - const token = await mint(amount); - console.log("TOKEN", token); + const token = await mint(parseInt(amount)); p.memo = id; await s(`payment:${p.id}`, p); s(`cash:${id}`, token); @@ -83,18 +82,9 @@ export default { }, async mint(req, res) { - const { - body: { amount }, - user, - } = req; - try { - console.log("OY"); - res.send(await sendCash({ amount, user })); - } catch (e) { - console.log(e); - err(e.message); - bail(res, e.message); - } + const { body, user } = req; + const amount = parseInt(body.amount); + res.send(await sendCash({ amount, user })); }, async melt(req, res) { |
