Official Python SDK for Veria Compliance API - wallet screening, sanctions checks, KYC/AML
Project description
Veria SDK for Python
Official SDK for the Veria Compliance API - screen wallet addresses for sanctions, PEP, and AML compliance.
Installation
pip install veria
Quick Start
from veria import VeriaClient
client = VeriaClient(api_key="veria_live_xxxxxxxxxxxx") # Get yours at https://protocol.veria.cc
# Screen an address
result = client.screen("0x742d35Cc6634C0532925a3b844Bc454e4438f44e")
print(f"Risk: {result.risk}, Score: {result.score}")
# Check if should block
if result.should_block():
print("Transaction blocked for compliance")
Features
- Full type hints for IDE support
- Supports Ethereum addresses, ENS names, Solana addresses, and IBANs
- Configurable timeout and base URL
- Proper error handling with typed exceptions
- Context manager support for automatic cleanup
API
VeriaClient(api_key, base_url=None, timeout=30)
Create a new Veria client.
client = VeriaClient(
api_key="veria_live_xxx", # Required: Your API key
base_url="https://api.veria.cc", # Optional: API base URL
timeout=30, # Optional: Request timeout in seconds
)
client.screen(input)
Screen an address for compliance risks.
result = client.screen("vitalik.eth")
Returns ScreenResult:
ScreenResult(
score=15, # Risk score 0-100
risk="low", # "low" | "medium" | "high" | "critical"
chain="ethereum", # Detected blockchain
resolved="0x742d35...", # Resolved address
latency_ms=45, # Processing time
details=ScreenDetails(
sanctions_hit=False, # On sanctions list?
pep_hit=False, # Politically exposed person?
watchlist_hit=False, # On any watchlist?
checked_lists=["OFAC SDN", "UN Consolidated", ...],
address_type="wallet", # wallet | contract | exchange | mixer
),
)
result.should_block()
Helper to determine if an address should be blocked.
result = client.screen(address)
if result.should_block():
# Block the transaction
pass
Returns True if:
sanctions_hitisTrue, ORriskis"high"or"critical"
Risk Levels
| Level | Score | Recommended Action |
|---|---|---|
| low | 0-29 | Proceed |
| medium | 30-59 | Review |
| high | 60-79 | Block recommended |
| critical | 80-100 | Block required |
Error Handling
from veria import VeriaClient, VeriaError
try:
result = client.screen(address)
except VeriaError as e:
print(f"Error: {e.code} - {e}")
# Handle specific error codes
if e.code == "INVALID_API_KEY":
# Re-authenticate
pass
elif e.code == "RATE_LIMIT_EXCEEDED":
# Back off and retry
pass
elif e.code == "TIMEOUT":
# Retry with longer timeout
pass
Context Manager
The client supports context manager protocol for automatic cleanup:
with VeriaClient(api_key="veria_live_xxx") as client:
result = client.screen(address)
# Session automatically closed
Usage Examples
Pre-transaction screening
from veria import VeriaClient, VeriaError
client = VeriaClient(api_key="veria_live_xxx")
def safe_transfer(to_address: str, amount: float) -> bool:
"""Screen recipient before transfer."""
result = client.screen(to_address)
if result.should_block():
raise ValueError(
f"Recipient blocked: {result.risk} risk, "
f"sanctions: {result.details.sanctions_hit}"
)
# Proceed with transfer
return True
Batch screening
addresses = [
"0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
"0x8576acc5c05d6ce88f4e49bf65bdf0c62f91353c",
"vitalik.eth",
]
for address in addresses:
try:
result = client.screen(address)
status = "BLOCKED" if result.should_block() else "OK"
print(f"{address[:12]}... {status} (score: {result.score})")
except VeriaError as e:
print(f"{address[:12]}... ERROR: {e.code}")
Django middleware example
from veria import VeriaClient
from django.conf import settings
client = VeriaClient(api_key=settings.VERIA_API_KEY)
class ComplianceMiddleware:
def __init__(self, get_response):
self.get_response = get_response
def __call__(self, request):
wallet = request.headers.get("X-Wallet-Address")
if wallet:
result = client.screen(wallet)
if result.should_block():
return JsonResponse(
{"error": "Wallet blocked for compliance"},
status=403
)
return self.get_response(request)
Resources
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file veria-0.1.0.tar.gz.
File metadata
- Download URL: veria-0.1.0.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7b3e5cbe2dff3f147e82480f7da0dd2ff63619309f0b05a4c75b0f950c10bf29
|
|
| MD5 |
1e176c611cf1ee1acd5000264e0c5b97
|
|
| BLAKE2b-256 |
cb92d778a8a3f3896e7689ccff71a9f4889f8b21a2eee27426a747d84b7e76fd
|
File details
Details for the file veria-0.1.0-py3-none-any.whl.
File metadata
- Download URL: veria-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d05d83bb7e770f6b575d4c1e7230a2062d55ebfed4abb4d96c9a0f3256291bd9
|
|
| MD5 |
a38f977e20fb1bfe90da6684cd06e0f8
|
|
| BLAKE2b-256 |
c005d42502cd2c3b7a4c1a632eb13e6debf409f4d4557e31f3f9b88643b8da42
|