Compare commits

..
5 Commits
+19 -10
View File
@@ -932,6 +932,7 @@ class Utils {
*/
// Reimplementation of decodeOpReturn() using slp-parser.
async decodeOpReturn (txid, cache = null, usrObj = null) {
console.log(`Entering decodeOpReturn with txid ${txid}.`)
// The cache object is an in-memory cache (JS Object) that can be passed
// into this function. It helps if multiple vouts from the same TXID are
// being evaluated. In that case, it can significantly reduce the number
@@ -956,6 +957,8 @@ class Utils {
throw new Error('txid string must be included.')
}
console.log(`axiosOptions: ${JSON.stringify(_this.axiosOptions, null, 2)}`)
// CT: 2/24/21 Deprected GET in favor of POST, to pass IP address.
// Retrieve the transaction object from the full node.
const path = `${this.restURL}rawtransactions/getRawTransaction`
@@ -1013,18 +1016,20 @@ class Utils {
if (cache) cache[txid] = tokenData
console.log('Exiting decodeOpReturn()')
return tokenData
} catch (error) {
// Used for debugging
// console.log('decodeOpReturn error: ', error)
// console.log(`decodeOpReturn error.message: ${error.message}`)
// if (error.response && error.response.data) {
// console.log(
// `decodeOpReturn error.response.data: ${JSON.stringify(
// error.response.data
// )}`
// )
// }
console.log('decodeOpReturn error: ', error)
console.log(`decodeOpReturn error.message: ${error.message}`)
if (error.response && error.response.data) {
console.log(
`decodeOpReturn error.response.data: ${JSON.stringify(
error.response.data
)}`
)
}
throw error
}
}
@@ -1157,7 +1162,7 @@ class Utils {
}
}
console.log('Existing tokenUtxoDetails()')
console.log('Exiting tokenUtxoDetails()')
return outAry
} catch (error) {
@@ -1839,6 +1844,10 @@ class Utils {
// Throw error if input is not an array.
if (!Array.isArray(utxos)) throw new Error('Input must be an array.')
console.log(
`axiosOptions: ${JSON.stringify(_this.axiosOptions, null, 2)}`
)
const response = await _this.axios.post(
`${this.restURL}slp/hydrateUtxos`,
{