
# 🔥 Teck Model - Advanced Aptos Blockchain AI

A comprehensive AI-powered SDK for Aptos blockchain with advanced DeFi analytics and NFT tracking capabilities.

## 🚀 Features

- **Real-time Token Analytics**
  - Price tracking across multiple DEXes
  - Market cap and volume analysis
  - Liquidity monitoring
  - Verified pair detection

- **NFT Analytics**
  - Collection statistics
  - Floor price tracking
  - Volume analysis
  - Multi-marketplace support

- **Wallet Management**
  - Create new wallets
  - Balance checking
  - Token transfers
  - Transaction history

- **Market Analysis**
  - Holder distribution
  - Transaction patterns
  - Price predictions
  - Market sentiment

- **AI Integration**
  - Groq LLM integration
  - Market insights
  - Trading suggestions
  - Risk analysis

## 💻 Installation

```bash
npm install aptai
```

## 📚 Usage Guide

### 1. Basic Setup

```javascript
const { AptAi } = require('aptai');

// Initialize SDK with required configuration
const ai = new AptAi({
  groqApiKey: 'your_groq_api_key', // Required
  nodeUrl: 'https://fullnode.mainnet.aptoslabs.com/v1', // Optional: Custom node URL
  maxTokens: 200, // Optional: Customize AI response length
  temperature: 0.7 // Optional: Customize AI response creativity
});
```

### Security Note
Never hardcode or expose your private keys. Always use environment variables or secure key management systems.

### 2. Token Analysis

```javascript
// Get token price and market data
const tokenInfo = await ai.getPrice('aptos');
console.log(tokenInfo);
/*
{
  name: 'Aptos',
  symbol: 'APT',
  price: 10.50,
  price_change_24h: 2.5,
  volume24h: 1000000,
  market_cap: 50000000,
  dex: {
    name: 'PancakeSwap',
    verified: true
  }
}
*/

// Get detailed token analysis
const analysis = await ai.analyzeTokenMetrics('token_address');
console.log(analysis);
```

### 3. Wallet Operations

```javascript
// Create new wallet
const wallet = await ai.createWallet();
/*
{
  address: '0x...',
  privateKey: '0x...',
  publicKey: '0x...'
}
*/

// Check balance
const balance = await ai.getBalance('0x...');
console.log(`Balance: ${balance} APT`);

// Send tokens
const tx = await ai.sendTokens(
  'sender_private_key',
  'recipient_address',
  1.5 // amount in APT
);
```

### 4. AI Chat Features

```javascript
// Get market insights
const insight = await ai.chat('Analyze APT price trend');
console.log(insight);

// Get token analysis
const tokenInsight = await ai.getAIInsights('token_address');
console.log(tokenInsight);
```

### 5. NFT Analytics

```javascript
const nftData = await ai.getNFTData('collection_address');
console.log(nftData);
/*
{
  marketplaces: {
    topaz: { floor_price, volume },
    souffl3: { stats },
    bluemove: { collection }
  },
  analytics: {
    total_volume,
    floor_price,
    highest_sale
  }
}
*/
```

## 🤖 Telegram Bot Integration

```javascript
const TelegramBot = require('node-telegram-bot-api');
const { AptAi } = require('aptai');

const bot = new TelegramBot('your_bot_token', { polling: true });
const ai = new AptAi({ groqApiKey: 'your_groq_key' });

// Add command handlers
bot.onText(/\/price (.+)/, async (msg, match) => {
  const price = await ai.getPrice(match[1]);
  bot.sendMessage(msg.chat.id, `Price: $${price.price}`);
});
```

## 🧪 Testing

```bash
npm test                   // Run all tests
npm run lint              // Check code style
```

## 📈 Error Handling

The SDK implements comprehensive error handling for:
- Network failures
- Invalid inputs
- API rate limits
- Transaction errors
- Blockchain issues

## 🔧 Deployment

1. Fork or clone the repository
2. Install dependencies: `npm install`
3. Set up your environment variables
4. Start the bot: `npm start`

## 📄 License

MIT © Teck
