mirror of
https://github.com/LORDBABUINO/stealth.git
synced 2026-07-01 14:28:55 -07:00
feat: Remove unused frontend files
- Delete UtxoCard.jsx and UtxoCard.module.css (never imported) - Delete mockData.js (never imported)
This commit is contained in:
@@ -1,84 +0,0 @@
|
|||||||
import { useState } from 'react'
|
|
||||||
import VulnerabilityBadge from './VulnerabilityBadge'
|
|
||||||
import styles from './UtxoCard.module.css'
|
|
||||||
|
|
||||||
function truncateAddress(addr) {
|
|
||||||
if (!addr || addr.length <= 20) return addr
|
|
||||||
return `${addr.slice(0, 12)}…${addr.slice(-8)}`
|
|
||||||
}
|
|
||||||
|
|
||||||
function truncateTxid(txid) {
|
|
||||||
if (!txid || txid.length <= 24) return txid
|
|
||||||
return `${txid.slice(0, 16)}…${txid.slice(-8)}`
|
|
||||||
}
|
|
||||||
|
|
||||||
export default function UtxoCard({ utxo }) {
|
|
||||||
const [open, setOpen] = useState(false)
|
|
||||||
const isClean = utxo.vulnerabilities.length === 0
|
|
||||||
|
|
||||||
const highestSeverity = utxo.vulnerabilities.reduce((acc, v) => {
|
|
||||||
const order = { high: 3, medium: 2, low: 1 }
|
|
||||||
return (order[v.severity] ?? 0) > (order[acc] ?? 0) ? v.severity : acc
|
|
||||||
}, null)
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div
|
|
||||||
className={`${styles.card} ${isClean ? styles.clean : styles.hasVulnerabilities}`}
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
className={styles.header}
|
|
||||||
onClick={() => setOpen((o) => !o)}
|
|
||||||
role="button"
|
|
||||||
aria-expanded={open}
|
|
||||||
>
|
|
||||||
<div className={styles.headerLeft}>
|
|
||||||
<div className={styles.addressRow}>
|
|
||||||
<span className={styles.address} title={utxo.address}>
|
|
||||||
{truncateAddress(utxo.address)}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div className={styles.badges}>
|
|
||||||
{isClean ? (
|
|
||||||
<span className={styles.cleanLabel}>✓ Clean</span>
|
|
||||||
) : (
|
|
||||||
utxo.vulnerabilities.map((v, i) => (
|
|
||||||
<VulnerabilityBadge key={i} type={v.type} severity={v.severity} />
|
|
||||||
))
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className={styles.headerRight}>
|
|
||||||
<span className={styles.amount}>
|
|
||||||
{utxo.amountBtc.toFixed(8)} BTC
|
|
||||||
</span>
|
|
||||||
<span className={styles.confirmations}>
|
|
||||||
{utxo.confirmations.toLocaleString()} confs
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<span className={`${styles.chevron} ${open ? styles.open : ''}`}>▼</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className={`${styles.detail} ${open ? styles.open : ''}`}>
|
|
||||||
<span className={styles.txidLabel}>txid</span>
|
|
||||||
<div className={styles.txid}>
|
|
||||||
{utxo.txid}:{utxo.vout}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{!isClean && (
|
|
||||||
<div className={styles.vulnerabilityList}>
|
|
||||||
{utxo.vulnerabilities.map((v, i) => (
|
|
||||||
<div key={i} className={`${styles.vulnItem} ${styles[v.severity]}`}>
|
|
||||||
<div className={styles.vulnHeader}>
|
|
||||||
<VulnerabilityBadge type={v.type} severity={v.severity} />
|
|
||||||
</div>
|
|
||||||
<p className={styles.vulnDesc}>{v.description}</p>
|
|
||||||
</div>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
@@ -1,168 +0,0 @@
|
|||||||
.card {
|
|
||||||
background: var(--surface);
|
|
||||||
border: 1px solid var(--border);
|
|
||||||
border-radius: var(--radius-lg);
|
|
||||||
overflow: hidden;
|
|
||||||
transition: border-color var(--transition);
|
|
||||||
}
|
|
||||||
|
|
||||||
.card:hover {
|
|
||||||
border-color: var(--border-hover);
|
|
||||||
}
|
|
||||||
|
|
||||||
.card.hasVulnerabilities {
|
|
||||||
border-left: 3px solid var(--danger);
|
|
||||||
}
|
|
||||||
|
|
||||||
.card.clean {
|
|
||||||
border-left: 3px solid var(--accent);
|
|
||||||
}
|
|
||||||
|
|
||||||
.header {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
padding: 16px 20px;
|
|
||||||
cursor: pointer;
|
|
||||||
gap: 16px;
|
|
||||||
user-select: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.headerLeft {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 6px;
|
|
||||||
min-width: 0;
|
|
||||||
flex: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.addressRow {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.address {
|
|
||||||
font-family: var(--font-data);
|
|
||||||
font-size: 14px;
|
|
||||||
color: var(--text);
|
|
||||||
white-space: nowrap;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
}
|
|
||||||
|
|
||||||
.badges {
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
gap: 6px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.cleanLabel {
|
|
||||||
font-size: 11px;
|
|
||||||
font-weight: 600;
|
|
||||||
color: var(--accent);
|
|
||||||
letter-spacing: 0.05em;
|
|
||||||
text-transform: uppercase;
|
|
||||||
}
|
|
||||||
|
|
||||||
.headerRight {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: flex-end;
|
|
||||||
gap: 4px;
|
|
||||||
flex-shrink: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.amount {
|
|
||||||
font-family: var(--font-data);
|
|
||||||
font-size: 16px;
|
|
||||||
font-weight: 500;
|
|
||||||
color: var(--text);
|
|
||||||
}
|
|
||||||
|
|
||||||
.confirmations {
|
|
||||||
font-size: 12px;
|
|
||||||
color: var(--text-muted);
|
|
||||||
}
|
|
||||||
|
|
||||||
.chevron {
|
|
||||||
color: var(--text-muted);
|
|
||||||
font-size: 12px;
|
|
||||||
transition: transform var(--transition);
|
|
||||||
flex-shrink: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.chevron.open {
|
|
||||||
transform: rotate(180deg);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Detail panel */
|
|
||||||
.detail {
|
|
||||||
border-top: 1px solid var(--border);
|
|
||||||
padding: 0;
|
|
||||||
overflow: hidden;
|
|
||||||
max-height: 0;
|
|
||||||
transition: max-height 0.3s ease, padding 0.3s ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
.detail.open {
|
|
||||||
max-height: 600px;
|
|
||||||
padding: 16px 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.txid {
|
|
||||||
font-family: var(--font-data);
|
|
||||||
font-size: 12px;
|
|
||||||
color: var(--text-muted);
|
|
||||||
word-break: break-all;
|
|
||||||
margin-bottom: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.txidLabel {
|
|
||||||
font-size: 11px;
|
|
||||||
font-weight: 600;
|
|
||||||
text-transform: uppercase;
|
|
||||||
letter-spacing: 0.06em;
|
|
||||||
color: var(--text-dim);
|
|
||||||
display: block;
|
|
||||||
margin-bottom: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.vulnerabilityList {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.vulnItem {
|
|
||||||
border-radius: var(--radius);
|
|
||||||
padding: 14px 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.vulnItem.high {
|
|
||||||
background: var(--danger-dim);
|
|
||||||
border: 1px solid rgba(255, 77, 109, 0.2);
|
|
||||||
}
|
|
||||||
|
|
||||||
.vulnItem.medium {
|
|
||||||
background: var(--warning-dim);
|
|
||||||
border: 1px solid rgba(244, 162, 97, 0.2);
|
|
||||||
}
|
|
||||||
|
|
||||||
.vulnItem.low {
|
|
||||||
background: var(--safe-dim);
|
|
||||||
border: 1px solid rgba(46, 196, 182, 0.2);
|
|
||||||
}
|
|
||||||
|
|
||||||
.vulnHeader {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 10px;
|
|
||||||
margin-bottom: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.vulnDesc {
|
|
||||||
font-size: 13px;
|
|
||||||
color: var(--text-muted);
|
|
||||||
line-height: 1.6;
|
|
||||||
}
|
|
||||||
@@ -1,90 +0,0 @@
|
|||||||
export const mockReport = {
|
|
||||||
descriptor: 'wpkh([a1b2c3d4/84h/0h/0h]xpub6CatWdiZynkCminahu8Gmr7FAVnQXBTSMaBxn6qmBNkdm9tDkFzWmjmDrLBCQSTa7BHgpEjCXzMTCyDsQLSmcGYJHBB7cTwpqLNRKGP47uw/0/*)#qwer1234',
|
|
||||||
summary: {
|
|
||||||
total: 5,
|
|
||||||
clean: 1,
|
|
||||||
vulnerable: 4,
|
|
||||||
},
|
|
||||||
utxos: [
|
|
||||||
{
|
|
||||||
txid: '3a7f2b8c1d4e9f0a6b5c2d7e8f3a1b4c9d2e5f0a7b8c1d4e9f2a5b6c3d7e8f1',
|
|
||||||
vout: 0,
|
|
||||||
address: 'bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh',
|
|
||||||
amountBtc: 0.05234891,
|
|
||||||
confirmations: 1842,
|
|
||||||
vulnerabilities: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
txid: 'b4c8e2f6a1d5b9c3e7f1a5d9b3c7e1f5a9d3b7c1e5f9a3d7b1c5e9f3a7d1b5',
|
|
||||||
vout: 1,
|
|
||||||
address: 'bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq',
|
|
||||||
amountBtc: 0.00023000,
|
|
||||||
confirmations: 312,
|
|
||||||
vulnerabilities: [
|
|
||||||
{
|
|
||||||
type: 'DUST_SPEND',
|
|
||||||
severity: 'medium',
|
|
||||||
description:
|
|
||||||
'This UTXO is near the dust threshold. Spending it may cost more in fees than its value, and dust outputs are often used as tracking vectors by chain surveillance companies.',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'ADDRESS_REUSE',
|
|
||||||
severity: 'high',
|
|
||||||
description:
|
|
||||||
'This address has received funds in 3 separate transactions. Address reuse breaks the one-time-address privacy model and allows observers to link all deposits to the same wallet.',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
txid: 'f9e3d7c1b5a9f3d7c1b5a9f3d7c1b5a9f3d7c1b5a9f3d7c1b5a9f3d7c1b5a9',
|
|
||||||
vout: 0,
|
|
||||||
address: 'bc1q9h7garjcdkl4h5khfz2yxkhsmhep5j7g4cjtch',
|
|
||||||
amountBtc: 0.12000000,
|
|
||||||
confirmations: 4521,
|
|
||||||
vulnerabilities: [
|
|
||||||
{
|
|
||||||
type: 'CONSOLIDATION',
|
|
||||||
severity: 'medium',
|
|
||||||
description:
|
|
||||||
'This UTXO was created by consolidating 7 inputs in a single transaction. Consolidation reveals that all input addresses belong to the same wallet, reducing privacy significantly.',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
txid: '2c6e0a4f8b2d6e0a4f8b2d6e0a4f8b2d6e0a4f8b2d6e0a4f8b2d6e0a4f8b2d',
|
|
||||||
vout: 2,
|
|
||||||
address: 'bc1qm34mqf4vn8f5vhf0q3djg2zuzfm9aap6e3n4j',
|
|
||||||
amountBtc: 0.87654321,
|
|
||||||
confirmations: 98,
|
|
||||||
vulnerabilities: [
|
|
||||||
{
|
|
||||||
type: 'CIOH',
|
|
||||||
severity: 'high',
|
|
||||||
description:
|
|
||||||
'Common Input Ownership Heuristic (CIOH): this UTXO was spent alongside UTXOs from different derivation paths in the same transaction, strongly suggesting to analysts that all inputs share a common owner.',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'ADDRESS_REUSE',
|
|
||||||
severity: 'high',
|
|
||||||
description:
|
|
||||||
'This address appears in 5 transactions as both sender and receiver, a pattern that severely compromises wallet privacy and makes cluster analysis trivial.',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
txid: '7d1b5e9f3a7d1b5e9f3a7d1b5e9f3a7d1b5e9f3a7d1b5e9f3a7d1b5e9f3a7d',
|
|
||||||
vout: 0,
|
|
||||||
address: 'bc1qcr8te4kr609gcawutmrza0j4xv80jy8zeqchgx',
|
|
||||||
amountBtc: 0.00500000,
|
|
||||||
confirmations: 2103,
|
|
||||||
vulnerabilities: [
|
|
||||||
{
|
|
||||||
type: 'DUST_SPEND',
|
|
||||||
severity: 'low',
|
|
||||||
description:
|
|
||||||
'A small dust amount was received at this address in a prior transaction. While the dust has not been spent, its presence could be used to track this UTXO if included in a future transaction.',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user