diff --git a/lib/plugins/wallet-scoring/elliptic/elliptic.js b/lib/plugins/wallet-scoring/elliptic/elliptic.js index 3bc3e3ff..ca17c11e 100644 --- a/lib/plugins/wallet-scoring/elliptic/elliptic.js +++ b/lib/plugins/wallet-scoring/elliptic/elliptic.js @@ -15,13 +15,11 @@ const HOLLISTIC_COINS = { const SINGLE_ASSET_COINS = { ZEC: { asset: 'ZEC', - // TODO needs api to fetch blockchain name blockchain: 'zcash' }, BCH: { asset: 'BCH', - // TODO needs api to fetch blockchain name - blockchain: 'bitcoincash' + blockchain: 'bitcoin_cash' } } @@ -47,7 +45,7 @@ function rate (account, objectType, cryptoCode, objectId) { subject: { asset: isHolistic ? 'holistic' : SINGLE_ASSET_COINS[cryptoCode].asset, blockchain: isHolistic ? 'holistic' : SINGLE_ASSET_COINS[cryptoCode].blockchain, - type: TYPE[objectType], + type: objectType, hash: objectId }, type: objectType === TYPE.ADDRESS ? 'wallet_exposure' : 'source_of_funds' @@ -61,9 +59,10 @@ function rate (account, objectType, cryptoCode, objectId) { .then((res) => { const resScore = res.data?.risk_score + // elliptic returns 0-1 score, but we're accepting 0-100 config // normalize score to 0-10 where 0 is the lowest risk // elliptic score can be null and contains decimals - return {score: Math.trunc((resScore || 0) / 10), isValid: (resScore || 0) < threshold} + return {score: (resScore || 0) * 10, isValid: ((resScore || 0) * 100) < threshold} }) }) }