crypttrace 0.36.0__tar.gz → 0.37.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. {crypttrace-0.36.0/src/crypttrace.egg-info → crypttrace-0.37.0}/PKG-INFO +5 -3
  2. {crypttrace-0.36.0 → crypttrace-0.37.0}/README.md +4 -2
  3. {crypttrace-0.36.0 → crypttrace-0.37.0}/src/crypttrace/__init__.py +1 -1
  4. {crypttrace-0.36.0 → crypttrace-0.37.0}/src/crypttrace/case.py +40 -9
  5. {crypttrace-0.36.0 → crypttrace-0.37.0}/src/crypttrace/web/index.html +40 -10
  6. {crypttrace-0.36.0 → crypttrace-0.37.0}/src/crypttrace/webapp.py +16 -0
  7. {crypttrace-0.36.0 → crypttrace-0.37.0/src/crypttrace.egg-info}/PKG-INFO +5 -3
  8. {crypttrace-0.36.0 → crypttrace-0.37.0}/LICENSE +0 -0
  9. {crypttrace-0.36.0 → crypttrace-0.37.0}/pyproject.toml +0 -0
  10. {crypttrace-0.36.0 → crypttrace-0.37.0}/setup.cfg +0 -0
  11. {crypttrace-0.36.0 → crypttrace-0.37.0}/src/crypttrace/addresses.py +0 -0
  12. {crypttrace-0.36.0 → crypttrace-0.37.0}/src/crypttrace/analysis.py +0 -0
  13. {crypttrace-0.36.0 → crypttrace-0.37.0}/src/crypttrace/assess.py +0 -0
  14. {crypttrace-0.36.0 → crypttrace-0.37.0}/src/crypttrace/assets.py +0 -0
  15. {crypttrace-0.36.0 → crypttrace-0.37.0}/src/crypttrace/bridges.py +0 -0
  16. {crypttrace-0.36.0 → crypttrace-0.37.0}/src/crypttrace/chains.py +0 -0
  17. {crypttrace-0.36.0 → crypttrace-0.37.0}/src/crypttrace/cli.py +0 -0
  18. {crypttrace-0.36.0 → crypttrace-0.37.0}/src/crypttrace/config.py +0 -0
  19. {crypttrace-0.36.0 → crypttrace-0.37.0}/src/crypttrace/drain.py +0 -0
  20. {crypttrace-0.36.0 → crypttrace-0.37.0}/src/crypttrace/evidence.py +0 -0
  21. {crypttrace-0.36.0 → crypttrace-0.37.0}/src/crypttrace/export.py +0 -0
  22. {crypttrace-0.36.0 → crypttrace-0.37.0}/src/crypttrace/fetchers/__init__.py +0 -0
  23. {crypttrace-0.36.0 → crypttrace-0.37.0}/src/crypttrace/fetchers/bitcoin.py +0 -0
  24. {crypttrace-0.36.0 → crypttrace-0.37.0}/src/crypttrace/fetchers/etherscan.py +0 -0
  25. {crypttrace-0.36.0 → crypttrace-0.37.0}/src/crypttrace/fetchers/http.py +0 -0
  26. {crypttrace-0.36.0 → crypttrace-0.37.0}/src/crypttrace/fetchers/solana.py +0 -0
  27. {crypttrace-0.36.0 → crypttrace-0.37.0}/src/crypttrace/fetchers/ton.py +0 -0
  28. {crypttrace-0.36.0 → crypttrace-0.37.0}/src/crypttrace/fetchers/tron.py +0 -0
  29. {crypttrace-0.36.0 → crypttrace-0.37.0}/src/crypttrace/freeze.py +0 -0
  30. {crypttrace-0.36.0 → crypttrace-0.37.0}/src/crypttrace/funder.py +0 -0
  31. {crypttrace-0.36.0 → crypttrace-0.37.0}/src/crypttrace/gascluster.py +0 -0
  32. {crypttrace-0.36.0 → crypttrace-0.37.0}/src/crypttrace/investigate.py +0 -0
  33. {crypttrace-0.36.0 → crypttrace-0.37.0}/src/crypttrace/labels/__init__.py +0 -0
  34. {crypttrace-0.36.0 → crypttrace-0.37.0}/src/crypttrace/labels/audit.py +0 -0
  35. {crypttrace-0.36.0 → crypttrace-0.37.0}/src/crypttrace/labels/bulk.py +0 -0
  36. {crypttrace-0.36.0 → crypttrace-0.37.0}/src/crypttrace/labels/known.json +0 -0
  37. {crypttrace-0.36.0 → crypttrace-0.37.0}/src/crypttrace/labels/labels.py +0 -0
  38. {crypttrace-0.36.0 → crypttrace-0.37.0}/src/crypttrace/labels/names.py +0 -0
  39. {crypttrace-0.36.0 → crypttrace-0.37.0}/src/crypttrace/labels/partial.json +0 -0
  40. {crypttrace-0.36.0 → crypttrace-0.37.0}/src/crypttrace/labels/tonapi.py +0 -0
  41. {crypttrace-0.36.0 → crypttrace-0.37.0}/src/crypttrace/labels/tronscan.py +0 -0
  42. {crypttrace-0.36.0 → crypttrace-0.37.0}/src/crypttrace/offramp.py +0 -0
  43. {crypttrace-0.36.0 → crypttrace-0.37.0}/src/crypttrace/pdf.py +0 -0
  44. {crypttrace-0.36.0 → crypttrace-0.37.0}/src/crypttrace/poisoning.py +0 -0
  45. {crypttrace-0.36.0 → crypttrace-0.37.0}/src/crypttrace/prices.py +0 -0
  46. {crypttrace-0.36.0 → crypttrace-0.37.0}/src/crypttrace/render.py +0 -0
  47. {crypttrace-0.36.0 → crypttrace-0.37.0}/src/crypttrace/report.py +0 -0
  48. {crypttrace-0.36.0 → crypttrace-0.37.0}/src/crypttrace/spam.py +0 -0
  49. {crypttrace-0.36.0 → crypttrace-0.37.0}/src/crypttrace/store.py +0 -0
  50. {crypttrace-0.36.0 → crypttrace-0.37.0}/src/crypttrace/trace.py +0 -0
  51. {crypttrace-0.36.0 → crypttrace-0.37.0}/src/crypttrace/verify.py +0 -0
  52. {crypttrace-0.36.0 → crypttrace-0.37.0}/src/crypttrace/watch.py +0 -0
  53. {crypttrace-0.36.0 → crypttrace-0.37.0}/src/crypttrace.egg-info/SOURCES.txt +0 -0
  54. {crypttrace-0.36.0 → crypttrace-0.37.0}/src/crypttrace.egg-info/dependency_links.txt +0 -0
  55. {crypttrace-0.36.0 → crypttrace-0.37.0}/src/crypttrace.egg-info/entry_points.txt +0 -0
  56. {crypttrace-0.36.0 → crypttrace-0.37.0}/src/crypttrace.egg-info/requires.txt +0 -0
  57. {crypttrace-0.36.0 → crypttrace-0.37.0}/src/crypttrace.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: crypttrace
