// SignalR Ticker 데이터
export interface TickerData {
	market: string;
	symbol: string;
	openingPrice: number;
	highPrice: number;
	lowPrice: number;
	tradePrice: number;
	prevClosingPrice: number;
	change: string;
	changePrice: number;
	signedChangePrice: number;
	changeRate: number;
	signedChangeRate: number;
	tradeVolume: number;
	accTradeVolume: number;
	accTradeVolume24h: number;
	accTradePrice: number;
	accTradePrice24h: number;
	tradeDate: string;
	tradeTime: string;
	tradeTimestamp: number;
	askBid: string;
	accAskVolume: number;
	accBidVolume: number;
	highest52WeekPrice: number;
	highest52WeekDate: string;
	lowest52WeekPrice: number;
	lowest52WeekDate: string;
	marketState: string;
	delistingDate: string | null;
	marketWarning: string;
	timestamp: number;
	streamType: string;
}

// 코인 메타 정보 (korName, engName, logoImage — REST에서만 제공)
export interface TickerMeta {
	korName: string;
	engName: string;
	logoImage: string | null;
}

// REST 시세 응답 (GET /api/crypto/tickers) — 배열로 반환
export interface TickerRestData {
	market: string;
	symbol: string;
	korName: string;
	engName: string;
	logoImage: string | null;
	openingPrice: number;
	highPrice: number;
	lowPrice: number;
	tradePrice: number;
	prevClosingPrice: number;
	change: string;
	changePrice: number;
	signedChangePrice: number;
	changeRate: number;
	signedChangeRate: number;
	tradeVolume: number;
	accTradeVolume: number;
	accTradeVolume24h: number;
	accTradePrice: number;
	accTradePrice24h: number;
	isFeatured: boolean;
	displayOrder: number;
}

// SignalR Trade 데이터
export interface TradeData {
	market: string;
	symbol: string;
	tradePrice: number;
	tradeVolume: number;
	askBid: string;
	prevClosingPrice: number;
	change: string;
	changePrice: number;
	tradeDate: string;
	tradeTime: string;
	tradeTimestamp: number;
	sequentialId: number;
	timestamp: number;
	streamType: string;
	bestAskPrice: number;
	bestAskSize: number;
	bestBidPrice: number;
	bestBidSize: number;
}

// REST 체결 응답 항목 (GET /api/crypto/{market}/trades)
export interface TradeRestData {
	timestamp: number;
	tradePrice: number;
	tradeVolume: number;
	prevClosingPrice: number;
	changePrice: number;
	askBid: string;
	sequentialId: number;
}

// SignalR Orderbook 데이터
export interface OrderbookData {
	market: string;
	symbol: string;
	totalAskSize: number;
	totalBidSize: number;
	units: OrderbookUnitData[];
	timestamp: number;
	level: number;
	streamType: string;
}

export interface OrderbookUnitData {
	askPrice: number;
	bidPrice: number;
	askSize: number;
	bidSize: number;
}

// REST 호가 응답 (GET /api/crypto/{market}/orderbook)
export interface OrderbookRestData {
	totalAskSize: number;
	totalBidSize: number;
	units: OrderbookUnitData[];
	timestamp: number;
	level: number;
}

// SignalR Candle 데이터
export interface CandleData {
	market: string;
	symbol: string;
	candleDateTimeUtc: string;
	candleDateTimeKst: string;
	openingPrice: number;
	highPrice: number;
	lowPrice: number;
	tradePrice: number;
	candleAccTradeVolume: number;
	candleAccTradePrice: number;
	timestamp: number;
	streamType: string;
}

// REST 캔들 응답 항목 (GET /api/crypto/{market}/candles/*)
export interface CandleRestData {
	candleDateTimeUtc: string;
	candleDateTimeKst: string;
	openingPrice: number;
	highPrice: number;
	lowPrice: number;
	tradePrice: number;
	timestamp: number;
	candleAccTradePrice: number;
	candleAccTradeVolume: number;
	unit?: number;
}

// REST 마켓 목록 응답 (GET /api/crypto/markets)
export interface MarketInfo {
	market: string;
	koreanName: string;
	englishName: string;
	marketEvent: MarketEvent | null;
}

export interface MarketEvent {
	warning: boolean;
	caution: MarketCaution | null;
}

export interface MarketCaution {
	priceFluctuations: boolean;
	tradingVolumeSoaring: boolean;
	depositAmountSoaring: boolean;
	globalPriceDifferences: boolean;
	concentrationOfSmallAccounts: boolean;
}

// lightweight-charts 호환 캔들 바
export interface CandleBar {
	time: number;
	open: number;
	high: number;
	low: number;
	close: number;
}

// lightweight-charts 호환 볼륨 바
export interface VolumeBar {
	time: number;
	value: number;
	color: string;
}

// lightweight-charts 호환 MA 라인 데이터
export interface MAData {
	time: number;
	value: number;
}