aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorGyulai Zoltan <[email protected]>2021-09-28 16:51:35 +0300
committerGyulai Zoltan <[email protected]>2021-09-28 16:51:35 +0300
commit5f949a00ab98792db22bb5ab0104a06c714932f2 (patch)
treeea936c9499192758d521f8f61b0d85f8844cbafa /lib
parented3482fc15d3d8f8e8b3bceff7d473fd29601280 (diff)
downloadcoinos-server-5f949a00ab98792db22bb5ab0104a06c714932f2.tar.gz
coinos-server-5f949a00ab98792db22bb5ab0104a06c714932f2.zip
feat: added liquid withdrawal
Diffstat (limited to 'lib')
-rw-r--r--lib/feeliquidtx.js13
1 files changed, 13 insertions, 0 deletions
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);
+}