3
- Version: 0.36.0
3
+ Version: 0.37.0
4
4
  Summary: OSINT toolkit for crypto investigations: trace stolen funds across Ethereum, Bitcoin, Tron, Solana and TON
5
5
  Author: bobslayerX
6
6
  License-Expression: MIT
@@ -388,8 +388,10 @@ It reads up to 200 recent native and 200 recent token transfer rows per wallet,
388
388
  provider limits. Each match shows the distinct senders, individual amounts and assets, UTC
389
389
  times, explorer links and any known recipient label. A shared exchange wallet can receive
390
390
  unrelated deposits. On UTXO networks, input shares are estimates and outputs can be change.
391
- In the web app, open **Common recipients**, choose a saved case and network, and click
392
- **Find common recipients**.
391
+ In the web app, open **Common recipients** and select **New case…**. Choose a network,
392
+ name the case and paste at least two wallet addresses, one per line. **Create case and
393
+ find recipients** saves the case to the local case library and searches it immediately.
394
+ You can reopen the case in the same tab or with `crypttrace case show NAME`.
393
395
 
394
396
  ### Watch & alerts — catching the cash-out
395
397
 
@@ -351,8 +351,10 @@ It reads up to 200 recent native and 200 recent token transfer rows per wallet,
351
351
  provider limits. Each match shows the distinct senders, individual amounts and assets, UTC
352
352
  times, explorer links and any known recipient label. A shared exchange wallet can receive
