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

scanai-sdk

v0.1.0

Published

![enter image description here](https://www.scanai.cc/thumbnail.png)

Downloads

8

Readme

SCANAI SDK

enter image description here

Official TypeScript/JavaScript SDK for integrating SCANAI token risk and survival analysis into BNB Chain applications.

Installation

npm install @scanai/sdk
yarn add @scanai/sdk
pnpm add @scanai/sdk

Quick Start

import { ScanAI } from '@scanai/sdk';



// Initialize the client

const scanai = new ScanAI({

apiKey: 'your-api-key', // Optional: can use SCANAI_API_KEY env var

});



// Scan a token

const scan = await scanai.scanToken({

address: "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",

atBlock: 12345678, // Optional: analyze at specific block

});



// Check results

if (scan.risk.band === "critical" || scan.survival.state === "dead") {

// Block swap, show warning, whatever your app needs

console.warn("⚠️ High risk token detected!");

}

\`\`\`

Usage Examples

Basic Token Scan

const result = await scanai.scanToken({

address: "0x...",

});



console.log(`Risk Level: ${result.risk.band}`);

console.log(`Risk Score: ${result.risk.score}/100`);

console.log(`Survival State: ${result.survival.state}`);

console.log(`Survival Probability: ${result.survival.probability}%`);

Historical Analysis

// Analyze token at a specific block

const historicalScan = await scanai.scanToken({

address: "0x...",

atBlock: 12000000,

includeHistory: true,

});

Quick Safety Check

// Simple boolean check for trading safety

const isSafe = await scanai.isSafeToTrade("0x...");



if (!isSafe) {

throw new Error("Cannot proceed with swap - token flagged as unsafe");

}

Batch Scanning

// Scan multiple tokens at once

const tokens = ["0x...", "0x...", "0x..."];

const results = await scanai.batchScan(tokens);



// Filter for high-risk tokens

const dangerous = results.filter(

r => r.risk.band === "critical" || r.risk.band === "high"

);

Wallet Integration Example

import { ScanAI } from '@scanai/sdk';



class WalletSecurityLayer {

private scanai: ScanAI;



constructor() {

this.scanai = new ScanAI({ apiKey: process.env.SCANAI_API_KEY });

}



async validateSwap(tokenAddress: string): Promise<boolean> {

const scan = await this.scanai.scanToken({ address: tokenAddress });

// Block critical and dead tokens

if (scan.risk.band === "critical") {

throw new Error(`Token flagged as critical risk: ${scan.risk.summary}`);

}

if (scan.survival.state === "dead") {

throw new Error("Token appears to be dead - no trading activity");

}

// Warn on high risk

if (scan.risk.band === "high") {

console.warn("⚠️ High risk token detected", scan.risk.flags);

return false; // Let user decide

}

return true;

}

}

DeFi Dashboard Integration

import { ScanAI } from '@scanai/sdk';



async function analyzePortfolio(tokenAddresses: string[]) {

const scanai = new ScanAI();

const scans = await scanai.batchScan(tokenAddresses);

return {

total: scans.length,

safe: scans.filter(s => s.risk.band === "safe").length,

risky: scans.filter(s => ["high", "critical"].includes(s.risk.band)).length,

dead: scans.filter(s => s.survival.state === "dead").length,

details: scans,

};

}

API Reference

ScanAI

Main SDK client class.

Constructor

new ScanAI(config?: ScanAIConfig)

Config Options:

  • apiKey?: string - API key (or set SCANAI_API_KEY env var)

  • endpoint?: string - Custom API endpoint (defaults to production)

  • timeout?: number - Request timeout in ms (default: 30000)

  • debug?: boolean - Enable debug logging (default: false)

Methods

scanToken(options: ScanOptions): Promise<ScanResult>

Scan a token for risk and survival analysis.

Options:

  • address: string - Token contract address (required)

  • atBlock?: number - Specific block to analyze

  • includeHistory?: boolean - Include historical data

  • chain?: "bsc" | "bnb" - Blockchain network

Returns: Complete scan results including risk and survival analysis.

batchScan(addresses: string[], options?): Promise<ScanResult[]>

Scan multiple tokens in parallel.

isSafeToTrade(address: string, options?): Promise<boolean>

Quick safety check returning true if token is safe to trade.

Types

RiskBand

type RiskBand = "safe" | "low" | "medium" | "high" | "critical";

SurvivalState

type SurvivalState = "alive" | "warning" | "zombie" | "dead";

ScanResult

interface ScanResult {

token: TokenMetadata;

risk: RiskAnalysis;

survival: SurvivalAnalysis;

scannedAtBlock: number;

timestamp: number;

}

Environment Variables

Optional: API key for authentication

**SCANAI_API_KEY=your_api_key_here**

Integration Use Cases

  • Wallets: Pre-transaction safety checks

  • DEX Aggregators: Token risk warnings before swaps

  • Portfolio Managers: Continuous monitoring of held assets

  • Block Explorers: Display risk metrics on token pages

  • DeFi Protocols: Automated risk-based restrictions

Error Handling

try {

const scan = await scanai.scanToken({ address: "0x..." });

} catch (error) {

if (error.message.includes("Invalid token address")) {

// Handle validation error

} else if (error.message.includes("timeout")) {

// Handle timeout

} else {

// Handle API error

}

}

Support

License

MIT