fix(hydrateUtxos): Adjusting input to match output of Electrumx.utxo()

This commit is contained in:
Chris Troutner
2020-09-27 17:26:34 -07:00
parent 198141b75a
commit 0a14ca08a4
3 changed files with 131 additions and 88 deletions
+12 -4
View File
@@ -1567,12 +1567,20 @@ class Slp {
})
}
// Get Token Utxo Details
const details = await _this.bchjs.SLP.Utils.tokenUtxoDetails(utxos)
// console.log('details : ', details)
// Loop through each address and query the UTXOs for that element.
for (let i = 0; i < utxos.length; i++) {
const theseUtxos = utxos[i].utxos
// Get SLP token details.
const details = await _this.bchjs.SLP.Utils.tokenUtxoDetails(theseUtxos)
// console.log('details : ', details)
// Replace the original UTXO data with the hydrated data.
utxos[i].utxos = details
}
res.status(200)
return res.json({ slpUtxos: details })
return res.json({ slpUtxos: utxos })
} catch (err) {
wlogger.error('Error in slp.js/hydrateUtxos().', err)