mirror of
https://github.com/fullstack-cash/bch-api.git
synced 2026-09-21 16:52:04 -07:00
Add tx input details to slp/txDetails endpoint
This commit is contained in:
+18
-1
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user