aboutsummaryrefslogtreecommitdiffstats
path: root/lib/feeliquidtx.js
blob: d32623abab228f77d3aea70f189e693fa4607c0e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
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);
}