Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# infinihash-kyt (Python)
# infinihash-kyt (Python) — DEPRECATED, use Infinihash/infinihash-kyt

> **This repository is deprecated.** The maintained Python SDK is
> [Infinihash/infinihash-kyt](https://github.com/Infinihash/infinihash-kyt).
> Both repositories claim the PyPI name `infinihash-kyt`; publish only from
> `Infinihash/infinihash-kyt`, never from this repository. This copy is kept
> for history.

Thin Python wrapper for the Infinihash KYT REST API. Screen wallets, manage
cases, pull SAR drafts.
Expand All @@ -9,12 +15,17 @@ cases, pull SAR drafts.
pip install infinihash-kyt
```

## API keys

Create a key at https://kyt.infinihash.com/kyt/settings/api-keys. Keys start
with `kyt_`.

## Use

```python
from infinihash_kyt import KYT

client = KYT(api_key="ih_kyt_...") # or set INFINIHASH_KYT_KEY in your env
client = KYT(api_key="kyt_...") # or set INFINIHASH_KYT_KEY in your env

# Screen a wallet
r = client.screen.address("0x722122dF12D4e14e13Ac3b6895a86e84145b6967", chain="ethereum")
Expand Down
2 changes: 1 addition & 1 deletion infinihash_kyt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Quick start:

from infinihash_kyt import KYT
client = KYT(api_key="ih_kyt_...")
client = KYT(api_key="kyt_...")
result = client.screen.address(
"0x722122dF12D4e14e13Ac3b6895a86e84145b6967",
chain="ethereum",
Expand Down
Binary file added infinihash_kyt/__pycache__/__init__.cpython-315.pyc
Binary file not shown.
Binary file added infinihash_kyt/__pycache__/client.cpython-315.pyc
Binary file not shown.
14 changes: 7 additions & 7 deletions infinihash_kyt/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
-----------
from infinihash_kyt import KYT

client = KYT(api_key="ih_kyt_...") # or set INFINIHASH_KYT_KEY env var
client = KYT(api_key="kyt_...") # or set INFINIHASH_KYT_KEY env var

# Screen a wallet
result = client.screen.address(
Expand All @@ -29,7 +29,7 @@

Auth
----
Issue API keys at https://kyt.infinihash.com/kyt/admin (X-API-Key header).
Issue API keys at https://kyt.infinihash.com/kyt/settings/api-keys (X-API-Key header).
Pass api_key= to the constructor or export INFINIHASH_KYT_KEY in the environment.

Errors
Expand Down Expand Up @@ -243,7 +243,7 @@ def export_fincen(self, case_id: str) -> dict:
class Webhooks(_Resource):
"""Webhook endpoint management.

Webhooks deliver real-time push notifications to your server when
Webhooks deliver push notifications to your server when
screening events occur. Payloads are signed with HMAC-SHA256 using
your webhook secret — verify the X-KYT-Signature header on receipt.
"""
Expand Down Expand Up @@ -507,11 +507,11 @@ def lookup(self, address: str) -> dict:
Args:
address: Address to look up (chain prefix optional, e.g. "eth:0xABC...").
"""
return self._c._request("GET", f"/api/v1/lookup/{address}")
return self._c._request("GET", f"/api/v1/intel/lookup/{address}")

def recent_screenings(self) -> list:
"""Return recent screening activity for your organisation (last 50)."""
return self._c._request("GET", "/api/v1/recent-screenings")
return self._c._request("GET", "/api/v1/intel/recent-screenings")


# ---------------------------------------------------------------------------
Expand Down Expand Up @@ -549,7 +549,7 @@ class KYT:
"""Infinihash KYT API client.

Args:
api_key: Your KYT API key (ih_kyt_...).
api_key: Your KYT API key (kyt_...).
Falls back to INFINIHASH_KYT_KEY environment variable.
base_url: Override the API base URL (useful for sandbox/staging).
timeout: Request timeout in seconds (default 30).
Expand All @@ -572,7 +572,7 @@ class KYT:
-------
from infinihash_kyt import KYT

client = KYT(api_key="ih_kyt_...")
client = KYT(api_key="kyt_...")
result = client.screen.address("0x722122dF12D4e14e13Ac3b6895a86e84145b6967")
if result["risk_level"] in ("high", "critical"):
case = client.cases.create(address=result["value"])
Expand Down
Binary file not shown.
50 changes: 50 additions & 0 deletions tests/test_audit_routes_docs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
"""Audit 2026-11 C-2 / C-3 / C-4 for the deprecated kyt-python SDK.

- intel.lookup() / intel.recent_screenings() called /api/v1/lookup/{address}
and /api/v1/recent-screenings, both 404. The real routes are
/api/v1/intel/lookup/{address} and /api/v1/intel/recent-screenings
(clearauthority-kyt app/api/v1/intel.py: prefix /intel, :60, :101). A 404 on
an intelligence lookup reads as "this address is clean".
- Key docs pointed at /kyt/admin (admin-only) and showed ih_kyt_ keys; the
engine mints kyt_ keys.
- README must carry a deprecation notice pointing at infinihash-kyt.
"""
import pathlib

from infinihash_kyt.client import KYT

ROOT = pathlib.Path(__file__).resolve().parent.parent
DOCS = [ROOT / "README.md", ROOT / "infinihash_kyt" / "client.py", ROOT / "infinihash_kyt" / "__init__.py"]


def _capture(monkeypatch):
calls = []
c = KYT(api_key="kyt_test")
monkeypatch.setattr(c, "_request", lambda method, path, **kw: calls.append((method, path)) or {})
return c, calls


def test_intel_lookup_route(monkeypatch):
c, calls = _capture(monkeypatch)
c.intel.lookup("0xabc")
assert calls == [("GET", "/api/v1/intel/lookup/0xabc")]


def test_intel_recent_screenings_route(monkeypatch):
c, calls = _capture(monkeypatch)
c.intel.recent_screenings()
assert calls == [("GET", "/api/v1/intel/recent-screenings")]


def test_key_docs():
for f in DOCS:
s = f.read_text()
assert "/kyt/admin" not in s, f"{f.name} links /kyt/admin"
assert "ih_kyt_" not in s, f"{f.name} shows ih_kyt_ keys"
assert any("https://kyt.infinihash.com/kyt/settings/api-keys" in f.read_text() for f in DOCS)


def test_readme_deprecation_notice():
s = (ROOT / "README.md").read_text()
assert "DEPRECATED" in s
assert "https://github.com/Infinihash/infinihash-kyt" in s
Loading