slice 5c ChartLab panel (ornith-35): candlestick/volume/EMA/RSI/relvol + P7 tooltips, trpc.market.candles+indicators wiring
Cross-review by qwopus35b pending. SPA lint 2/2 green.
This commit is contained in:
+18
-1
@@ -67,8 +67,25 @@ export type Complexity = "beginner" | "intermediate" | "advanced";
|
||||
export interface StarterEntry { symbol: string; tickerKind: string; reason: string; }
|
||||
export interface PortfolioEntry { symbol: string; qty: number; avgCost: number; acquiredAt: string; }
|
||||
|
||||
export interface IndicatorOptions {
|
||||
ema?: number[];
|
||||
rsi?: { period?: number };
|
||||
relvol?: { period?: number };
|
||||
}
|
||||
export interface IndicatorResult {
|
||||
ema?: Record<number, Array<{ ts: string; value: number }>>;
|
||||
rsi?: Array<{ ts: string; value: number }>;
|
||||
relvol?: Array<{ ts: string; value: number }>;
|
||||
}
|
||||
|
||||
export const api = {
|
||||
market: { snapshot: (symbol: string) => trpcQuery<Snapshot>("market.snapshot", { symbol }) },
|
||||
market: {
|
||||
snapshot: (symbol: string) => trpcQuery<Snapshot>("market.snapshot", { symbol }),
|
||||
candles: (symbol: string, timeframe = "1d") =>
|
||||
trpcQuery<PriceCandle[]>("market.candles", { symbol, timeframe }),
|
||||
indicators: (symbol: string, opts: IndicatorOptions) =>
|
||||
trpcQuery<IndicatorResult>("market.indicators", { symbol, ...opts }),
|
||||
},
|
||||
auth: {
|
||||
signup: (email: string, password: string) => trpcMutate<{ userId: string }>("auth.signup", { email, password }),
|
||||
login: (email: string, password: string, totp?: string) => trpcMutate<{ userId: string }>("auth.login", { email, password, ...(totp ? { totp } : {}) }),
|
||||
|
||||
Reference in New Issue
Block a user