diff options
Diffstat (limited to 'routes/bitcoin')
| -rw-r--r-- | routes/bitcoin/fee.js | 7 | ||||
| -rw-r--r-- | routes/bitcoin/send.js | 5 |
2 files changed, 11 insertions, 1 deletions
diff --git a/routes/bitcoin/fee.js b/routes/bitcoin/fee.js index af622ca5..fb67c08e 100644 --- a/routes/bitcoin/fee.js +++ b/routes/bitcoin/fee.js @@ -1,5 +1,10 @@ +import config from "$config"; +import db from "$db"; +import bc from "$lib/bitcoin"; +import { err } from "$lib/logging"; import { emit } from "$lib/sockets"; import buildTx from "$lib/buildtx"; +import { SATS } from "$lib/utils"; export default async (req, res) => { let { user } = req; @@ -57,7 +62,7 @@ export default async (req, res) => { await bc.walletPassphrase(config.bitcoin.walletpass, 300); let signed = await bc.signRawTransactionWithWallet(tx.hex); - decoded = await bc.decodeRawTransaction(signed.hex); + let decoded = await bc.decodeRawTransaction(signed.hex); feeRate = Math.round((tx.fee * SATS * 1000) / decoded.vsize); res.send({ feeRate, tx }); diff --git a/routes/bitcoin/send.js b/routes/bitcoin/send.js index 51d702fd..bde3ce00 100644 --- a/routes/bitcoin/send.js +++ b/routes/bitcoin/send.js @@ -1,6 +1,11 @@ +import bc from "$lib/bitcoin"; +import { emit } from "$lib/sockets"; +import db from "$db"; import { toSats } from "$lib/utils"; import store from "$lib/store"; import config from "$config"; +import { l, warn, err } from "$lib/logging"; + const btc = config.liquid.btcasset; import { computeConversionFee, |
