langchain-chainanalyzer
LangChain tools for ChainAnalyzer blockchain AML screening. Let an agent screen a crypto address before it credits a deposit, sends a payout or onboards a counterparty — across Bitcoin, Ethereum and EVM L2s, Solana, TRON, XRP and Kaia (12 chains).
| Tool | What it answers | Price (x402) |
|---|---|---|
chainanalyzer_sanctions_check |
Is the address on a sanctions list (OFAC, EU, UK, UN, JFSA) or in ScamDB? | $0.50 |
chainanalyzer_hack_exposure |
Is it connected to a known hack (e.g. the 2026 Binance hack)? Hops from the attacker, role, lower-bound amounts | $0.50 |
chainanalyzer_freeze_status |
Has a stablecoin issuer (USDT, USDC, JPYC …) frozen it? | $0.10 |
chainanalyzer_risk_score |
Full AML risk score (76+ detection rules + ML), with free hack-exposure and freeze summaries | $1.00 |
chainanalyzer_hack_exposure_batch (opt-in) |
Known-hack exposure for up to 50 addresses | $5.00 |
Pay per call in USDC on Base via x402 — no account, no signup — or use a ChainAnalyzer API key.
Install
pip install langchain-chainanalyzer # API-key mode
pip install "langchain-chainanalyzer[x402]" # + pay per call in USDC (x402)
Use
from langchain.agents import create_agent
from langchain_chainanalyzer import ChainAnalyzerToolkit
tools = ChainAnalyzerToolkit(max_usd_per_call="1.00").get_tools()
agent = create_agent("openai:gpt-5-mini", tools=tools)
result = await agent.ainvoke({"messages": [{
"role": "user",
"content": "A user wants to deposit from 0x5227f603c1ee34ce3c06efe6477003bdfccb2f8c (Ethereum). "
"Screen it (sanctions first, then hack exposure) and answer CREDIT, REVIEW or HOLD with reasons.",
}]})
Each tool also works on its own: await tools[1].ainvoke({"address": "0x5227f603c1ee34ce3c06efe6477003bdfccb2f8c"}).
Auth and safety
| Argument | Environment variable | Notes |
|---|---|---|
api_key |
CHAINANALYZER_API_KEY |
tfk_… key from chain-analyzer.com → Account → API Keys. Wins if both are set. |
private_key |
X402_PRIVATE_KEY |
Hex key of a dedicated low-balance wallet with USDC on Base mainnet (needs the x402 extra). |
max_usd_per_call |
CHAINANALYZER_MAX_USD_PER_CALL |
Cap per payment, enforced before signing. Default 1.00. |
dry_run |
CHAINANALYZER_DRY_RUN=1 |
Stop before signing and return the quoted price. |
include_batch |
— | Adds the $5.00 batch tool (also raise max_usd_per_call to 5.00). |
- Results are automated screening signals, not a legal determination. Hack exposure is a lower-bound taint over published incidents only; no match (or no freeze) is not proof that funds are clean. Keep a human in the loop.
- Failed requests are not charged. Live routes and prices: https://chain-analyzer.com/x402/api/discover
- Also available: MCP server
chainanalyzer-mcpand Vercel AI SDK tools@chainanalyzer/ai-sdk.
MIT License
Metadata
Release files for langchain-chainanalyzer 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| langchain_chainanalyzer-0.1.0.tar.gz | 8.8 kB | Without provenance | Details for langchain_chainanalyzer-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| langchain_chainanalyzer-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for langchain_chainanalyzer-0.1.0-py3-none-any.whl |
Total release size: 19.2 kB
Release files / langchain_chainanalyzer-0.1.0.tar.gz
| Download URL | langchain_chainanalyzer-0.1.0.tar.gz |
|---|---|
| Size | 8.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a15d26598017e139363cbc4baea8ca6de095fe55e73d85f116efb17656bed79f
|
|
BLAKE2b-256 checksum How to use checksums |
8e2fbe1282b3bf1d4d772b3a812f186aeaa15adc07ec968ad7c9a8eca9f80f76
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.13
|
Release files / langchain_chainanalyzer-0.1.0-py3-none-any.whl
| Download URL | langchain_chainanalyzer-0.1.0-py3-none-any.whl |
|---|---|
| Size | 10.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e26668da2e5bb17b624124d85586be8e1de55fa9de7f5d51dca4226101e12abd
|
|
BLAKE2b-256 checksum How to use checksums |
cb554ddd20ea932d0c0c3c0d9f58b6d0aa974645ae079dcca1c1326182340eb6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.13
|
Security for langchain-chainanalyzer 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.