feat: add tx hash retrieval in wallet plugin

This commit is contained in:
José Oliveira 2022-07-19 20:14:40 +01:00
parent 3b01820242
commit 708dea736d
7 changed files with 56 additions and 6 deletions

View file

@ -235,6 +235,14 @@ function checkBlockchainStatus (cryptoCode) {
})
}
function getTxHashesByAddress (cryptoCode, address) {
checkCryptoCode(cryptoCode)
.then(() => refreshWallet())
.then(() => fetch('get_address_index', { address: address }))
.then(addressRes => fetch('get_transfers', { in: true, pool: true, pending: true, account_index: addressRes.index.major, address_indices: [addressRes.index.minor] }))
.then(_.map(({ txid }) => txid))
}
module.exports = {
balance,
sendCoins,
@ -242,5 +250,6 @@ module.exports = {
getStatus,
newFunding,
cryptoNetwork,
checkBlockchainStatus
checkBlockchainStatus,
getTxHashesByAddress
}