diff --git a/lib/plugins/wallet/dashd/dashd.js b/lib/plugins/wallet/dashd/dashd.js index 57a58ae3..9b84a6a0 100644 --- a/lib/plugins/wallet/dashd/dashd.js +++ b/lib/plugins/wallet/dashd/dashd.js @@ -126,7 +126,10 @@ function checkBlockchainStatus (cryptoCode) { } function getTxHashesByAddress (cryptoCode, address) { - throw new Error(`Transactions hash retrieval is not implemented for this coin!`) + checkCryptoCode(cryptoCode) + .then(() => fetch('listreceivedbyaddress', [0, true, true, true, address])) + .then(txsByAddress => Promise.all(_.forEach(id => fetch('getrawtransaction', [id]), _.head(txsByAddress).txids))) + .then(_.map(({ hash }) => hash)) } module.exports = { diff --git a/lib/plugins/wallet/monerod/monerod.js b/lib/plugins/wallet/monerod/monerod.js index 50e45ba1..1ed93bf8 100644 --- a/lib/plugins/wallet/monerod/monerod.js +++ b/lib/plugins/wallet/monerod/monerod.js @@ -236,7 +236,11 @@ function checkBlockchainStatus (cryptoCode) { } function getTxHashesByAddress (cryptoCode, address) { - throw new Error(`Transactions hash retrieval is not implemented for this coin!`) + 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 = { diff --git a/lib/plugins/wallet/zcashd/zcashd.js b/lib/plugins/wallet/zcashd/zcashd.js index 057cd4a2..d9d7f867 100644 --- a/lib/plugins/wallet/zcashd/zcashd.js +++ b/lib/plugins/wallet/zcashd/zcashd.js @@ -152,7 +152,9 @@ function checkBlockchainStatus (cryptoCode) { } function getTxHashesByAddress (cryptoCode, address) { - throw new Error(`Transactions hash retrieval is not implemented for this coin!`) + checkCryptoCode(cryptoCode) + .then(() => fetch('getaddresstxids', [address])) + .then(_.mapKeys(() => 'txid')) } module.exports = {