Skip to content

Latest commit

 

History

History
176 lines (138 loc) · 4.8 KB

File metadata and controls

176 lines (138 loc) · 4.8 KB

🔧 BinanceAI Pro - API Fix Guide

تمام مسائل حل ہو گئے! بند ہو کر دیکھو۔

✅ کیا ٹھیک کیا گیا

1. Binance API Authentication Issues ❌➜✅

  • مسئلہ: Balance نہیں دکھتا تھا، Trading نہیں ہو رہی تھی
  • وجہ: Client-side خودکار طور پر Binance کو call کر رہا تھا (CORS error)
  • حل:
    • server.js میں HMAC-SHA256 signing درست کی
    • index.js میں binanceRequest() کو proxy server استعمال کرنے کے لیے آپڈیٹ کیا
    • Signature generation مکمل طور پر server-side ہو گیا

2. Balance Screen Issue 📊

  • نیا فیچر: Account balance دیکھنے کے لیے getAccountBalance() function شامل کیا
  • کیسے استعمال کریں:
    "my balance"
    "balance check"
    "portfolio"  (اس میں زیادہ تفصیل ہے)
    

3. Real-Time Prices with CoinGecko 📈

  • نیا: CoinGecko API integration شامل کیا
  • server.js میں /api/coingecko proxy endpoint شامل کیا
  • index.js میں getRealTimePriceAnalysis() اور getPriceWithCoinGecko() شامل کیے
  • کیسے استعمال کریں:
    "BTC price"
    "price of ETH"
    "what is SOL worth"
    

4. Groq AI Price Analysis 🤖

  • Real-time قیمتوں کو Groq سے analyze کروا رہے ہیں
  • Market sentiment اور analysis دیتا ہے

🚀 کیسے شروع کریں

Step 1: Keys سیٹ کریں

  1. ⚙ Setup Keys بٹن پر کلک کریں
  2. درج کریں:
    • Binance API Key (Read + Trade only)
    • Binance Secret Key
    • Groq API Key (free: console.groq.com)
    • ✏️ Square API Key (optional)
    • ✏️ Whale Alert API Key (optional)

Step 2: سرور چلائیں

# Terminal میں
npm install http-server
node server.js

Step 3: App کھولیں

# دوسری terminal میں
npm start

🧪 ٹیسٹ کریں

Balance Test

خود سے کریں: "my balance" یا "balance check"
ديکھیں: تمام holdings اور USDT value

Price Test

خود سے کریں: "BTC price" یا "what is eth"
ديکھیں: قیمت، 24h change، market cap، Groq analysis

Trading Test

خود سے کریں: "buy BTCUSDT $5"
ديکھیں: Confirmation، اگر CONFIRM کریں تو order place ہو

Signal Test

خود سے کریں: "signal for BTC"
ديکھیں: Technical analysis - EMA, RSI, TP/SL levels

📋 فائلس کیا بدل گئیں

✏️ server.js

  • Fixed HMAC-SHA256 signing
  • Added proper JSON parsing for Binance responses
  • Added /api/coingecko proxy endpoint
  • Better error logging

✏️ index.js (Browser-based skills)

  • Fixed binanceRequest() to use server proxy
  • Added getAccountBalance() function
  • Added getRealTimePriceAnalysis() function
  • Added getCoinDataFromCoinGecko() function
  • Updated handleChat() to support balance queries

✏️ index.html

  • Added getPriceWithCoinGecko() function
  • Updated chat handler for balance/price commands
  • Better error handling and messages

🎯 Key Commands

Command Result
my balance Show all holdings
portfolio Full portfolio analysis with AI suggestions
BTC price Current BTC price + 24h analysis
ETH price ETH price analysis
signal for SOL Technical analysis signal
buy BTCUSDT $10 Place buy order (needs CONFIRM)
whale alerts Recent whale movements
crypto news Latest crypto news

🔐 Security Notes

  • ✅ API keys stored in browser session only
  • ✅ No keys sent to third parties
  • ✅ Binance secret never exposed to frontend
  • ✅ All authenticated requests go through Node.js server proxy
  • ⚠️ Never enable Withdrawal permission on Binance API keys

🐛 اگر مسائل ہوں

Balance still not showing

✓ Check console (F12) for errors
✓ Make sure server.js is running on localhost:3000
✓ Verify API key has Account Read permission
✓ Try: http://localhost:3000/api/binance?path=/api/v3/account&method=GET&apiKey=YOUR_KEY&apiSecret=YOUR_SECRET

Groq API Error

✓ Check key at console.groq.com
✓ Make sure key is copied correctly
✓ Check rate limits (30 requests/min free tier)

CoinGecko prices not loading

✓ CoinGecko همیشہ فارغ خالی ہے (public API)
✓ اگر نہیں ہو تو internet check کریں

📞 Support

اگر مزید مسائل ہوں تو:

  1. Browser console کھول (F12)
  2. Screenshot بھیجو
  3. خصوصیات بتا: کون سا message, کون سے keys

Made with ❤️ for #AIBinance Competition