Add tx input details to slp/txDetails endpoint

This commit is contained in:
josephroyking
2020-11-25 10:56:10 -08:00
parent e881b68ca5
commit cbcf5c1d2b
+18 -1
View File
@@ -1437,12 +1437,29 @@ class Slp {
sendOutputs.push(string.toString())
})
// Because you are not using insight, you do not get the sending addresses from an indexer
// or from the node
// However, they are available from the SLPDB output
const tokenInputs = transaction.in
// Collect the input addresses
const sendInputs = []
for (let i = 0; i < tokenInputs.length; i += 1) {
const tokenInput = tokenInputs[i]
const sendInput = {}
sendInput.address = tokenInput.e.a
sendInputs.push(sendInput)
}
const obj = {
tokenInfo: {
versionType: transaction.slp.detail.versionType,
tokenName: transaction.slp.detail.name,
tokenTicker: transaction.slp.detail.symbol,
transactionType: transaction.slp.detail.transactionType,
tokenIdHex: transaction.slp.detail.tokenIdHex,
sendOutputs: sendOutputs
sendOutputs: sendOutputs,
sendInputsFull: sendInputs,
sendOutputsFull: transaction.slp.detail.outputs,
},
tokenIsValid: transaction.slp.valid
}