diff options
| author | Adam Soltys <[email protected]> | 2022-09-08 16:45:32 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2022-09-08 16:45:32 -0700 |
| commit | 529cdff2a9df43a156a34072fd71f406cb7186f2 (patch) | |
| tree | b627342bc043083abb451f2908155983bb164ad7 /routes/liquid/send.js | |
| parent | be27adba90c2c52ccbfac5885d70e5b37753fc58 (diff) | |
| download | coinos-server-529cdff2a9df43a156a34072fd71f406cb7186f2.tar.gz coinos-server-529cdff2a9df43a156a34072fd71f406cb7186f2.zip | |
missing imports
Diffstat (limited to 'routes/liquid/send.js')
| -rw-r--r-- | routes/liquid/send.js | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/routes/liquid/send.js b/routes/liquid/send.js index 8c94d976..2fa7a22a 100644 --- a/routes/liquid/send.js +++ b/routes/liquid/send.js @@ -5,8 +5,8 @@ import { emit } from "$lib/sockets"; import store from "$lib/store"; import config from "$config"; import { l, warn, err } from "$lib/logging"; -// import { liquidTx } from "$routes/liquid/fee"; -// import { Transaction } from 'liquidjs-lib'; +import { liquidTx } from "$routes/liquid/fee"; +import { Transaction } from 'liquidjs-lib'; import { computeConversionFee, @@ -229,7 +229,7 @@ export const sendLiquid = async ({ asset, amount, user, address, memo, tx, limit let txid = Transaction.fromHex(signed.hex).getId(); for (let i = 0; i < payments.length; i++) { - p = payments[i]; + let p = payments[i]; if (p) { let { account } = p; p.hash = txid; @@ -255,6 +255,7 @@ export const sendLiquid = async ({ asset, amount, user, address, memo, tx, limit return main; } catch (e) { err("problem sending liquid", e.message); + return e; } }; @@ -262,8 +263,11 @@ export default async (req, res) => { let { user } = req; try { - res.send(await sendLiquid({ ...req.body, user })); + let result = await sendLiquid({ ...req.body, user }) + if (result instanceof Error) throw result; + res.send(result); } catch (e) { + console.log(e) err("problem sending liquid", user.username, e.message); return res.code(500).send(e); } |
