npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

crypto-aml

v0.1.0

Published

Crypto AML / KYT JavaScript SDK for the AnChain.AI Data API — wallet screening, risk scores, and OFAC sanctions checks.

Readme

crypto-aml

JavaScript SDK for crypto AML / KYT against the AnChain.AI Data API. Screen wallets, score blockchain risk, and run OFAC SDN checks by name, passport, or crypto address.

| | | | -------- | --- | | Install | npm install crypto-aml | | API base | https://api.anchainai.com | | Auth | x-api-key: <YOUR_KEY> | | Runtime | Node.js ≥ 18 (native fetch) | | Dependencies | none |

Get a free API key at data.anchainai.com.

Install

npm install crypto-aml
# from this repo
cp .env.example .env   # set ANCHAIN_API_KEY
npm test
npm run example:start
npm run example:screen

Quick start

import { AnChainClient, screenAndDecide } from "crypto-aml";

const client = new AnChainClient(); // reads ANCHAIN_API_KEY
const result = await screenAndDecide(
  client,
  "eth",
  "0x2f389ce8bd8ff92de3402ffce4691d17fc4f6535",
);

console.log(result.summary());
// → [BLOCK] ETH 0x2f38… | score=100 level=4 | categories=[wallet, exchange, sanction] | …

if (result.shouldBlock) {
  // refuse withdrawal / deposit
}

OFAC sanctions

const byName = await client.searchOfac({ name: "chen zhi", type: "individual" });
const byId = await client.searchOfac({ id: "K00395168", type: "individual" });
const byWallet = await client.screenOfacAddress(
  "bc1qeth6n6ryxexvkx34wnx3nuynun4474h3j0gkhw",
);

Credits

Every intel call returns credit headers on response.credits and client.lastCredits:

const label = await client.getAddressLabel("btc", "1NDyJtNTjmwk5xPNhjgAMu4HDHigtobu1s");
console.log(label.credits);
// → { remaining: 969760, expiresAt: '2027-03-21T…', source: 'headers' }

| Endpoint | Method | Credits | | -------- | ------ | ------: | | /api/intel/address/label | GET | 5 | | /api/intel/address/score | GET | 10 | | /api/sanctions/ofac/address | GET | 5 | | /api/sanctions/ofac/search | POST | 10 |

KYT policy

Default screenAndDecide / decide rules:

  1. BLOCK if category ∈ {sanction, mixer, ransomware, terrorism, darknet market, hacker, scam, malware, blackmail}
  2. ALLOW trusted labels (exchange, miner, validator, defi, …) when only those (+ whale / wallet) are present — disable with ANCHAIN_TRUST_EXCHANGES=0
  3. BLOCK if score ≥ 80 (ANCHAIN_BLOCK_SCORE_THRESHOLD)
  4. REVIEW if score ≥ 51 (ANCHAIN_REVIEW_SCORE_THRESHOLD)
  5. ALLOW otherwise

Busy exchange hot wallets often show high exposure scores; the SDK prefers the label (and prints optional risk_vasp) unless a hard-block category is also present.

API surface

import {
  AnChainClient,
  AnChainError,
  screenAndDecide,
  decide,
  parseScoreResponse,
  CREDIT_COSTS,
  DECISIONS,
} from "crypto-aml";

| Export | Role | | ------ | ---- | | AnChainClient | HTTP client (getAddressLabel, getAddressScore, searchOfac, screenOfacAddress) | | screenAndDecide(client, proto, address) | Label + score → ScreeningResult | | decide(result) | Apply ALLOW / REVIEW / BLOCK policy | | parseScoreResponse(proto, address, apiResponse) | Normalize nested API payload | | CREDIT_COSTS | Documented per-call credit costs |

TypeScript types ship in src/index.d.ts.

Layout

src/
  client.js      # AnChainClient + credit headers
  risk.js        # parse + KYT policy
  index.js       # public exports
  index.d.ts     # TypeScript types
examples/
  01_get_started.js
  02_screen_address.js
  03_raw_api_dump.js
test/

Publish

npm test
npm pack --dry-run
npm publish --access public

Bump with npm version patch|minor|major, then publish again. Prefer npm Trusted Publishing (OIDC) from GitHub Actions for CI releases.

License

Apache-2.0 — Copyright 2026 AnChain.AI