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

@thebadlab/sdk-onchain

v1.0.0

Published

Blockchain intelligence SDK with multi-AI provider support for token analysis, wallet profiling, smart contract explanation, and whale tracking

Readme

TheBadLab SDK

enter image description here

A powerful TypeScript/JavaScript SDK for blockchain intelligence with multi-AI provider support. Get token insights, analyze wallets, explain smart contracts, track whale activity, and query blockchain data using natural language.

Features

  • Multi-AI Provider Support: Integration with OpenAI, xAI (Grok), and Google Gemini
  • Token Intelligence: Get real-time market data, price information, and AI-powered insights
  • Smart Contract Analysis: Explain smart contracts in natural language with AI
  • Wallet Profiling: Analyze wallet activity, holdings, and behavior patterns
  • Whale Tracking: Detect and monitor large token holders
  • Natural Language Queries: Ask questions about tokens, wallets, and contracts in plain English
  • Market Insights: Access price data, market cap, volume, and trends

Installation

npm install @thebadlab/sdk-onchain

Quick Start

import { TheBadLab } from '@thebadlab/sdk-onchain';

const sdk = new TheBadLab({
  aiProviders: [
    {
      name: 'openai',
      apiKey: 'your-openai-api-key',
      model: 'gpt-4-turbo'
    }
  ],
  defaultProvider: 'openai',
  etherscanApiKey: 'your-etherscan-api-key'
});

const response = await sdk.query('What is the price of USDC?');
console.log(response.answer);

const tokenInfo = await sdk.tokens.getTokenInsights('0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48');
console.log(tokenInfo);

Configuration

Required API Keys

  • AI Provider API Key: At least one AI provider (OpenAI, xAI, or Gemini)
  • Etherscan API Key: For blockchain data (optional but recommended)

Configuration Options

interface TheBadLabConfig {
  aiProviders: AIProviderConfig[];
  defaultProvider?: 'openai' | 'xai' | 'gemini';
  blockchainRpcUrl?: string;
  etherscanApiKey?: string;
}

Core Modules

Token Module

Get token information, market data, and search for tokens.

Wallet Module

Profile wallets, detect whales, and analyze holder behavior.

Contract Module

Retrieve smart contract details, source code, and ABI.

AI Providers

  • OpenAI: GPT-4, GPT-3.5 Turbo
  • xAI: Grok models
  • Gemini: Google's AI models

Key Methods

Natural Language Queries

await sdk.query('question', 'provider');

Token Analysis

await sdk.getTokenInsights('address');
await sdk.searchTokens('query');

Wallet Analysis

await sdk.analyzeWallet('address');
await sdk.findWhales('tokenAddress');

Contract Analysis

await sdk.explainContract('address');
await sdk.analyzeContract('address');

Use Cases

  • Build AI-powered crypto analytics platforms
  • Create intelligent trading bots with natural language understanding
  • Develop wallet monitoring and alert systems
  • Build smart contract audit and explanation tools
  • Create whale tracking and portfolio analysis applications

Architecture

src/
├── TheBadLab.ts          # Main SDK class
├── index.ts              # Public exports
├── providers/            # AI provider integrations
│   ├── OpenAIProvider.ts
│   ├── xAIProvider.ts
│   └── GeminiProvider.ts
├── modules/              # Blockchain intelligence modules
│   ├── TokenModule.ts
│   ├── WalletModule.ts
│   └── ContractModule.ts
├── types/                # TypeScript type definitions
│   └── index.ts
└── utils/                # Helper utilities
    └── helpers.ts

Requirements

  • Node.js 16+
  • TypeScript 4.5+ (for development)
  • At least one AI provider API key
  • Etherscan API key (optional)

License

MIT

Support

For issues, questions, or contributions, please visit the repository.

Examples

See HOWTOUSE.md for detailed examples and use cases.