Skip to content

Commit f291711

Browse files
authored
Merge pull request #81 from travis-payne/returning-hash-and-status
Adding tx hash and status to sendTransactions return
2 parents 1cbefd1 + 10befff commit f291711

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/util.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,14 +117,17 @@ function sendTransactions (txs, txClient, timeoutLimit, requiredStatusesStr = [
117117
.then(res => {
118118
const status = res
119119
.map(r => reverseEnum(TxStatus)[r.tx.getTxStatus()])
120+
const hash = res
121+
.map(r => r.tx.getTxHash())
122+
120123

121124
return res.some(r => r.error)
122125
? reject(
123126
new Error(
124127
`Command response error: expected=${requiredStatusesStr}, actual=${status}`
125128
)
126129
)
127-
: resolve()
130+
: resolve({ txHash: hash, status: status })
128131
})
129132
})
130133
})

0 commit comments

Comments
 (0)