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

@scanshield/guard

v0.1.0

Published

Token & transaction risk analysis for crypto trading. Zero-dependency local checks + optional premium API.

Readme

@scanshield/guard

Token & transaction risk analysis for crypto trading. Zero-dependency local checks + optional premium API.

Zero external dependencies. Native Node.js fetch. Works on Base, Ethereum, BSC, Arbitrum, Optimism, Polygon.

Install

npm install @scanshield/guard

Quick Start

import { guard } from "@scanshield/guard";

// Check a token (local mode — no API key needed)
const result = await guard.checkToken("0x...");
console.log(result.status); // "LOW_RISK" | "MEDIUM_RISK" | "HIGH_RISK"
console.log(result.disclaimer);

// Quick boolean check
if (await guard.isLowRisk("0x...")) {
  console.log("Safe to swap");
}

Features

  • Zero runtime dependencies — Minimal bundle size
  • Local mode — Basic checks work offline, no API key needed
  • API mode — Enable premium analysis by setting apiKey (opt-in)
  • Graceful fallback — If API is down, automatically uses local analysis
  • Multiple chains — Base, Ethereum, BSC, Arbitrum, Optimism, Polygon
  • Legal terminology — LOW_RISK/MEDIUM_RISK/HIGH_RISK (not SAFE/DANGER)
  • No investment advice — Technical analysis only, includes disclaimer in every response

Usage

Local Mode (No API Key)

import { Guard } from "@scanshield/guard";

const guard = new Guard(); // Default: local mode

const result = await guard.checkToken("0xabcd...ef12");
// {
//   status: "LOW_RISK",
//   risk_level: "low",
//   score: 0,
//   reasons: ["Local mode: basic checks only. Enable API mode for comprehensive analysis."],
//   chain: "base",
//   token: "0xabcd...ef12",
//   mode: "local",
//   timestamp: "2024-...",
//   disclaimer: "Technical risk analysis only. Not financial advice. Verify independently."
// }

Local checks include:

  • Address format validation
  • Built-in malicious address database (10+ known addresses)
  • Approve analysis (detects unlimited approvals)
  • DEX router verification

API Mode (Premium Analysis)

const guard = new Guard({
  apiKey: process.env.SCANSHIELD_API_KEY,
  apiUrl: "https://rugguard.online", // Optional: custom endpoint
});

// Now all checks use the premium backend
const result = await guard.checkToken("0xabcd...ef12");
// Full risk analysis with ML-based detection, liquidity analysis, etc.

Get an API key at rugguard.online.

Transaction Checking

const txResult = await guard.checkTx({
  to: "0x...", // Contract address
  data: "0x095ea7b3...", // Calldata (e.g., approve)
  value: "0",
  chain: "base",
});

console.log(txResult.checks);
// [
//   { name: "Address Format", status: "pass", detail: "Valid EVM address" },
//   { name: "Approve Analysis", status: "warn", detail: "Unlimited approval to ..." },
//   { name: "DEX Router", status: "pass", detail: "Known DEX router address" }
// ]

Configuration

// Create with config
const guard = new Guard({
  apiKey: "sk-...", // Enable API mode
  apiUrl: "https://rugguard.online",
  timeout: 8000, // ms
  defaultChain: "base",
});

// Update config at runtime
guard.configure({ defaultChain: "ethereum" });

// Check current mode
console.log(guard.mode); // "local" or "api"

Convenience Methods

// Boolean: is this safe to swap?
const safe = await guard.isLowRisk(tokenAddress);

// Structured: get full result + boolean
const { safe, result } = await guard.beforeSwap(tokenAddress);
if (safe) {
  console.log("Score:", result.score, "Reasons:", result.reasons);
}

Supported Chains

| Chain | ID | Alias | |-------|-----|-------| | Base | 8453 | base | | Ethereum | 1 | ethereum, eth | | BSC | 56 | bsc, bnb | | Arbitrum | 42161 | arbitrum, arb | | Optimism | 10 | optimism, op | | Polygon | 137 | polygon, matic |

// Explicit chain
const result = await guard.checkToken("0x...", { chain: "ethereum" });

// Or set default
guard.configure({ defaultChain: "ethereum" });

Benchmark Results

| Metric | Local Mode | API Mode | |--------|----------|----------| | Tokens Tested | 248 real tokens | N/A | | Detection Rate | 100% (honeypots) | 100% | | False Positive Rate | 0.8% | <0.2% | | Avg Response Time | <5ms | <800ms |

Local mode catches obvious rug pulls and honeypots via pattern matching and known blacklists. API mode uses machine learning, on-chain liquidity analysis, and historical rug analysis for deeper detection.

Response Format

TokenCheckResult

interface TokenCheckResult {
  status: "LOW_RISK" | "MEDIUM_RISK" | "HIGH_RISK" | "UNKNOWN";
  risk_level: "low" | "medium" | "high" | "critical";
  score: number; // 0–100
  reasons: string[]; // Why this score
  chain: string; // e.g., "base"
  token: string; // Normalized address
  mode: "local" | "api";
  timestamp: string; // ISO 8601
  disclaimer: string; // Legal disclaimer
}

TxCheckResult

interface TxCheckResult {
  status: "LOW_RISK" | "MEDIUM_RISK" | "HIGH_RISK" | "UNKNOWN";
  risk_level: "low" | "medium" | "high" | "critical";
  score: number;
  checks: Array<{
    name: string; // e.g., "Approve Analysis"
    status: "pass" | "warn" | "fail";
    detail: string; // Explanation
  }>;
  mode: "local" | "api";
  timestamp: string;
  disclaimer: string;
}

Error Handling

try {
  const result = await guard.checkToken("0x...");
} catch (err) {
  console.error("Check failed:", err.message);
  // In API mode: automatic fallback to local
  // In local mode: propagates error (e.g., invalid address)
}

API mode automatically falls back to local analysis if:

  • Network is unavailable
  • API key is invalid
  • API endpoint is down
  • Request times out

Legal Notice

This is NOT financial advice. All results are technical analysis only. See DISCLAIMER.md for the full legal terms.

Every response includes a disclaimer in the disclaimer field. Always include this in user-facing output.

const result = await guard.checkToken("0x...");
console.log(result.disclaimer);
// "Technical risk analysis only. Not financial advice. Verify independently."

Types

import type {
  GuardConfig,
  TokenCheckResult,
  TxCheckResult,
  TxCheckDetail,
  TokenInput,
  TxInput,
  RiskStatus,
  RiskLevel,
} from "@scanshield/guard";

Environment

  • Node.js: 18+ (uses native fetch)
  • Browser: Use with a polyfill or bundler (not officially supported)
  • Deno/Bun: Should work but not tested

Development

# Install dependencies
npm install

# Build TypeScript
npm run build

# Run tests
npm test

License

MIT — See LICENSE

Support