From 01e85e75fa5c7de4b730d7dc440652a295703dba Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 30 Apr 2021 18:06:46 -0400 Subject: estimate fee during send if no tx provided --- routes/liquid/send.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'routes/liquid/send.js') diff --git a/routes/liquid/send.js b/routes/liquid/send.js index ab28471e..a3bb7639 100644 --- a/routes/liquid/send.js +++ b/routes/liquid/send.js @@ -147,7 +147,12 @@ sendLiquid = async ({ user, address, memo, tx, limit }) => { module.exports = ah(async (req, res) => { let { user } = req; - let { address, memo, tx } = req.body; + let { address, feeRate, memo, tx } = req.body; + + if (!tx) { + ({ tx } = await liquidTx({ ...req.body, user })); + } + try { res.send(await sendLiquid({ user, address, memo, tx })); } catch (e) { -- cgit v1.2.3