353
353
  unrelated deposits. On UTXO networks, input shares are estimates and outputs can be change.
354
- In the web app, open **Common recipients**, choose a saved case and network, and click
355
- **Find common recipients**.
354
+ In the web app, open **Common recipients** and select **New case…**. Choose a network,
355
+ name the case and paste at least two wallet addresses, one per line. **Create case and
356
+ find recipients** saves the case to the local case library and searches it immediately.
357
+ You can reopen the case in the same tab or with `crypttrace case show NAME`.
356
358
 
357
359
  ### Watch & alerts — catching the cash-out
358
360
 
@@ -1,2 +1,2 @@
1
1
  """crypttrace — OSINT crypto investigation CLI."""
2
- __version__ = "0.36.0"
2
+ __version__ = "0.37.0"
@@ -47,15 +47,24 @@ def _now() -> int:
47
47
  return int(time.time())
48
48
 
49
49
 
50
- def new(name: str, note: str = "") -> Path:
50
+ def new(name: str, note: str = "", *, entries: Optional[List[dict]] = None) -> Path:
51
51
  p = path_for(name)
52
- if p.exists():
53
- raise CaseError(f"case already exists: {p}")
54
52
  case = {"crypttrace_case": FORMAT, "name": p.stem, "created": _now(), "updated": _now(),
55
- "addresses": [], "notes": []}
53
+ "addresses": entries or [], "notes": []}
56
54
  if note:
57
55
  case["notes"].append({"at": _now(), "text": note})
58
- save(case, p)
56
+ data = json.dumps(case, indent=2, ensure_ascii=False)
57
+ p.parent.mkdir(parents=True, exist_ok=True)
58
+ try:
59
+ stream = p.open("x", encoding="utf-8")
60
+ except FileExistsError:
61
+ raise CaseError(f"case already exists: {p.name}")
62
+ try:
63
+ with stream:
64
+ stream.write(data)
65
+ except OSError:
66
+ p.unlink(missing_ok=True)
67
+ raise
59
68
  return p
60
69
 
61
70
 
@@ -96,23 +105,45 @@ def all_cases() -> List[dict]:
96
105
  return out
97
106
 
98
107
 
99
- def add(name: str, address: str, chain: str, role: str = "other", note: str = "") -> dict:
108
+ def _address_entry(address: str, chain: str, role: str, note: str) -> dict:
100
109
  chains.check(chain)
101
110
  if role not in ROLES:
102
111
  raise CaseError(f"role must be one of: {', '.join(ROLES)}")
103
112
  ok, why = addresses.validate(address, chain)
104
113
  if not ok:
105
114
  raise CaseError(f"not a valid {chain} address: {why}")
106
- case = load(name)
107
115
  key = chains.norm_addr(address, chain)
116
+ return {"address": key, "chain": chain, "role": role, "note": note, "added": _now(), "snapshot": None}
117
+
118
+
119
+ def new_from_wallets(name: str, chain: str, wallets: List[str]) -> Path:
120
+ """Create one named library case after validating all pasted wallets."""
121
+ if (not re.fullmatch(r"[\w-][\w.-]{0,63}", name) or name.endswith(".")
122
+ or name.lower().endswith(".json") or Path(name + ".json").is_reserved()):
123
+ raise CaseError("Use a case name of up to 64 letters, digits, dots, underscores or hyphens, without a file extension or path.")
124
+ chains.check(chain)
125
+ entries = {}
126
+ for i, wallet in enumerate(wallets, 1):
127
+ try:
128
+ entry = _address_entry(wallet.strip(), chain, "other", "")
129
+ except CaseError as e:
130
+ raise CaseError(f"Address {i}: {e}") from e
131
+ entries[entry["address"]] = entry
132
+ if len(entries) < 2:
133
+ raise CaseError("Enter at least two distinct wallet addresses.")
134
+ return new(str(CASES_DIR / (name + ".json")), entries=list(entries.values()))
135
+
136
+
137
+ def add(name: str, address: str, chain: str, role: str = "other", note: str = "") -> dict:
138
+ entry = _address_entry(address, chain, role, note)
139
+ case = load(name)
108
140
  for a in case["addresses"]:
109
- if a["chain"] == chain and a["address"] == key:
141
+ if a["chain"] == chain and a["address"] == entry["address"]:
110
142
  a["role"] = role # adding it again updates it
111
143
  if note:
