diff options
| author | Adam Soltys <[email protected]> | 2020-08-11 09:18:26 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2020-08-11 09:18:26 -0700 |
| commit | 3980fec05509a060ac41f98b4dd126a13e4bc9cd (patch) | |
| tree | eacb00d0f3cc42a5216baa654b8e23b96a2e64d3 /routes/bitcoin/fee.js | |
| parent | f89b0ffde25292909bd398430e84e6c693084582 (diff) | |
| download | coinos-server-3980fec05509a060ac41f98b4dd126a13e4bc9cd.tar.gz coinos-server-3980fec05509a060ac41f98b4dd126a13e4bc9cd.zip | |
non-custodial sends
Diffstat (limited to 'routes/bitcoin/fee.js')
| -rw-r--r-- | routes/bitcoin/fee.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/routes/bitcoin/fee.js b/routes/bitcoin/fee.js index cd99d363..3249004c 100644 --- a/routes/bitcoin/fee.js +++ b/routes/bitcoin/fee.js @@ -1,4 +1,4 @@ -const buildTx = ({ address, amount, feeRate }) => {}; +const buildTx = require("../../lib/buildtx"); module.exports = ah(async (req, res) => { let { user } = req; @@ -6,8 +6,12 @@ module.exports = ah(async (req, res) => { let tx, fee; if (user.account.pubkey) { - tx = buildTx(req.body); - return res.end(); + try { + let psbt = await buildTx({ address, amount, feeRate, user }); + return res.send(psbt); + } catch(e) { + return res.status(500).send(e.message); + } } let invoice = await db.Invoice.findOne({ |
