From 879f45aa5ce992d94001577562e54727f989f5eb Mon Sep 17 00:00:00 2001 From: u1 Date: Sat, 10 Jan 2026 22:23:51 +0000 Subject: [PATCH] feat(chart): parse candle flow rows for brick bars --- apps/visualizer/src/lib/api.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/apps/visualizer/src/lib/api.ts b/apps/visualizer/src/lib/api.ts index ff220f2..87d16a4 100644 --- a/apps/visualizer/src/lib/api.ts +++ b/apps/visualizer/src/lib/api.ts @@ -6,6 +6,9 @@ export type Candle = { close: number; volume?: number; oracle?: number | null; + flow?: { up: number; down: number; flat: number }; + flowRows?: number[]; + flowMoves?: number[]; }; export type SeriesPoint = { @@ -68,9 +71,18 @@ export async function fetchChart(params: { close: Number(c.close), volume: c.volume == null ? undefined : Number(c.volume), oracle: c.oracle == null ? null : Number(c.oracle), + flow: + (c as any)?.flow && typeof (c as any).flow === 'object' + ? { + up: Number((c as any).flow.up), + down: Number((c as any).flow.down), + flat: Number((c as any).flow.flat), + } + : undefined, + flowRows: Array.isArray((c as any)?.flowRows) ? (c as any).flowRows.map((x: any) => Number(x)) : undefined, + flowMoves: Array.isArray((c as any)?.flowMoves) ? (c as any).flowMoves.map((x: any) => Number(x)) : undefined, })), indicators: json.indicators || {}, meta: { tf: String(json.tf || params.tf), bucketSeconds: Number(json.bucketSeconds || 0) }, }; } -