Skip to content

Instantly share code, notes, and snippets.

@jdh7190
jdh7190 / unlock.js
Created September 10, 2023 11:14
Unlock from hodlocker
const getUTXO = (rawtx, idx) => {
const bsvtx = new bsv.Transaction(rawtx);
return {
satoshis: bsvtx.outputs[idx].satoshis,
vout: idx,
txid: bsvtx.hash,
script: bsvtx.outputs[idx].script.toHex()
}
}
const getRawtx = async txid => {