mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-12 07:16:56 +08:00
feat: use coinank free API for kline data and show exchange badge
- Switch to coinank free/open kline API (no authentication required) - Add exchange badge display with brand colors (Binance/Bybit/OKX/Hyperliquid/Aster) - Auto-convert OKX symbol format (BTCUSDT -> BTC-USDT-SWAP) - Fallback to Binance data for unsupported exchanges (Bitget/Lighter) - Pass exchange prop from trader account to chart component
This commit is contained in:
@@ -72,15 +72,15 @@ function getExchangeDisplayNameFromList(
|
||||
: typeName
|
||||
}
|
||||
|
||||
// Helper function to get exchange type from exchange ID (UUID) - for TradingView charts
|
||||
// Helper function to get exchange type from exchange ID (UUID) - for kline charts
|
||||
function getExchangeTypeFromList(
|
||||
exchangeId: string | undefined,
|
||||
exchanges: Exchange[] | undefined
|
||||
): string {
|
||||
if (!exchangeId) return 'BINANCE'
|
||||
if (!exchangeId) return 'binance'
|
||||
const exchange = exchanges?.find((e) => e.id === exchangeId)
|
||||
if (!exchange) return 'BINANCE' // Default to BINANCE for charts
|
||||
return exchange.exchange_type?.toUpperCase() || 'BINANCE'
|
||||
if (!exchange) return 'binance' // Default to binance for charts
|
||||
return exchange.exchange_type?.toLowerCase() || 'binance'
|
||||
}
|
||||
|
||||
// Helper function to check if exchange is a perp-dex type (wallet-based)
|
||||
|
||||
Reference in New Issue
Block a user