cryptascreen 0.2.0__py3-none-any.whl

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 (41) hide show
  1. cryptascreen/__init__.py +61 -0
  2. cryptascreen/_util.py +111 -0
  3. cryptascreen/_version.py +3 -0
  4. cryptascreen/client.py +231 -0
  5. cryptascreen/config.py +48 -0
  6. cryptascreen/errors.py +217 -0
  7. cryptascreen/helpers.py +47 -0
  8. cryptascreen/operations.py +131 -0
  9. cryptascreen/resources/__init__.py +1 -0
  10. cryptascreen/resources/alerts.py +51 -0
  11. cryptascreen/resources/auth.py +36 -0
  12. cryptascreen/resources/capabilities.py +36 -0
  13. cryptascreen/resources/cases.py +198 -0
  14. cryptascreen/resources/compliance.py +116 -0
  15. cryptascreen/resources/graph.py +70 -0
  16. cryptascreen/resources/intelligence.py +69 -0
  17. cryptascreen/resources/monitoring.py +142 -0
  18. cryptascreen/resources/names.py +97 -0
  19. cryptascreen/resources/sanctions.py +50 -0
  20. cryptascreen/resources/screening.py +379 -0
  21. cryptascreen/resources/settings.py +115 -0
  22. cryptascreen/resources/webhooks.py +55 -0
  23. cryptascreen/retry.py +176 -0
  24. cryptascreen/signature.py +118 -0
  25. cryptascreen/types/__init__.py +313 -0
  26. cryptascreen/types/_account.py +199 -0
  27. cryptascreen/types/_models.py +1620 -0
  28. cryptascreen/types/cases.py +31 -0
  29. cryptascreen/types/common.py +17 -0
  30. cryptascreen/types/compliance.py +27 -0
  31. cryptascreen/types/graph.py +25 -0
  32. cryptascreen/types/intelligence.py +11 -0
  33. cryptascreen/types/names.py +39 -0
  34. cryptascreen/types/sanctions.py +13 -0
  35. cryptascreen/types/screening.py +73 -0
  36. cryptascreen/types/wallet.py +85 -0
  37. cryptascreen/types/webhooks.py +13 -0
  38. cryptascreen-0.2.0.dist-info/METADATA +305 -0
  39. cryptascreen-0.2.0.dist-info/RECORD +41 -0
  40. cryptascreen-0.2.0.dist-info/WHEEL +4 -0
  41. cryptascreen-0.2.0.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,31 @@
