Skip to main content

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.05
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.05
chainanalyzer_freeze_status Has a stablecoin issuer (USDT, USDC, JPYC …) frozen it? (Ethereum, Polygon, Avalanche, TRON) $0.02
chainanalyzer_risk_score Full AML risk score (76+ detection rules + ML), with free hack-exposure and freeze summaries $0.10
chainanalyzer_hack_exposure_batch (opt-in) Known-hack exposure for up to 50 addresses $1.00

Prices from 2026-11-16. Pay per call in USDC on Base via x402 — no account, no signup — or use a ChainAnalyzer API key. Use a key whose address has no EIP-7702 delegation: a delegated (smart-account) address can fail the USDC signature check on Base and the payment is rejected.

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 $1.00 batch tool (the default max_usd_per_call covers it).
  • 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-mcp and Vercel AI SDK tools @chainanalyzer/ai-sdk.

MIT License

Metadata

Release files for langchain-chainanalyzer 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for langchain-chainanalyzer 0.1.1
File Size Uploaded Provenance Actions
langchain_chainanalyzer-0.1.1.tar.gz 8.9 kB Without provenance Details for langchain_chainanalyzer-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for langchain-chainanalyzer 0.1.1
File Interpreter ABI Platform Actions
langchain_chainanalyzer-0.1.1-py3-none-any.whl Python 3 none any Details for langchain_chainanalyzer-0.1.1-py3-none-any.whl

Total release size: 19.4 kB

Release files / langchain_chainanalyzer-0.1.1.tar.gz

Download URL langchain_chainanalyzer-0.1.1.tar.gz
Size 8.9 kB
Tags Source
SHA-256 checksum
How to use checksums
4b3142a0ba4965fa5f25af410ed53576089a4fd8216e416d86132ccc29d6b55f
BLAKE2b-256 checksum
How to use checksums
73f871e7f518db6c78703be1f6893ea053847bef8286d86d810e06751164d384
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / langchain_chainanalyzer-0.1.1-py3-none-any.whl

Download URL langchain_chainanalyzer-0.1.1-py3-none-any.whl
Size 10.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
51a25f991cb2c580a73f04f884130040960cc78107c8f0a1d1cc9d797ce6bb13
BLAKE2b-256 checksum
How to use checksums
0bf23ebb16e341773ca88d9ba72f57fabf8160f86e00ed88b61730b8b44d07c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for langchain-chainanalyzer 0.1.1

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.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page