diff options
| author | Adam Soltys <[email protected]> | 2022-09-08 16:29:14 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2022-09-08 16:29:14 -0700 |
| commit | be27adba90c2c52ccbfac5885d70e5b37753fc58 (patch) | |
| tree | 3ea8a2e1700112782d3bd16517fff4a875d38756 /routes/bitcoin | |
| parent | d89458ebef267c7dc2290100ecb05b7d0891c224 (diff) | |
| parent | c60ad34877c44760263a9e93e99aa425ad0fdd99 (diff) | |
| download | coinos-server-be27adba90c2c52ccbfac5885d70e5b37753fc58.tar.gz coinos-server-be27adba90c2c52ccbfac5885d70e5b37753fc58.zip | |
Merge branch 'prod'
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, |