1
+ """cases types (generated; re-exported from ``cryptascreen.types._models``)."""
2
+
3
+ from cryptascreen.types._models import (
4
+ AddEvidenceRequest,
5
+ AddNoteRequest,
6
+ CaseEvent,
7
+ CaseEvidence,
8
+ CaseNote,
9
+ CasePriority,
10
+ CaseStatus,
11
+ CreateCaseRequest,
12
+ EscalateCaseRequest,
13
+ InvestigationCase,
14
+ ListCasesParams,
15
+ UpdateCaseStatusRequest,
16
+ )
17
+
18
+ __all__ = [
19
+ "AddEvidenceRequest",
20
+ "AddNoteRequest",
21
+ "CaseEvent",
22
+ "CaseEvidence",
23
+ "CaseNote",
24
+ "CasePriority",
25
+ "CaseStatus",
26
+ "CreateCaseRequest",
27
+ "EscalateCaseRequest",
28
+ "InvestigationCase",
29
+ "ListCasesParams",
30
+ "UpdateCaseStatusRequest",
31
+ ]
@@ -0,0 +1,17 @@
1
+ """common types (generated; re-exported from ``cryptascreen.types._models``)."""
2
+
3
+ from cryptascreen.types._models import (
4
+ ApiError,
5
+ ApiResponse,
6
+ CryptaScreenConfig,
7
+ PaginatedResponse,
8
+ PaginationParams,
9
+ )
10
+
11
+ __all__ = [
12
+ "ApiError",
13
+ "ApiResponse",
14
+ "CryptaScreenConfig",
15
+ "PaginatedResponse",
16
+ "PaginationParams",
17
+ ]
@@ -0,0 +1,27 @@
1
+ """compliance types (generated; re-exported from ``cryptascreen.types._models``)."""
2
+
3
+ from cryptascreen.types._models import (
4
+ Dac8OperatorInfo,
5
+ Dac8ReportRequest,
6
+ Dac8ReportResult,
7
+ Dac8TransactionData,
8
+ Dac8UserData,
9
+ TravelRuleCheckRequest,
10
+ TravelRuleCheckResult,
11
+ TravelRulePayload,
12
+ TravelRulePayloadRequest,
13
+ VaspIdentification,
14
+ )
15
+
16
+ __all__ = [
17
+ "Dac8OperatorInfo",
18
+ "Dac8ReportRequest",
19
+ "Dac8ReportResult",
20
+ "Dac8TransactionData",
21
+ "Dac8UserData",
22
+ "TravelRuleCheckRequest",
23
+ "TravelRuleCheckResult",
24
+ "TravelRulePayload",
25
+ "TravelRulePayloadRequest",
26
+ "VaspIdentification",
27
+ ]
@@ -0,0 +1,25 @@
1
+ """graph types (generated; re-exported from ``cryptascreen.types._models``)."""
2
+
3
+ from cryptascreen.types._models import (
4
+ GraphEdge,
5
+ GraphExportFormat,
6
+ GraphNode,
7
+ GraphRequest,
8
+ GraphResponse,
9
+ GraphScope,
10
+ GraphScopeStatus,
11
+ GraphStats,
12
+ GraphStatus,
13
+ )
14
+
15
+ __all__ = [
16
+ "GraphEdge",
17
+ "GraphExportFormat",
18
+ "GraphNode",
19
+ "GraphRequest",
20
+ "GraphResponse",
21
+ "GraphScope",
22
+ "GraphScopeStatus",
23
+ "GraphStats",
24
+ "GraphStatus",
25
+ ]
@@ -0,0 +1,11 @@
1
+ """intelligence types (generated; re-exported from ``cryptascreen.types._models``)."""
2
+
3
+ from cryptascreen.types._models import (
4
+ EntityLabel,
5
+ VaspInfo,
6
+ )
7
+
8
+ __all__ = [
9
+ "EntityLabel",
10
+ "VaspInfo",
11
+ ]
@@ -0,0 +1,39 @@
1
+ """names types (generated; re-exported from ``cryptascreen.types._models``)."""
2
+
3
+ from cryptascreen.types._models import (
4
+ NameCoverage,
5
+ NameDecisionRequest,
6
+ NameHit,
7
+ NameIdentifier,
8
+ NameIdentifierType,
9
+ NameListedEntity,
10
+ NameMatchDecision,
11
+ NameMatchReason,
12
+ NameMatchStrength,
13
+ NameOutcome,
14
+ NameReasonOutcome,
15
+ NameScreeningHistoryItem,
16
+ NameScreenOptions,
17
+ NameScreenRequest,
18
+ NameScreenResponse,
19
+ NameSubjectType,
20
+ )
21
+
22
+ __all__ = [
23
+ "NameCoverage",
24
+ "NameDecisionRequest",
25
+ "NameHit",
26
+ "NameIdentifier",
27
+ "NameIdentifierType",
28
+ "NameListedEntity",
29
+ "NameMatchDecision",
30
+ "NameMatchReason",
31
+ "NameMatchStrength",
32
+ "NameOutcome",
33
+ "NameReasonOutcome",
34
+ "NameScreenOptions",
35
+ "NameScreenRequest",
36
+ "NameScreenResponse",
37
+ "NameScreeningHistoryItem",
38
+ "NameSubjectType",
39
+ ]
@@ -0,0 +1,13 @@
1
+ """sanctions types (generated; re-exported from ``cryptascreen.types._models``)."""
2
+
3
+ from cryptascreen.types._models import (
4
+ SanctionsCheckResponse,
5
+ SanctionsCheckResult,
6
+ SanctionsStatusResponse,
7
+ )
8
+
9
+ __all__ = [
10
+ "SanctionsCheckResponse",
11
+ "SanctionsCheckResult",
12
+ "SanctionsStatusResponse",
13
+ ]
@@ -0,0 +1,73 @@
1
+ """screening types (generated; re-exported from ``cryptascreen.types._models``)."""
2
+
3
+ from cryptascreen.types._models import (
4
+ AssessmentStatus,
5
+ AsyncSubmitOptions,
6
+ BulkScreeningRequest,
7
+ CacheDecision,
8
+ Coverage,
9
+ DetectorOutcome,
10
+ Disposition,
11
+ FindingCategory,
12
+ HeuristicDetectorStatus,
13
+ HeuristicsStatus,
14
+ LayerState,
15
+ MatchState,
16
+ PageOptions,
17
+ PolicyVersion,
18
+ ResultValidity,
19
+ ReviewStatus,
20
+ RiskLevel,
21
+ ScreenAddressRequest,
22
+ ScreeningEvaluation,
23
+ ScreeningEvaluationPage,
24
+ ScreeningFlag,
25
+ ScreeningJob,
26
+ ScreeningJobItem,
27
+ ScreeningJobResultsPage,
28
+ ScreeningJobStatus,
29
+ ScreeningJobSummary,
30
+ ScreeningLayer,
31
+ ScreeningLayers,
32
+ ScreeningResponse,
33
+ ScreeningResult,
34
+ SourceFreshness,
35
+ VendorLayer,
36
+ VendorLayerStatus,
37
+ )
38
+
39
+ __all__ = [
40
+ "AssessmentStatus",
41
+ "AsyncSubmitOptions",
42
+ "BulkScreeningRequest",
43
+ "CacheDecision",
44
+ "Coverage",
45
+ "DetectorOutcome",
46
+ "Disposition",
47
+ "FindingCategory",
48
+ "HeuristicDetectorStatus",
49
+ "HeuristicsStatus",
50
+ "LayerState",
51
+ "MatchState",
52
+ "PageOptions",
53
+ "PolicyVersion",
54
+ "ResultValidity",
55
+ "ReviewStatus",
56
+ "RiskLevel",
57
+ "ScreenAddressRequest",
58
+ "ScreeningEvaluation",
59
+ "ScreeningEvaluationPage",
60
+ "ScreeningFlag",
61
+ "ScreeningJob",
62
+ "ScreeningJobItem",
63
+ "ScreeningJobResultsPage",
64
+ "ScreeningJobStatus",
65
+ "ScreeningJobSummary",
66
+ "ScreeningLayer",
67
+ "ScreeningLayers",
68
+ "ScreeningResponse",
69
+ "ScreeningResult",
70
+ "SourceFreshness",
71
+ "VendorLayer",
72
+ "VendorLayerStatus",
73
+ ]
@@ -0,0 +1,85 @@
1
+ """wallet types (generated; re-exported from ``cryptascreen.types._models``)."""
2
+
3
+ from cryptascreen.types._models import (
4
+ AlertAcknowledgement,
5
+ AlertAuditEntry,
6
+ AlertDetail,
7
+ AlertReason,
8
+ CaseAssignee,
9
+ CaseAssignment,
10
+ WalletAssetShare,
11
+ WalletAssetTotal,
12
+ WalletCategoryAssetShare,
13
+ WalletCategoryAssetTotal,
14
+ WalletCategoryDerivedSource,
15
+ WalletCategoryExposure,
16
+ WalletCategoryFlow,
17
+ WalletCategoryPart,
18
+ WalletCategoryShare,
19
+ WalletCounterparty,
20
+ WalletCounterpartyOptions,
21
+ WalletCounterpartyPage,
22
+ WalletDerivedExposure,
23
+ WalletDerivedStep,
24
+ WalletDirectionShare,
25
+ WalletExposureCategory,
26
+ WalletExposureHit,
27
+ WalletExposurePaths,
28
+ WalletFiat,
29
+ WalletListing,
30
+ WalletPathStep,
31
+ WalletSectionOptions,
32
+ WalletSectionState,
33
+ WalletSectionStatus,
34
+ WalletShareOfValue,
35
+ WalletStolenAssetShare,
36
+ WalletStolenFundsTrace,
37
+ WalletTransaction,
38
+ WalletTransactionOptions,
39
+ WalletTransactionPage,
40
+ WalletTransferCount,
41
+ WalletTransferCountBasis,
42
+ WalletUsdShare,
43
+ )
44
+
45
+ __all__ = [
46
+ "AlertAcknowledgement",
47
+ "AlertAuditEntry",
48
+ "AlertDetail",
49
+ "AlertReason",
50
+ "CaseAssignee",
51
+ "CaseAssignment",
52
+ "WalletAssetShare",
53
+ "WalletAssetTotal",
54
+ "WalletCategoryAssetShare",
55
+ "WalletCategoryAssetTotal",
56
+ "WalletCategoryDerivedSource",
57
+ "WalletCategoryExposure",
58
+ "WalletCategoryFlow",
59
+ "WalletCategoryPart",
60
+ "WalletCategoryShare",
61
+ "WalletCounterparty",
62
+ "WalletCounterpartyOptions",
63
+ "WalletCounterpartyPage",
64
+ "WalletDerivedExposure",
65
+ "WalletDerivedStep",
66
+ "WalletDirectionShare",
67
+ "WalletExposureCategory",
68
+ "WalletExposureHit",
69
+ "WalletExposurePaths",
70
+ "WalletFiat",
71
+ "WalletListing",
72
+ "WalletPathStep",
73
+ "WalletSectionOptions",
74
+ "WalletSectionState",
75
+ "WalletSectionStatus",
76
+ "WalletShareOfValue",
77
+ "WalletStolenAssetShare",
78
+ "WalletStolenFundsTrace",
79
+ "WalletTransaction",
80
+ "WalletTransactionOptions",
81
+ "WalletTransactionPage",
82
+ "WalletTransferCount",
83
+ "WalletTransferCountBasis",
84
+ "WalletUsdShare",
85
+ ]
@@ -0,0 +1,13 @@
1
+ """webhooks types (generated; re-exported from ``cryptascreen.types._models``)."""
2
+
3
+ from cryptascreen.types._models import (
4
+ WebhookConfig,
5
+ WebhookDelivery,
6
+ WebhookEventType,
7
+ )
8
+
9
+ __all__ = [
10
+ "WebhookConfig",
11
+ "WebhookDelivery",
12
+ "WebhookEventType",
13
+ ]
@@ -0,0 +1,305 @@
1
+ Metadata-Version: 2.5
2
+ Name: cryptascreen
3
+ Version: 0.2.0
4
+ Summary: Official Python SDK for the CryptaScreen API — address and name screening, sanctions, exposure, investigations
5
+ Project-URL: Documentation, https://github.com/cryptascreen/cryptascreen-sdk-python#readme
6
+ Project-URL: Repository, https://github.com/cryptascreen/cryptascreen-sdk-python
7
+ Author-email: "CryptaCount Luxembourg S.à r.l." <support@cryptacount.com>
8
+ Maintainer-email: "CryptaCount Luxembourg S.à r.l." <support@cryptacount.com>
9
+ License-Expression: MIT
10
+ License-File: LICENSE
11
+ Keywords: aml,compliance,cryptascreen,crypto,kyc,sanctions,screening
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Topic :: Office/Business :: Financial
15
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
16
+ Requires-Python: >=3.10
17
+ Requires-Dist: httpx>=0.27
18
+ Requires-Dist: pydantic>=2.0
19
+ Provides-Extra: async
20
+ Requires-Dist: httpx[http2]; extra == 'async'
21
+ Provides-Extra: dev
22
+ Requires-Dist: mypy; extra == 'dev'
23
+ Requires-Dist: pytest; extra == 'dev'
24
+ Requires-Dist: pytest-asyncio; extra == 'dev'
25
+ Requires-Dist: respx; extra == 'dev'
26
+ Requires-Dist: ruff; extra == 'dev'
27
+ Description-Content-Type: text/markdown
28
+
29
+ # CryptaScreen Python SDK
30
+
31
+ Official Python SDK for the [CryptaScreen API](https://github.com/cryptascreen/cryptascreen-sdk-python#readme) — address and name screening, sanctions, wallet exposure, investigations, webhooks.
32
+
33
+ [![Python 3.10-3.13](https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12%20%7C%203.13-blue.svg)](https://www.python.org/downloads/)
34
+ [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
35
+
36
+ Same API surface as [`@cryptascreen/sdk`](https://github.com/cryptascreen/cryptascreen-sdk-typescript) 0.2.2 (every method maps 1:1; `cryptascreen.operations.OPERATIONS` lists each one with its HTTP method and path).
37
+
38
+ ## Installation
39
+
40
+ Supported Python versions: 3.10, 3.11, 3.12, 3.13.
41
+
42
+ ```bash
43
+ pip install cryptascreen
44
+ ```
45
+
46
+ With optional extras:
47
+
48
+ ```bash
49
+ pip install cryptascreen[async] # HTTP/2 support for the async client
50
+ pip install cryptascreen[dev] # Development tools (pytest, mypy, ruff, respx)
51
+ ```
52
+
53
+ > Not published yet: until the first release, install from a local checkout (`pip install -e .`).
54
+
55
+ ## Quick Start
56
+
57
+ ```python
58
+ from cryptascreen import CryptaScreen
59
+
60
+ client = CryptaScreen(api_key="csk_...")
61
+
62
+ result = client.screening.screen_address(
63
+ {"address": "0x1111111111111111111111111111111111111111", "chain": "ethereum"}
64
+ )
65
+ print(result.risk_level, result.risk_score, result.sanctions_match)
66
+ # "no match" means no match in the layers listed in result.layers; check result.assessment_status before treating it as clear
67
+
68
+ client.close()
69
+ ```
70
+
71
+ ### Context Manager
72
+
73
+ ```python
74
+ with CryptaScreen(api_key="csk_...") as client:
75
+ status = client.sanctions.get_status()
76
+ ```
77
+
78
+ ### Async Client
79
+
80
+ ```python
81
+ from cryptascreen import AsyncCryptaScreen
82
+
83
+ async with AsyncCryptaScreen(api_key="csk_...") as client:
84
+ result = await client.screening.screen_address(
85
+ {"address": "0x1111111111111111111111111111111111111111", "chain": "ethereum"}
86
+ )
87
+ ```
88
+
89
+ Requests may be plain dicts (camelCase wire names) or the typed models (`from cryptascreen.types import ScreenAddressRequest`).
90
+ Responses are pydantic models with snake_case attributes (`risk_level`, `evaluation_id`); unknown future fields are kept.
91
+
92
+ ## Chain is required
93
+
94
+ `chain` is required on every screening call, single and bulk (`chains`, one per address). An address does not identify its
95
+ network, so there is no default. A missing or blank chain raises `ValidationError` with `validation_code == "CHAIN_REQUIRED"`.
96
+
97
+ ## Data region
98
+
99
+ Every request goes to `https://api.cryptascreen.com`, which routes it to the data region of your API key
100
+ (`csk_us_...` keys to the US region, `csk_eu_...` keys to the EU region). There is no region option: use the key of the
101
+ region your account lives in.
102
+
103
+ ```python
104
+ CryptaScreen(api_key="csk_eu_...") # served by the EU region
105
+ CryptaScreen(
106
+ api_key="csk_...", base_url="http://localhost:8081"
107
+ ) # explicit URL (a local stack or a proxy)
108
+ ```
109
+
110
+ ## API Reference
111
+
112
+ ### Screening
113
+
114
+ ```python
115
+ r = client.screening.screen_address({"address": addr, "chain": "ethereum"})
116
+
117
+ # Bulk, synchronous (max 1000) - `async` is forced to False
118
+ results = client.screening.screen_bulk(
119
+ {"addresses": [a1, a2], "chains": ["ethereum", "ethereum"]}
120
+ ) # chains[i] belongs to addresses[i]: equal lengths
121
+
122
+ # Bulk, asynchronous (max 10000): job + poll (an Idempotency-Key is always sent)
123
+ job = client.screening.screen_bulk_async({"addresses": addrs, "chains": ["ethereum"] * len(addrs)})
124
+ job = client.screening.poll_job(job.job_id)
125
+ job = client.screening.screen_bulk_and_wait(
126
+ {"addresses": addrs, "chains": ["ethereum"] * len(addrs)}, poll_interval=2.0, timeout=300
127
+ )
128
+ page = client.screening.get_job_results(job.job_id, page=0, size=100)
129
+ client.screening.list_jobs()
130
+ client.screening.cancel_job(job.job_id)
131
+
132
+ # History and evaluations
133
+ client.screening.get_history("ethereum", addr)
134
+ client.screening.list_evaluations("ethereum", addr, page=0, size=20)
135
+ client.screening.get_evaluation(r.evaluation_id)
136
+
137
+ # Wallet sections and exposure (screened wallets only)
138
+ client.screening.get_counterparties("ethereum", addr, page=0, size=50, listed_only=True)
139
+ client.screening.get_transactions("ethereum", addr, direction="IN")
140
+ client.screening.get_exposure_paths("ethereum", addr, days=90)
141
+ ```
142
+
143
+ ### Sanctions
144
+
145
+ ```python
146
+ client.sanctions.check("ethereum", addr) # exact match against the self-hosted sanctions lists
147
+ client.sanctions.get_status()
148
+ ```
149
+
150
+ ### Name screening
151
+
152
+ ```python
153
+ hit = client.names.screen(
154
+ {"name": "Test Name", "type": "PERSON", "nationalities": ["LU"]}, idempotency_key="my-key"
155
+ )
156
+ from cryptascreen.helpers import is_name_clear
157
+
158
+ is_name_clear(hit) # True only for outcome CLEAR; anything else needs a person to look
159
+ client.names.get(hit.screening_id)
160
+ client.names.history(limit=50)
161
+ client.names.decide({"hitId": "...", "value": "FALSE_POSITIVE", "reason": "different person"})
162
+ client.names.decision_audit(format="json") # or "csv"
163
+ ```
164
+
165
+ ### Graph analysis
166
+
167
+ ```python
168
+ g = client.graph.build_graph({"seedAddress": addr, "chain": "ethereum", "maxHops": 2})
169
+ client.graph.trace({"seedAddress": addr, "chain": "ethereum", "direction": "FORWARD"})
170
+ client.graph.export_graph({"seedAddress": addr, "chain": "ethereum"}, format="csv") # bytes
171
+ ```
172
+
173
+ ### Investigation cases, alerts
174
+
175
+ ```python
176
+ c = client.cases.create({"title": "Review", "addresses": []})
177
+ client.cases.list(status="OPEN", page=1)
178
+ client.cases.add_note(c.id, {"content": "looked at it"})
179
+ client.cases.set_assignee(c.id, 12) # None = unassign
180
+ client.cases.link_evaluation(c.id, evaluation_id)
181
+ client.alerts.get(7)
182
+ client.alerts.acknowledge(7, "reviewed")
183
+ ```
184
+
185
+ ### Compliance and intelligence
186
+
187
+ ```python
188
+ client.compliance.check_travel_rule({...})
189
+ client.compliance.identify_vasp("ethereum", addr)
190
+ client.intelligence.get_entity_labels("ethereum", addr) # [] = no label known, NOT a clean verdict
191
+ ```
192
+
193
+ ### Account, capabilities, settings, monitoring
194
+
195
+ These calls accept an API key (plans without a feature get 403 `feature_not_in_plan`).
196
+
197
+ ```python
198
+ client.auth.me() # the calling identity (auth_method "API_KEY")
199
+ client.capabilities.get() # chains the API accepts + live layer state
200
+
201
+ # Settings: read-only with an API key (changing them needs a signed-in tenant administrator, in the app)
202
+ client.settings.get_score_thresholds() # review / block thresholds (defaults 40 / 70)
203
+ client.settings.get_score_threshold_audit(limit=20)
204
+ client.settings.get_name_matching() # CONSERVATIVE | BALANCED | STRICT
205
+ client.settings.get_name_matching_audit()
206
+ client.settings.get_name_lists() # allow / block entries
207
+ client.settings.get_name_list_audit()
208
+ client.settings.list_vendor_keys() # configured state, last four characters, fingerprint; never a key
209
+
210
+ # Monitoring
211
+ client.monitoring.get_overview()
212
+ client.monitoring.add_wallet({"address": "0x...", "chain": "ethereum", "label": "treasury"})
213
+ client.monitoring.list_wallets()
214
+ client.monitoring.remove_wallet(1)
215
+ client.monitoring.add_name({"name": "Jane Doe"})
216
+ client.monitoring.list_names()
217
+ client.monitoring.remove_name(1)
218
+ client.monitoring.list_breaches()
219
+ client.monitoring.get_breach_summary()
220
+ client.monitoring.acknowledge_breach(1)
221
+ ```
222
+
223
+ ### Webhooks
224
+
225
+ ```python
226
+ # registering, deleting and test-sending an endpoint is done by a signed-in user in the CryptaScreen app
227
+ hooks = client.webhooks.list()
228
+ client.webhooks.get_deliveries(hooks[0].id) # the last 50 deliveries, newest first
229
+ ```
230
+
231
+ Verify a delivery in your receiver (use the RAW body, not re-serialised JSON):
232
+
233
+ ```python
234
+ from cryptascreen import WebhookSignatureError, construct_webhook_event
235
+
236
+ try:
237
+ event = construct_webhook_event(
238
+ secret, raw_body, request_headers
239
+ ) # raises WebhookSignatureError
240
+ except WebhookSignatureError as e:
241
+ ... # e.code: WEBHOOK_SIGNATURE_MISSING | _MALFORMED | _MISMATCH | WEBHOOK_TIMESTAMP_OUT_OF_TOLERANCE
242
+ ```
243
+
244
+ Scheme: header `X-CryptaScreen-Signature-V2: t=<unix>,v1=<hex(HMAC-SHA256(secret, "<unix>." + body))>`, timestamp
245
+ tolerance 300 s (configurable, `tolerance=`), constant-time comparison. The legacy `X-CryptaScreen-Signature: sha256=<hex>` header has no
246
+ timestamp and is accepted only with `allow_legacy=True`.
247
+
248
+ ## Error Handling
249
+
250
+ ```python
251
+ from cryptascreen import (
252
+ AuthenticationError,
253
+ CryptaScreenError,
254
+ PlanLimitError,
255
+ QuotaExceededError,
256
+ RateLimitError,
257
+ ServicePausedError,
258
+ ValidationError,
259
+ )
260
+
261
+ try:
262
+ client.screening.screen_address({"address": "0x123", "chain": "ethereum"})
263
+ except ValidationError as e:
264
+ print(e.validation_code, e.field_errors, e.items) # INVALID_ADDRESS_FORMAT ...
265
+ except QuotaExceededError as e:
266
+ print(e.resets_at, e.upgrade_url) # the monthly plan quota: not retried
267
+ except RateLimitError as e:
268
+ print(e.retry_after_ms)
269
+ except CryptaScreenError as e:
270
+ print(e.status, e.code, e.request_id)
271
+ ```
272
+
273
+ | Status | Class | `code` |
274
+ |---|---|---|
275
+ | 400 | `ValidationError` | `VALIDATION_ERROR` |
276
+ | 401 | `AuthenticationError` | `AUTHENTICATION_ERROR` |
277
+ | 402 | `ServicePausedError` (`SERVICE_PAUSED`) / `CryptaScreenError` | `SERVICE_PAUSED` / `PAYMENT_REQUIRED` |
278
+ | 403 | `PlanLimitError` (`SeatLimitReachedError`, `ApiKeyLimitReachedError`) / `CryptaScreenError` | the limit code / `FORBIDDEN` |
279
+ | 404 | `NotFoundError` | `NOT_FOUND` |
280
+ | 429 | `RateLimitError` / `QuotaExceededError` | `RATE_LIMIT_EXCEEDED` / `QUOTA_EXCEEDED` |
281
+ | other | `CryptaScreenError` | the body's `code` or `UNKNOWN_ERROR` |
282
+
283
+ ## Retry Logic
284
+
285
+ The SDK retries 429 (except `quota_exceeded`) and every 5xx up to `max_retries` (default 3). The delay is the `Retry-After`
286
+ header (integer seconds) when present, otherwise exponential backoff 1 s, 2 s, 4 s ... capped at 30 s. 400, 401, 402, 403, 404 and
287
+ the monthly quota are never retried; network errors are not retried (`CryptaScreenError`, status 0, `UNKNOWN_ERROR`).
288
+
289
+ ## Development
290
+
291
+ ```bash
292
+ pip install -e ".[dev]"
293
+ ruff check src/ tests/
294
+ ruff format --check src/ tests/
295
+ mypy src/cryptascreen/ --ignore-missing-imports
296
+ pytest -v # unit + API parity (contract tests are skipped without a local stack)
297
+ python -m build # sdist + wheel
298
+ ```
299
+
300
+ Contract tests (`tests/contract/`) run against a LOCAL CryptaScreen stack only (`CS_CONTRACT_US`, `CS_CONTRACT_EU`, `CS_CONTRACT_KEY_US`,
301
+ `CS_CONTRACT_KEY_EU`, `CS_CONTRACT_KEY_RL`); never against production.
302
+
303
+ ## License
304
+
305
+ MIT - see [LICENSE](LICENSE).
@@ -0,0 +1,41 @@
1
+ cryptascreen/__init__.py,sha256=gven3VeTXTQi8zcRzWnqIVzJx6-KbRPnFit4IB9Pmlc,1669
2
+ cryptascreen/_util.py,sha256=16Mp8WmkAQdmDV-FpfD5nnZuMwDQQmTMNLtWYumeM9s,3544
3
+ cryptascreen/_version.py,sha256=AC-M7T01Tgn2lC34mAbSJ529AuLc0dlXeCfUNKY9-os,115
4
+ cryptascreen/client.py,sha256=_HYXM3FyB_3KWN1IjmlzYOfzne0HSL43sW_AtZ-qoXw,8111
5
+ cryptascreen/config.py,sha256=mGSIGLEOSG79WfyB7oQL9wJsq1alkbHilHDbPMBOGVg,1607
6
+ cryptascreen/errors.py,sha256=X6vU_GJWE7BWHotgjpV82jMuRe0YbHLD4LIlRyKj1tg,6471
7
+ cryptascreen/helpers.py,sha256=V0EqQOB77aDstT8YPwFt1AHfj3m6696vR-yE4NKkCoA,1781
8
+ cryptascreen/operations.py,sha256=7C_JTq5u7M0ZJ2U_cUmCUysmn0ZCLgu0qy0GmeB2AEM,6163
9
+ cryptascreen/retry.py,sha256=ywNyq3Ii4n7qKA4p5vdiOGmGcohvsreBW75w_3dgZB0,6723
10
+ cryptascreen/signature.py,sha256=f4bkXzDeH72Od9sSAJd_wuUmLdnCDitp_UYsx90gh9Q,4906
11
+ cryptascreen/resources/__init__.py,sha256=T2ZWaUC6j6WiYdMFrmIsN46tuh89yag7q9kTMg2DQ2M,21
12
+ cryptascreen/resources/alerts.py,sha256=ALeiQW8-QtcltQ7uC8MNjLUP7UUEJNAWuv0_jnqdd6E,1957
13
+ cryptascreen/resources/auth.py,sha256=O_nA8NIs0G5M3PN2Kkhhgxs4PkV5z1mP3BB7h57CKUs,1089
14
+ cryptascreen/resources/capabilities.py,sha256=0FqKs-pROZyDCn6c90o7kNwU2iklAZdkPzC7Yxk9fwo,1201
15
+ cryptascreen/resources/cases.py,sha256=JDHulUElNs5ZMeMYkeAA3UqHkUxq_wM6H-bc_ObfRCY,7641
16
+ cryptascreen/resources/compliance.py,sha256=EU52mu8OtmasXjvQZhXu3NUcrMRlVhtbyEt1kTd0tJo,4775
17
+ cryptascreen/resources/graph.py,sha256=b7o_nz2u1XHaxBzwYL6W-lSTd06CxTKcx4biVPx7MzE,2621
18
+ cryptascreen/resources/intelligence.py,sha256=MHyiPkGjUNVsEuf0DdZIKstJV65ZCoH44ezqq_Magjo,2935
19
+ cryptascreen/resources/monitoring.py,sha256=yXAksCpuGIPWj9Jwsm5lGAFTCv4Nmwe4Nsh2A2Lg9Lw,6780
20
+ cryptascreen/resources/names.py,sha256=jaJYqZzb7dgwEIIX1xj6EfY3eI_dNOlV3cb_k31QqjU,4031
21
+ cryptascreen/resources/sanctions.py,sha256=V429iY7tNDDoEkM16jgqunEU5f9Yb6dlLJ-snhDVp54,1791
22
+ cryptascreen/resources/screening.py,sha256=TUol-zmbCj85UsarqMjQlD5jXmmNefA1DJLV7yYU9d0,14392
23
+ cryptascreen/resources/settings.py,sha256=JZr36vtM4dv92FBhkRBuGxlqlQrzh1YKRic6zJsNBQU,5335
24
+ cryptascreen/resources/webhooks.py,sha256=uUtOvVg37RNOCGAAvtTSpTnwfO72FGa3NIjT6XfAE-w,2061
25
+ cryptascreen/types/__init__.py,sha256=Fgq0eEch42a0wpqpJKTNDXx8Bv7GtdC_VRInG_QO61w,7207
26
+ cryptascreen/types/_account.py,sha256=k80W4k3Qta0UUucbhc2nzgRjH3_myhK4Ncdgf__fpJM,6651
27
+ cryptascreen/types/_models.py,sha256=LLQvsH3NMCDIQTYzyD2O71YZgeXxwRXhAaubHumisYI,60390
28
+ cryptascreen/types/cases.py,sha256=WF7N3Mq6r6Jxv1koNSO38eg6pxJ8RMh_I7H75sZ1hZI,655
29
+ cryptascreen/types/common.py,sha256=V2Lj6_zR2qtAmOudR1Mg_pXPn4ypZGDMc935a_of2vY,350
30
+ cryptascreen/types/compliance.py,sha256=z2XjsMf4CvZdQ4pwryGkbz247tKhU6jOagWdne-tJ1k,648
31
+ cryptascreen/types/graph.py,sha256=YoL9TckiaXl3WK3kdloXCu-X5_5OTFRX3oyhJkP0cX0,479
32
+ cryptascreen/types/intelligence.py,sha256=kMNtLvTGkWIrH3KkMf3DO_xrwGk0KsygCR8QrTPIEGM,212
33
+ cryptascreen/types/names.py,sha256=axTheypoK3Zhds5t7iB2pO53Xb2LBIADDFu6N9_UPfM,871
34
+ cryptascreen/types/sanctions.py,sha256=skaVXPtZp_9JfbxMeNcFp4jTimxzcuXucuZRtv6Phx8,315
35
+ cryptascreen/types/screening.py,sha256=LdYK27QMfc8cviAhQdOSoOtYXlQ-RjZbCxEvRY8A7hM,1607
36
+ cryptascreen/types/wallet.py,sha256=NtF0-trY4el0JoSTjbTEkw8Rar9zcVTI4pCs914dXdw,2132
37
+ cryptascreen/types/webhooks.py,sha256=-pNMaH0Qinnqqc8CUWebbBG8LapEunVD73Osn5u3mEY,272
38
+ cryptascreen-0.2.0.dist-info/METADATA,sha256=MtxjNYt1amfD-5qYMEed5iX67hjSxjSbHpB8I0_w0aM,11519
39
+ cryptascreen-0.2.0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
40
+ cryptascreen-0.2.0.dist-info/licenses/LICENSE,sha256=A35BDnaGvRL96sEubDG-9LFdiGohKRvVLwJ_RfYiyp0,1073
41
+ cryptascreen-0.2.0.dist-info/RECORD,,