From 5f949a00ab98792db22bb5ab0104a06c714932f2 Mon Sep 17 00:00:00 2001 From: Gyulai Zoltan Date: Tue, 28 Sep 2021 16:51:35 +0300 Subject: feat: added liquid withdrawal --- lib/feeliquidtx.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 lib/feeliquidtx.js (limited to 'lib') diff --git a/lib/feeliquidtx.js b/lib/feeliquidtx.js new file mode 100644 index 00000000..d32623ab --- /dev/null +++ b/lib/feeliquidtx.js @@ -0,0 +1,13 @@ +module.exports = async (txid) => { + const tx = await lq.getRawTransaction(txid); + const transaction = await lq.decodeRawTransaction(tx); + let valueOut = 0; + + transaction.vout.forEach(o => { + if (o.scriptPubKey.type === 'fee') { + valueOut = o.value; + } + }); + + return toSats(valueOut); +} -- cgit v1.2.3