대시보드 중간 커밋
This commit is contained in:
@@ -1,10 +1,13 @@
|
||||
/**
|
||||
/**
|
||||
* @file features/dashboard/types/dashboard.types.ts
|
||||
* @description 대시보드(검색/시세/차트)에서 공통으로 쓰는 타입 모음
|
||||
*/
|
||||
|
||||
export type KisTradingEnv = "real" | "mock";
|
||||
export type DashboardPriceSource = "inquire-price" | "inquire-ccnl" | "inquire-overtime-price";
|
||||
export type DashboardPriceSource =
|
||||
| "inquire-price"
|
||||
| "inquire-ccnl"
|
||||
| "inquire-overtime-price";
|
||||
export type DashboardMarketPhase = "regular" | "afterHours";
|
||||
|
||||
/**
|
||||
@@ -23,6 +26,24 @@ export interface KoreanStockIndexItem {
|
||||
export interface StockCandlePoint {
|
||||
time: string;
|
||||
price: number;
|
||||
open?: number;
|
||||
high?: number;
|
||||
low?: number;
|
||||
close?: number;
|
||||
volume?: number;
|
||||
timestamp?: number;
|
||||
}
|
||||
|
||||
export type DashboardChartTimeframe = "1m" | "30m" | "1h" | "1d" | "1w";
|
||||
|
||||
/**
|
||||
* 호가창 1레벨(가격 + 잔량)
|
||||
*/
|
||||
export interface DashboardOrderBookLevel {
|
||||
askPrice: number;
|
||||
bidPrice: number;
|
||||
askSize: number;
|
||||
bidSize: number;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -73,6 +94,89 @@ export interface DashboardStockOverviewResponse {
|
||||
fetchedAt: string;
|
||||
}
|
||||
|
||||
export interface DashboardStockChartResponse {
|
||||
symbol: string;
|
||||
timeframe: DashboardChartTimeframe;
|
||||
candles: StockCandlePoint[];
|
||||
nextCursor: string | null;
|
||||
hasMore: boolean;
|
||||
fetchedAt: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 종목 호가 API 응답
|
||||
*/
|
||||
export interface DashboardStockOrderBookResponse {
|
||||
symbol: string;
|
||||
source: "kis" | "REALTIME";
|
||||
levels: DashboardOrderBookLevel[];
|
||||
totalAskSize: number;
|
||||
totalBidSize: number;
|
||||
businessHour?: string;
|
||||
hourClassCode?: string;
|
||||
accumulatedVolume?: number;
|
||||
anticipatedPrice?: number;
|
||||
anticipatedVolume?: number;
|
||||
anticipatedTotalVolume?: number;
|
||||
anticipatedChange?: number;
|
||||
anticipatedChangeSign?: string;
|
||||
anticipatedChangeRate?: number;
|
||||
totalAskSizeDelta?: number;
|
||||
totalBidSizeDelta?: number;
|
||||
tradingEnv: KisTradingEnv | string;
|
||||
fetchedAt: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 실시간 체결(틱) 1건 모델
|
||||
*/
|
||||
export interface DashboardRealtimeTradeTick {
|
||||
symbol: string;
|
||||
tickTime: string;
|
||||
price: number;
|
||||
change: number;
|
||||
changeRate: number;
|
||||
tradeVolume: number;
|
||||
accumulatedVolume: number;
|
||||
tradeStrength: number;
|
||||
askPrice1: number;
|
||||
bidPrice1: number;
|
||||
sellExecutionCount: number;
|
||||
buyExecutionCount: number;
|
||||
netBuyExecutionCount: number;
|
||||
open: number;
|
||||
high: number;
|
||||
low: number;
|
||||
}
|
||||
|
||||
export type DashboardOrderSide = "buy" | "sell";
|
||||
export type DashboardOrderType = "limit" | "market";
|
||||
|
||||
/**
|
||||
* 국내주식 현금 주문 요청 모델
|
||||
*/
|
||||
export interface DashboardStockCashOrderRequest {
|
||||
symbol: string;
|
||||
side: DashboardOrderSide;
|
||||
orderType: DashboardOrderType;
|
||||
quantity: number;
|
||||
price: number;
|
||||
accountNo: string;
|
||||
accountProductCode: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 국내주식 현금 주문 응답 모델
|
||||
*/
|
||||
export interface DashboardStockCashOrderResponse {
|
||||
ok: boolean;
|
||||
tradingEnv: KisTradingEnv;
|
||||
message: string;
|
||||
orderNo?: string;
|
||||
orderTime?: string;
|
||||
orderOrgNo?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* KIS 키 검증 API 응답
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user