Feat: compliance blacklisted addresses notifications

This commit is contained in:
Cesar 2020-12-15 18:55:45 +00:00 committed by Josh Harvey
parent 1ec56cd1ab
commit 705747e9e0
7 changed files with 48 additions and 14 deletions

View file

@ -512,6 +512,20 @@ const errorAlertsNotify = (alertRec) => {
}, alerts)
}
const addBlacklistNotification = (tx, isAddressReuse) => {
let detail = ''
let message = ''
if(isAddressReuse) {
detail = `${tx.cryptoCode}_REUSED_${tx.toAddress}`
message = `Blocked address reuse: ${tx.cryptoCode} ${tx.toAddress.substr(0,10)}...`
} else {
detail = `${tx.cryptoCode}_BLOCKED_${tx.toAddress}`
message = `Blocked blacklisted address: ${tx.cryptoCode} ${tx.toAddress.substr(0,10)}...`
}
queries.addComplianceNotification(tx.deviceId, detail, message)
}
module.exports = {
transactionNotify,
checkNotification,