Skip to main content

Official WalletDNA SDK — wallet screening (allow / review / block), batch screening, and signed webhook verification.

Project description

walletdna (Python)

Official Python SDK for the WalletDNA API — screen any wallet for sanctions and high‑risk exposure, get a clear allow / review / block decision, and verify signed webhooks. Standard library only, no dependencies.

API access requires an Advanced or Enterprise plan. Create an API key at https://walletdna.com/developer.

Install

pip install walletdna

Requires Python 3.8+.

Screen a wallet

import os
from walletdna import WalletDNA

wdna = WalletDNA(os.environ["WALLETDNA_API_KEY"])

verdict = wdna.screen("0x722122dF12D4e14e13Ac3b6895a86e84145b6967")
print(verdict["decision"])  # "allow" | "review" | "block"

if verdict["decision"] == "block":
    ...  # reject the deposit / withdrawal

Custom thresholds & auto‑monitoring

verdict = wdna.screen(
    address,
    thresholds={"review": 40, "block": 75},  # map riskScore -> decision (sanctioned always blocks)
    monitor=True,                              # also watch this wallet and webhook me on changes
)

Batch (up to 25 addresses)

resp = wdna.screen_batch([addr_a, addr_b, addr_c])
blocked = [r for r in resp["results"] if r.get("decision") == "block"]

Webhooks

Register an endpoint (the signing secret is returned once — store it):

hook = wdna.create_webhook(
    "https://api.acme.com/walletdna",
    events=["wallet.risk_changed", "wallet.sanctioned"],
)
secret = hook["secret"]

Verify incoming events with the raw request body and the WalletDNA-Signature header (Flask example):

from flask import Flask, request, abort
from walletdna import verify_webhook

app = Flask(__name__)

@app.post("/walletdna")
def walletdna_webhook():
    raw = request.get_data(as_text=True)
    if not verify_webhook(raw, request.headers.get("WalletDNA-Signature", ""), WDNA_WEBHOOK_SECRET):
        abort(400)
    event = request.get_json()
    # event["type"], event["data"] (a screening verdict + previousScore/label/reportUrl)
    return "", 200

Errors

Failed requests raise WalletDNAError with .status, .code, and .body. A 429 means you've hit your monthly API limit — add credits in the dashboard.

Reference

Full OpenAPI spec: https://walletdna.com/api/openapi · Docs: https://walletdna.com/docs/api

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

walletdna-1.0.0.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

walletdna-1.0.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file walletdna-1.0.0.tar.gz.

File metadata

  • Download URL: walletdna-1.0.0.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for walletdna-1.0.0.tar.gz
Algorithm Hash digest
SHA256 76fa15f61aefdfb7f18dc58c4e70a6b32b102c3ecdb2f363ba87888bb966a482
MD5 12edcfdf0afc725de2d63a92a3a5d594
BLAKE2b-256 b5db4049b5a7045a098c0a5d65b11cf9ff42ceb04574981b1d46c47aa0929eba

See more details on using hashes here.

File details

Details for the file walletdna-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: walletdna-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for walletdna-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a7767ca4a24739dcf1122cf1009b6389e44617afa2560927b4f227f573c6e7e2
MD5 73b3fe280f3525f2ffceb68f963a810c
BLAKE2b-256 37942fc85d14c2afc72bb66b7278511062b13a98905628518087619854add83b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page