diff --git a/lib/plugins/wallet-scoring/ciphertrace/ciphertrace.js b/lib/plugins/wallet-scoring/ciphertrace/ciphertrace.js index 6fcf64d8..87a867ef 100644 --- a/lib/plugins/wallet-scoring/ciphertrace/ciphertrace.js +++ b/lib/plugins/wallet-scoring/ciphertrace/ciphertrace.js @@ -59,6 +59,10 @@ function getAddressTransactionsHashes (receivingAddress, cryptoCode, client, wal return axios.get(`https://rest.ciphertrace.com/api/${apiVersion}/${_.toLower(cryptoCode) !== 'btc' ? `${_.toLower(cryptoCode)}_` : ``}address/search?features=tx&address=${receivingAddress}&mempool=true`, { headers: authHeader }) + .then(_.flow( + _.get(['data', 'txHistory']), + _.map(_.get(['txHash'])) + )) .catch(err => { console.log(`** DEBUG ** getTransactionHash ERROR: ${err}`) console.log(`** DEBUG ** Fetching transactions hashes via wallet node...`) @@ -70,9 +74,7 @@ function getTransactionHash (account, cryptoCode, receivingAddress, wallet) { const client = getClient(account) if (!_.includes(_.toUpper(cryptoCode), SUPPORTED_COINS) || _.isNil(client)) return Promise.resolve(null) return getAddressTransactionsHashes(receivingAddress, cryptoCode, client, wallet) - .then(({ data: { txHistory } }) => { - const txHashes = _.map(_.get(['txHash']), txHistory) - + .then(txHashes => { if (_.size(txHashes) > 1) { logger.warn('An address generated by this wallet was used in more than one transaction') }