diff options
| author | Gyulai Zoltan <[email protected]> | 2021-09-28 16:51:35 +0300 |
|---|---|---|
| committer | Gyulai Zoltan <[email protected]> | 2021-09-28 16:51:35 +0300 |
| commit | 5f949a00ab98792db22bb5ab0104a06c714932f2 (patch) | |
| tree | ea936c9499192758d521f8f61b0d85f8844cbafa /lib | |
| parent | ed3482fc15d3d8f8e8b3bceff7d473fd29601280 (diff) | |
| download | coinos-server-5f949a00ab98792db22bb5ab0104a06c714932f2.tar.gz coinos-server-5f949a00ab98792db22bb5ab0104a06c714932f2.zip | |
feat: added liquid withdrawal
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/feeliquidtx.js | 13 |
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); +} |
