Advanced AI-powered SDK for DeFi & NFT analytics on Aptos
npm install aptai-js
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
});
pip install aptai
import aptai
aptai.init(
groq_api_key="your_groq_api_key",
system_prompt="Custom AI system prompt",
max_tokens=200,
temperature=0.7
)
π§ Rust SDK Coming Soon! π§
Watch this space for our upcoming Rust implementation with native Cargo support.
pip install aptai
# Requirements:
# - Python 3.11+
# - Groq API key
import aptai
aptai.init(
groq_api_key="your_groq_api_key",
system_prompt="Custom AI system prompt",
max_tokens=200,
temperature=0.7
)
# Get token prices and analytics
apt_price = aptai.get_price("aptos")
print(apt_price)
# Get detailed wallet analysis
wallet_info = aptai.get_detailed_wallet("wallet_address")
print(wallet_info)
# Get NFT collection data
nft_data = aptai.get_nft_data("collection_address")
print(nft_data)
# AI-powered market analysis
analysis = aptai.ai_analysis("What's driving APT price today?")
print(analysis)
# Real-Time Analytics
prices = aptai.get_multi_source_prices("aptos") # DexScreener, CoinGecko
history = aptai.get_historical_data("aptos", with_volatility=True)
volume = aptai.get_volume_metrics("aptos")
sentiment = aptai.analyze_market_sentiment("aptos")
# Comprehensive Wallet Tracking
portfolio = aptai.analyze_wallet_portfolio("wallet_address")
nft_holdings = aptai.get_nft_holdings("wallet_address")
tx_history = aptai.get_transaction_history("wallet_address")
defi_activity = aptai.track_defi_activity("wallet_address")
risk_score = aptai.assess_wallet_risk("wallet_address")
# NFT Analytics
nft_data = aptai.get_nft_data("collection_address", marketplaces=["topaz", "souffl3"])
stats = aptai.get_collection_stats("collection_address")
ownership = aptai.analyze_ownership("collection_address")
metrics = aptai.get_nft_metrics("collection_address")
# AI Integration
trend = aptai.analyze_market_trend("aptos")
prediction = aptai.predict_price("aptos")
custom_query = aptai.market_query("What's the APT market sentiment?")
insights = aptai.get_automated_insights("aptos")
risk = aptai.assess_market_risk("aptos")
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
});
// 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);
// 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
);
// 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);
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
}
}
*/