Merge pull request #1680 from RafaelTaranto/feat/scorechain

[LAM-1093] feat: scorechain address analysis
This commit is contained in:
Rafael Taranto 2024-06-04 16:30:11 +01:00 committed by GitHub
commit d109feb5a8
17 changed files with 173 additions and 309 deletions

View file

@ -5,12 +5,12 @@ import bitgo from './bitgo'
import bitstamp from './bitstamp'
import blockcypher from './blockcypher'
import cex from './cex'
import ciphertrace from './ciphertrace'
import galoy from './galoy'
import infura from './infura'
import itbit from './itbit'
import kraken from './kraken'
import mailgun from './mailgun'
import scorechain from './scorechain'
import telnyx from './telnyx'
import trongrid from './trongrid'
import twilio from './twilio'
@ -30,7 +30,7 @@ export default {
[twilio.code]: twilio,
[binanceus.code]: binanceus,
[cex.code]: cex,
[ciphertrace.code]: ciphertrace,
[scorechain.code]: scorechain,
[trongrid.code]: trongrid,
[binance.code]: binance,
[bitfinex.code]: bitfinex

View file

@ -7,13 +7,13 @@ import SecretInputFormik from 'src/components/inputs/formik/SecretInput'
import { secretTest, leadingZerosTest } from './helper'
export default {
code: 'ciphertrace',
name: 'CipherTrace',
title: 'CipherTrace (Scoring)',
code: 'scorechain',
name: 'Scorechain',
title: 'Scorechain (Scoring)',
elements: [
{
code: 'authorizationValue',
display: 'Authorization value',
code: 'apiKey',
display: 'API Key',
component: SecretInputFormik
},
{
@ -29,8 +29,7 @@ export default {
settings: {
enabled: true,
disabledMessage: 'This plugin is disabled',
label:
'Enabled (Supported coins: BTC, ETH, BCH, LTC and all active ERC-20 tokens)',
label: 'Enabled',
requirement: null,
rightSideLabel: true
},
@ -39,13 +38,13 @@ export default {
],
getValidationSchema: account => {
return Yup.object().shape({
authorizationValue: Yup.string('The authorization value must be a string')
apiKey: Yup.string('The API key must be a string')
.max(100, 'Too long')
.test(secretTest(account?.authorizationValue, 'authorization value')),
.test(secretTest(account?.apiKey, 'API key')),
scoreThreshold: Yup.number('The score threshold must be a number')
.required('A score threshold is required')
.min(1, 'The score threshold must be between 1 and 10')
.max(10, 'The score threshold must be between 1 and 10')
.min(1, 'The score threshold must be between 1 and 100')
.max(100, 'The score threshold must be between 1 and 100')
.integer('The score threshold must be an integer')
.test(
'no-leading-zeros',

View file

@ -183,9 +183,9 @@ const DetailsRow = ({ it: tx, timezone }) => {
FileSaver.saveAs(content, zipFilename)
}
const hasCiphertraceError = tx =>
const hasChainAnalysisError = tx =>
!R.isNil(tx.errorCode) &&
R.includes(tx.errorCode, ['scoreThresholdReached', 'ciphertraceError'])
R.includes(tx.errorCode, ['scoreThresholdReached', 'walletScoringError'])
const errorElements = (
<>
@ -205,10 +205,10 @@ const DetailsRow = ({ it: tx, timezone }) => {
r={3.5}
fill={
it < tx.walletScore
? !hasCiphertraceError(tx)
? !hasChainAnalysisError(tx)
? primaryColor
: errorColor
: !hasCiphertraceError(tx)
: !hasChainAnalysisError(tx)
? subheaderColor
: offErrorColor
}
@ -221,7 +221,7 @@ const DetailsRow = ({ it: tx, timezone }) => {
noMargin
className={classNames({
[classes.bold]: true,
[classes.error]: hasCiphertraceError(tx)
[classes.error]: hasChainAnalysisError(tx)
})}>
{tx.walletScore}
</P>
@ -359,7 +359,7 @@ const DetailsRow = ({ it: tx, timezone }) => {
<Label>Address</Label>
{!R.isNil(tx.walletScore) && (
<HoverableTooltip parentElements={walletScoreEl}>
{`CipherTrace score: ${tx.walletScore}/10`}
{`Chain analysis score: ${tx.walletScore}/10`}
</HoverableTooltip>
)}
</div>