112
144
  a["note"] = note
113
145
  save(case)
114
146
  return a
115
- entry = {"address": key, "chain": chain, "role": role, "note": note, "added": _now(), "snapshot": None}
116
147
  case["addresses"].append(entry)
117
148
  save(case)
118
149
  return entry
@@ -44,7 +44,7 @@
44
44
  header .tag{color:var(--dim);font-size:13px}
45
45
 
46
46
  .bar{position:relative;z-index:2;display:flex;gap:10px;flex-wrap:wrap;align-items:center;padding:14px 22px}
47
- input,select,button{
47
+ input,select,button,textarea{
48
48
  color:var(--text);font-size:14px;border-radius:12px;padding:10px 13px;
49
49
  background:var(--glass-2);border:1px solid var(--stroke);
50
50
  backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);
@@ -68,6 +68,9 @@
68
68
  .main{flex:1 1 auto;display:flex;flex-direction:column;min-width:0;min-height:0}
69
69
  .tabs{flex:0 0 auto;display:flex;flex-wrap:wrap;gap:6px;margin-bottom:10px}
70
70
  #common-results{overflow-wrap:anywhere}
71
+ #new-case-fields{margin:12px 0}
72
+ #new-case-fields label{display:block;margin:8px 0}
73
+ #case-wallets{display:block;width:min(100%,65ch);box-sizing:border-box;resize:vertical}
71
74
  .tab{font-size:13px;font-weight:600;padding:8px 15px;border-radius:12px;cursor:pointer;
72
75
  background:var(--glass-2);border:1px solid var(--stroke);color:var(--dim);
73
76
  backdrop-filter:blur(12px);transition:.25s cubic-bezier(.22,1,.36,1)}
@@ -268,9 +271,13 @@
268
271
  <div class="view" id="v-check"></div>
269
272
  <div class="view" id="v-common">
270
273
  <form id="common-form">
271
- <label>Case <select id="common-case" required></select></label>
274
+ <label>Case <select id="common-case"><option value="">New case…</option></select></label>
272
275
  <label>Network <select id="common-chain"></select></label>
273
- <button>Find common recipients</button>
276
+ <div id="new-case-fields">
277
+ <label>Case name <input id="case-name" maxlength="64" required></label>
278
+ <label>Wallet addresses (one per line)<textarea id="case-wallets" rows="4" required spellcheck="false"></textarea></label>
279
+ </div>
280
+ <button id="common-submit">Create case and find recipients</button>
274
281
  </form>
275
282
  <div id="common-results" aria-live="polite"></div>
276
283
  <p class="muted">Searches up to 200 recent native and 200 token transfers per wallet. Shared exchange addresses may receive unrelated deposits.</p>
@@ -348,8 +355,8 @@ function setStatus(t,err,busy){
348
355
  }
349
356
  function loader(p){ $('#loader').style.width=p+'%'; if(p>=100) setTimeout(()=>$('#loader').style.width='0',500); }
350
357
 
351
- async function api(path){
352
- const r=await fetch(path);
358
+ async function api(path,options){
359
+ const r=await fetch(path,options);
353
360
  const raw=await r.text();
354
361
  let j;
355
362
  try{ j=JSON.parse(raw); }
@@ -579,22 +586,45 @@ document.querySelectorAll('.tab').forEach(t=>t.onclick=()=>showView(t.dataset.vi
579
586
 
580
587
  $('#common-chain').innerHTML=$('#chain').innerHTML;
581
588
  async function loadCaseNames(){
582
- const select=$('#common-case'), previous=select.value;
589
+ const select=$('#common-case');
583
590
  try{
584
591
  const names=await api('/api/cases');
585
- select.replaceChildren(...names.map(name=>new Option(name,name)));
586
- if(names.includes(previous)) select.value=previous;
587
- else $('#common-results').textContent=names.length?'':'Create a case with crypttrace case new and add two addresses on one network.';
592
+ const previous=select.value;
593
+ for(const name of names){
594
+ if(!Array.from(select.options).some(option=>option.value===name)) select.add(new Option(name,name));
595
+ }
596
+ if(!select.dataset.loaded && names.length && !previous && !$('#case-name').value && !$('#case-wallets').value) select.value=names[0];
597
+ select.dataset.loaded='true';
598
+ updateCaseForm();
588
599
  }catch(e){ $('#common-results').textContent=e.message; }
589
600
  }
590
601
  const commonForm=$('#common-form'), commonResults=$('#common-results');
602
+ function updateCaseForm(){
603
+ const creating=!$('#common-case').value;
604
+ $('#new-case-fields').hidden=!creating;
605
+ $('#case-name').required=$('#case-wallets').required=creating;
606
+ $('#common-submit').textContent=creating?'Create case and find recipients':'Find common recipients';
607
+ }
608
+ $('#common-case').onchange=updateCaseForm;
591
609
  commonForm.onchange=()=>{commonResults.textContent='';};
592
610
  commonForm.onsubmit=async event=>{
593
611
  event.preventDefault();
594
- const name=$('#common-case').value, network=$('#common-chain').value;
612
+ let name=$('#common-case').value;
613
+ const network=$('#common-chain').value;
595
614
  for(const control of commonForm.elements) control.disabled=true;
596
615
  commonResults.textContent='Reading recent transfers…';
597
616
  try{
617
+ if(!name){
618
+ commonResults.textContent='Saving case…';
619
+ const saved=await api('/api/cases',{method:'POST',headers:{'Content-Type':'application/json'},
620
+ body:JSON.stringify({name:$('#case-name').value,chain:network,
621
+ addresses:$('#case-wallets').value.trim().split(/\s+/).filter(Boolean)})});
622
+ name=saved.name;
623
+ $('#common-case').add(new Option(name,name,true,true));
624
+ $('#case-name').value=$('#case-wallets').value='';
625
+ updateCaseForm();
626
+ commonResults.textContent='Case saved. Reading recent transfers…';
627
+ }
598
628
  const report=await api('/api/cases/'+q(name)+'/common-recipients?chain='+q(network));
599
629
  const warnings=report.warnings.map(w=>'<p>'+esc(w)+'</p>').join('');
600
630
  const groups=report.matches.map(m=>`<section class="card">
@@ -81,6 +81,22 @@ def create_app() -> Flask:
81
81
  from crypttrace import case
82
82
  return jsonify([Path(c["path"]).stem for c in case.all_cases()])
83
83
 
84
+ @app.post("/api/cases")
85
+ def api_create_case():
86
+ from crypttrace import case
87
+ data = request.get_json()
88
+ if not isinstance(data, dict):
89
+ return jsonify(error="Expected a case name, network and addresses."), 400
90
+ name, chain, wallets = (data.get(key) for key in ("name", "chain", "addresses"))
91
+ if not (isinstance(name, str) and isinstance(chain, str) and isinstance(wallets, list)
92
+ and all(isinstance(wallet, str) for wallet in wallets)):
93
+ return jsonify(error="Expected a case name, network and a list of addresses."), 400
94
+ try:
95
+ path = case.new_from_wallets(name.strip(), chain, wallets)
96
+ except _KNOWN_ERRORS as e:
97
+ return jsonify(error=str(e)), 400
98
+ return jsonify(name=path.stem), 201
99
+
84
100
  @app.route("/api/cases/<name>/common-recipients")
85
101
  def api_common_recipients(name):
86
102
  from crypttrace import case
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: crypttrace
3
- Version: 0.36.0
3
+ Version: 0.37.0
4
4
  Summary: OSINT toolkit for crypto investigations: trace stolen funds across Ethereum, Bitcoin, Tron, Solana and TON
5
5
  Author: bobslayerX
6
6
  License-Expression: MIT
@@ -388,8 +388,10 @@ It reads up to 200 recent native and 200 recent token transfer rows per wallet,
388
388
  provider limits. Each match shows the distinct senders, individual amounts and assets, UTC
389
389
  times, explorer links and any known recipient label. A shared exchange wallet can receive
390
390
  unrelated deposits. On UTXO networks, input shares are estimates and outputs can be change.
391
- In the web app, open **Common recipients**, choose a saved case and network, and click
392
- **Find common recipients**.
391
+ In the web app, open **Common recipients** and select **New case…**. Choose a network,
392
+ name the case and paste at least two wallet addresses, one per line. **Create case and
393
+ find recipients** saves the case to the local case library and searches it immediately.
394
+ You can reopen the case in the same tab or with `crypttrace case show NAME`.
393
395
 
394
396
  ### Watch & alerts — catching the cash-out
395
397
 
File without changes
File without changes
File without changes