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

flexo-sdk

v1.0.0

Published

Official TypeScript SDK for the Flexo API - AI-powered Solana token analytics

Readme

Flexo SDK

TypeScript Solana OpenAI Node.js

Version License: MIT Maintenance

Installation

npm install flexo-sdk
# or
yarn add flexo-sdk

Quick Start

import FlexoClient from 'flexo-sdk';

// Initialize the client
const client = new FlexoClient();

// Analyze a token
const analysis = await client.getToken('token-address');
console.log(`Token Score: ${analysis.data.score}`);

🔧 Core Features

  • Token Analytics: Deep analysis of Solana tokens
  • Risk Assessment: Advanced risk scoring and indicators
  • AI Agents: Interactive AI-powered analysis
  • Batch Processing: Efficient multi-token analysis
  • Real-time Data: Live on-chain analytics

📊 Token Analysis Example

import FlexoClient from 'flexo-sdk';

async function analyzeToken(address: string) {
  const client = new FlexoClient();
  const analysis = await client.getToken(address);
  
  console.log(`
Token Analysis Results:
----------------------
Name: ${analysis.data.tokenName}
Score: ${analysis.data.score}/100
Market Cap: $${analysis.data.marketCap}
Risk Level: ${analysis.data.score < 50 ? 'High' : 'Low'}
LP Burned: ${analysis.data.auditRisk.lpBurned ? 'Yes' : 'No'}
  `);
}

AI Agent Integration

import { FlexoClient, ChatMessage } from 'flexo-sdk';

async function chatWithAgent() {
  const client = new FlexoClient();
  const messages: ChatMessage[] = [{
    role: 'user',
    content: 'Analyze the risk factors for token ABC'
  }];
  
  const response = await client.chat('agent-id', messages);
  console.log('AI Analysis:', response.data.response);
}

API Endpoints

Token Analysis

GET /v1/token/:address

Returns comprehensive token analysis including:

  • Risk indicators and scoring
  • Market metrics and valuation
  • Liquidity pool analysis
  • Ownership distribution
  • Deployment details
  • Audit risk factors

Response type:

interface TokenData {
  tokenName: string;
  tokenSymbol: string;
  score: number;         // 0-100 risk score
  marketCap: number;
  deployTime: string;
  auditRisk: {
    mintDisabled: boolean;
    freezeDisabled: boolean;
    lpBurned: boolean;
    top10Holders: boolean;
  };
  indicatorData: {
    high: { count: number; details: string; };
    moderate: { count: number; details: string; };
    low: { count: number; details: string; };
  };
  // ... other fields
}

AI Agents

List Available Agents

GET /v1/agents

Returns all available AI agents with their capabilities:

  • Agent identification
  • Supported analysis types
  • Specialization areas
  • System configuration

Response type:

interface Agent {
  id: string;
  name: string;
  description: string;
  capabilities: ('token_analysis' | 'market_analysis' | 'risk_assessment')[];
}

Get Specific Agent

GET /v1/agents/:id

Returns detailed information about a specific agent:

  • Complete agent profile
  • Available capabilities
  • System configuration
  • Specialization details

Chat with Agent

POST /v1/agents/:id/chat

Interactive conversation with AI agents:

  • Token analysis requests
  • Risk assessment queries
  • Market insights
  • Custom analysis requests

Request body:

{
  messages: [
    {
      role: 'user' | 'assistant' | 'system' | 'function';
      content: string;
      name?: string;
    }
  ]
}

Response type:

interface AgentResponse {
  response: string;    // AI-generated analysis
  timestamp: string;   // Response timestamp
}

Error Handling

All endpoints return standardized error responses:

interface ErrorResponse {
  error: string;       // Error type
  message: string;     // Detailed message
  statusCode: number;  // HTTP status code
  timestamp: string;   // Error timestamp
}

Common status codes:

  • 404: Resource not found
  • 429: Rate limit exceeded
  • 400: Invalid request
  • 500: Server error

🔍 Advanced Usage

Batch Processing

import { FlexoClient, TokenData, ApiResponse } from 'flexo-sdk';

async function batchAnalysis(addresses: string[]) {
  const client = new FlexoClient();
  const batchSize = 5;
  
  for (let i = 0; i < addresses.length; i += batchSize) {
    const batch = addresses.slice(i, i + batchSize);
    const analyses = await Promise.all(
      batch.map(addr => client.getToken(addr))
    );
    
    // Process batch results
    analyses.forEach(analysis => {
      if (analysis.data.score < 50) {
        console.log(`High Risk Token: ${analysis.data.tokenName}`);
        console.log(`Risk Factors: ${JSON.stringify(analysis.data.indicatorData)}`);
      }
    });
  }
}

Error Handling Patterns

import { FlexoClient } from 'flexo-sdk';

async function robustTokenAnalysis(address: string) {
  const client = new FlexoClient();
  
  try {
    const analysis = await client.getToken(address);
    return analysis;
  } catch (error: any) {
    switch (error.statusCode) {
      case 404:
        console.error('Token not found');
        break;
      case 429:
        // Implement retry logic
        console.error('Rate limit exceeded, retrying...');
        await new Promise(resolve => setTimeout(resolve, 1000));
        return robustTokenAnalysis(address);
      default:
        console.error('API Error:', error.message);
    }
    throw error;
  }
}

Conversation Management

import { FlexoClient, ChatMessage } from 'flexo-sdk';

class ConversationManager {
  private client: FlexoClient;
  private messages: ChatMessage[] = [];
  private agentId: string;

  constructor(agentId: string) {
    this.client = new FlexoClient();
    this.agentId = agentId;
  }

  async sendMessage(content: string) {
    this.messages.push({ role: 'user', content });
    
    const response = await this.client.chat(this.agentId, this.messages);
    this.messages.push({ 
      role: 'assistant', 
      content: response.data.response 
    });

    return response.data;
  }

  getHistory() {
    return this.messages;
  }

  clearHistory() {
    this.messages = [];
  }
}

Custom Configuration

import { FlexoClient } from 'flexo-sdk';

// Production with custom timeout
const timeoutController = new AbortController();
setTimeout(() => timeoutController.abort(), 5000);

const client = new FlexoClient('https://api.flexo.sh');
await client.getToken('address', { 
  signal: timeoutController.signal,
  headers: {
    'Custom-Header': 'value'
  }
});

Parallel Analysis

import { FlexoClient, TokenData } from 'flexo-sdk';

async function compareTokens(addresses: string[]) {
  const client = new FlexoClient();
  
  // Parallel token analysis
  const analyses = await Promise.all(
    addresses.map(addr => client.getToken(addr))
  );

  // Sort by score
  const sortedByRisk = analyses.sort(
    (a, b) => a.data.score - b.data.score
  );

  // Generate comparison report
  return sortedByRisk.map(analysis => ({
    name: analysis.data.tokenName,
    score: analysis.data.score,
    marketCap: analysis.data.marketCap,
    riskLevel: analysis.data.score < 50 ? 'High' : 'Low'
  }));
}

Documentation

For detailed documentation, visit docs.flexo.sh

Roadmap

  • [ ] WebSocket support for real-time updates
  • [ ] Advanced token metrics
  • [ ] Custom AI agent training
  • [ ] GraphQL API support
  • [ ] Browser extension integration

License

MIT © Flexo Team