feat: add tx hash retrieval in wallet plugin
This commit is contained in:
parent
3b01820242
commit
708dea736d
7 changed files with 56 additions and 6 deletions
|
|
@ -191,6 +191,13 @@ function checkBlockchainStatus (cryptoCode) {
|
|||
.then(res => !!res['initialblockdownload'] ? 'syncing' : 'ready')
|
||||
}
|
||||
|
||||
function getTxHashesByAddress (cryptoCode, address) {
|
||||
checkCryptoCode(cryptoCode)
|
||||
.then(() => fetch('listreceivedbyaddress', [0, true, true, address]))
|
||||
.then(txsByAddress => Promise.all(_.forEach(id => fetch('getrawtransaction', [id]), _.head(txsByAddress).txids)))
|
||||
.then(_.map(({ hash }) => hash))
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
balance,
|
||||
sendCoins,
|
||||
|
|
@ -202,5 +209,6 @@ module.exports = {
|
|||
estimateFee,
|
||||
sendCoinsBatch,
|
||||
checkBlockchainStatus,
|
||||
getTxHashesByAddress,
|
||||
SUPPORTS_BATCHING
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue