@continuumdao/continuum-node-sdk 1.3.7 → 1.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/chart/index.d.ts +7 -0
- package/dist/core/chart/index.d.ts.map +1 -0
- package/dist/core/chart/index.js +7 -0
- package/dist/core/chart/index.js.map +1 -0
- package/dist/core/chart/keygen-format.d.ts +21 -0
- package/dist/core/chart/keygen-format.d.ts.map +1 -0
- package/dist/core/chart/keygen-format.js +43 -0
- package/dist/core/chart/keygen-format.js.map +1 -0
- package/dist/core/chart/ohlcv.d.ts +21 -0
- package/dist/core/chart/ohlcv.d.ts.map +1 -0
- package/dist/core/chart/ohlcv.js +54 -0
- package/dist/core/chart/ohlcv.js.map +1 -0
- package/dist/core/chart/overlay-schemas.d.ts +385 -0
- package/dist/core/chart/overlay-schemas.d.ts.map +1 -0
- package/dist/core/chart/overlay-schemas.js +99 -0
- package/dist/core/chart/overlay-schemas.js.map +1 -0
- package/dist/core/chart/overlays.d.ts +7 -0
- package/dist/core/chart/overlays.d.ts.map +1 -0
- package/dist/core/chart/overlays.js +579 -0
- package/dist/core/chart/overlays.js.map +1 -0
- package/dist/core/chart/panes.d.ts +7 -0
- package/dist/core/chart/panes.d.ts.map +1 -0
- package/dist/core/chart/panes.js +30 -0
- package/dist/core/chart/panes.js.map +1 -0
- package/dist/core/chart/prepare-core.d.ts +6 -0
- package/dist/core/chart/prepare-core.d.ts.map +1 -0
- package/dist/core/chart/prepare-core.js +171 -0
- package/dist/core/chart/prepare-core.js.map +1 -0
- package/dist/core/chart/prepare.d.ts +6 -0
- package/dist/core/chart/prepare.d.ts.map +1 -0
- package/dist/core/chart/prepare.js +34 -0
- package/dist/core/chart/prepare.js.map +1 -0
- package/dist/core/chart/schemas.d.ts +321 -0
- package/dist/core/chart/schemas.d.ts.map +1 -0
- package/dist/core/chart/schemas.js +86 -0
- package/dist/core/chart/schemas.js.map +1 -0
- package/dist/core/chart/volume-direction.d.ts +15 -0
- package/dist/core/chart/volume-direction.d.ts.map +1 -0
- package/dist/core/chart/volume-direction.js +63 -0
- package/dist/core/chart/volume-direction.js.map +1 -0
- package/dist/core/keygen-messaging.d.ts +4 -1
- package/dist/core/keygen-messaging.d.ts.map +1 -1
- package/dist/core/keygen-messaging.js +70 -1
- package/dist/core/keygen-messaging.js.map +1 -1
- package/dist/core/ta/catalog.d.ts +1 -1
- package/dist/core/ta/schemas.d.ts +3 -3
- package/dist/mcp/chart.d.ts +3 -0
- package/dist/mcp/chart.d.ts.map +1 -0
- package/dist/mcp/chart.js +14 -0
- package/dist/mcp/chart.js.map +1 -0
- package/dist/mcp/keygen-messaging.d.ts.map +1 -1
- package/dist/mcp/keygen-messaging.js +13 -3
- package/dist/mcp/keygen-messaging.js.map +1 -1
- package/dist/mcp/register.d.ts.map +1 -1
- package/dist/mcp/register.js +3 -0
- package/dist/mcp/register.js.map +1 -1
- package/dist/mcp/resources/agent-mcp-servers.md +34 -0
- package/dist/mcp/resources/chart.md +186 -0
- package/dist/mcp/resources/keygen.md +8 -1
- package/dist/mcp/resources/overview.md +1 -0
- package/dist/mcp/resources/technical-indicators.md +3 -1
- package/dist/schemas/extended.d.ts +26 -0
- package/dist/schemas/extended.d.ts.map +1 -1
- package/dist/schemas/extended.js +35 -1
- package/dist/schemas/extended.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export const MAIN_CHART_PANE_ID = 'main';
|
|
2
|
+
const MIN_MAIN_PANE_RATIO = 0.35;
|
|
3
|
+
const MIN_OSC_PANE_RATIO = 0.14;
|
|
4
|
+
const MAX_OSC_PANE_RATIO = 0.22;
|
|
5
|
+
export function buildPaneLayout(chart) {
|
|
6
|
+
const oscillatorPaneIds = [
|
|
7
|
+
...new Set(chart.series
|
|
8
|
+
.map(s => s.paneId)
|
|
9
|
+
.filter((id) => !!id && id !== MAIN_CHART_PANE_ID)),
|
|
10
|
+
].sort();
|
|
11
|
+
if (oscillatorPaneIds.length === 0) {
|
|
12
|
+
return {
|
|
13
|
+
...chart,
|
|
14
|
+
panes: [{ id: MAIN_CHART_PANE_ID, heightRatio: 1 }],
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
const oscHeight = Math.min(MAX_OSC_PANE_RATIO, Math.max(MIN_OSC_PANE_RATIO, 0.55 / oscillatorPaneIds.length));
|
|
18
|
+
const mainHeight = Math.max(MIN_MAIN_PANE_RATIO, 1 - oscHeight * oscillatorPaneIds.length);
|
|
19
|
+
return {
|
|
20
|
+
...chart,
|
|
21
|
+
panes: [
|
|
22
|
+
{ id: MAIN_CHART_PANE_ID, heightRatio: mainHeight },
|
|
23
|
+
...oscillatorPaneIds.map(id => ({ id, heightRatio: oscHeight })),
|
|
24
|
+
],
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export function seriesPaneId(series) {
|
|
28
|
+
return series.paneId ?? MAIN_CHART_PANE_ID;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=panes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"panes.js","sourceRoot":"","sources":["../../../src/core/chart/panes.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAEzC,MAAM,mBAAmB,GAAG,IAAI,CAAC;AACjC,MAAM,kBAAkB,GAAG,IAAI,CAAC;AAChC,MAAM,kBAAkB,GAAG,IAAI,CAAC;AAEhC,MAAM,UAAU,eAAe,CAAC,KAAqB;IACpD,MAAM,iBAAiB,GAAG;QACzB,GAAG,IAAI,GAAG,CACT,KAAK,CAAC,MAAM;aACV,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;aAClB,MAAM,CAAC,CAAC,EAAE,EAAgB,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,kBAAkB,CAAC,CACjE;KACD,CAAC,IAAI,EAAE,CAAC;IAET,IAAI,iBAAiB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACpC,OAAO;YACN,GAAG,KAAK;YACR,KAAK,EAAE,CAAC,EAAC,EAAE,EAAE,kBAAkB,EAAE,WAAW,EAAE,CAAC,EAAC,CAAC;SACjD,CAAC;IACH,CAAC;IAED,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CACzB,kBAAkB,EAClB,IAAI,CAAC,GAAG,CAAC,kBAAkB,EAAE,IAAI,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAC7D,CAAC;IACF,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAC1B,mBAAmB,EACnB,CAAC,GAAG,SAAS,GAAG,iBAAiB,CAAC,MAAM,CACxC,CAAC;IAEF,OAAO;QACN,GAAG,KAAK;QACR,KAAK,EAAE;YACN,EAAC,EAAE,EAAE,kBAAkB,EAAE,WAAW,EAAE,UAAU,EAAC;YACjD,GAAG,iBAAiB,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAC,EAAE,EAAE,WAAW,EAAE,SAAS,EAAC,CAAC,CAAC;SAC9D;KACD,CAAC;AACH,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,MAAyB;IACrD,OAAO,MAAM,CAAC,MAAM,IAAI,kBAAkB,CAAC;AAC5C,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { SdkResult } from '../result.js';
|
|
2
|
+
import { type PrepareChartInput, type PrepareChartOutput } from './schemas.js';
|
|
3
|
+
/** Browser-safe prepareChart (no TA overlays). MCP/server uses prepare.ts which adds overlays. */
|
|
4
|
+
export declare function prepareChartCore(input: PrepareChartInput): SdkResult<PrepareChartOutput>;
|
|
5
|
+
export declare function isChartV1Payload(value: unknown): value is PrepareChartOutput;
|
|
6
|
+
//# sourceMappingURL=prepare-core.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prepare-core.d.ts","sourceRoot":"","sources":["../../../src/core/chart/prepare-core.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,EAMN,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,MAAM,cAAc,CAAC;AA0JtB,kGAAkG;AAClG,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,iBAAiB,GAAG,SAAS,CAAC,kBAAkB,CAAC,CA0CxF;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,kBAAkB,CAM5E"}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { CHART_V1_KIND, DEFAULT_CHART_HEIGHT, DEFAULT_CHART_MAX_POINTS, } from './schemas.js';
|
|
2
|
+
import { applyVolumeDirectionFromCandles } from './volume-direction.js';
|
|
3
|
+
import { buildPaneLayout } from './panes.js';
|
|
4
|
+
function parseChartTime(raw) {
|
|
5
|
+
if (typeof raw === 'string') {
|
|
6
|
+
const trimmed = raw.trim();
|
|
7
|
+
if (/^\d{4}-\d{2}-\d{2}$/.test(trimmed)) {
|
|
8
|
+
const [year, month, day] = trimmed.split('-').map(Number);
|
|
9
|
+
if (!Number.isFinite(year) || !Number.isFinite(month) || !Number.isFinite(day)) {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
return { year, month, day };
|
|
13
|
+
}
|
|
14
|
+
const ms = Date.parse(trimmed);
|
|
15
|
+
if (Number.isFinite(ms)) {
|
|
16
|
+
return Math.floor(ms / 1000);
|
|
17
|
+
}
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
if (typeof raw === 'number' && Number.isFinite(raw)) {
|
|
21
|
+
if (raw > 1e12) {
|
|
22
|
+
return Math.floor(raw / 1000);
|
|
23
|
+
}
|
|
24
|
+
if (raw >= 0) {
|
|
25
|
+
return Math.floor(raw);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
function timeSortKey(time) {
|
|
31
|
+
if (typeof time === 'number') {
|
|
32
|
+
return time;
|
|
33
|
+
}
|
|
34
|
+
return time.year * 10_000 + time.month * 100 + time.day;
|
|
35
|
+
}
|
|
36
|
+
function timesEqual(a, b) {
|
|
37
|
+
if (typeof a === 'number' && typeof b === 'number') {
|
|
38
|
+
return a === b;
|
|
39
|
+
}
|
|
40
|
+
if (typeof a === 'object' && typeof b === 'object') {
|
|
41
|
+
return a.year === b.year && a.month === b.month && a.day === b.day;
|
|
42
|
+
}
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
function normalizeLinePoint(raw) {
|
|
46
|
+
const time = parseChartTime(raw.time);
|
|
47
|
+
const value = raw.value;
|
|
48
|
+
if (time == null || typeof value !== 'number' || !Number.isFinite(value)) {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
return { time, value };
|
|
52
|
+
}
|
|
53
|
+
function normalizeCandlePoint(raw) {
|
|
54
|
+
const time = parseChartTime(raw.time);
|
|
55
|
+
const open = raw.open;
|
|
56
|
+
const high = raw.high;
|
|
57
|
+
const low = raw.low;
|
|
58
|
+
const close = raw.close;
|
|
59
|
+
if (time == null ||
|
|
60
|
+
typeof open !== 'number' ||
|
|
61
|
+
typeof high !== 'number' ||
|
|
62
|
+
typeof low !== 'number' ||
|
|
63
|
+
typeof close !== 'number' ||
|
|
64
|
+
![open, high, low, close].every(Number.isFinite)) {
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
return { time, open, high, low, close };
|
|
68
|
+
}
|
|
69
|
+
function normalizeHistogramPoint(raw) {
|
|
70
|
+
const time = parseChartTime(raw.time);
|
|
71
|
+
const value = raw.value;
|
|
72
|
+
if (time == null || typeof value !== 'number' || !Number.isFinite(value)) {
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
const color = raw.color;
|
|
76
|
+
return {
|
|
77
|
+
time,
|
|
78
|
+
value,
|
|
79
|
+
...(typeof color === 'string' && color.trim() ? { color: color.trim() } : {}),
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
function dedupeSortedByTime(rows) {
|
|
83
|
+
const out = [];
|
|
84
|
+
for (const row of rows) {
|
|
85
|
+
const last = out.at(-1);
|
|
86
|
+
if (last && timesEqual(last.time, row.time)) {
|
|
87
|
+
out[out.length - 1] = row;
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
out.push(row);
|
|
91
|
+
}
|
|
92
|
+
return out;
|
|
93
|
+
}
|
|
94
|
+
function normalizeSeriesData(type, rawRows, maxPoints) {
|
|
95
|
+
const normalized = [];
|
|
96
|
+
for (const raw of rawRows) {
|
|
97
|
+
if (type === 'candlestick') {
|
|
98
|
+
const candle = normalizeCandlePoint(raw);
|
|
99
|
+
if (candle) {
|
|
100
|
+
normalized.push(candle);
|
|
101
|
+
}
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
if (type === 'histogram') {
|
|
105
|
+
const bar = normalizeHistogramPoint(raw);
|
|
106
|
+
if (bar) {
|
|
107
|
+
normalized.push(bar);
|
|
108
|
+
}
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
const line = normalizeLinePoint(raw);
|
|
112
|
+
if (line) {
|
|
113
|
+
normalized.push(line);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
if (normalized.length === 0) {
|
|
117
|
+
return {
|
|
118
|
+
ok: false,
|
|
119
|
+
reason: `Series type "${type}" has no valid data points (each point needs a valid time and numeric fields).`,
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
normalized.sort((a, b) => timeSortKey(a.time) - timeSortKey(b.time));
|
|
123
|
+
const deduped = dedupeSortedByTime(normalized);
|
|
124
|
+
const capped = deduped.length > maxPoints ? deduped.slice(deduped.length - maxPoints) : deduped;
|
|
125
|
+
return { ok: true, data: capped };
|
|
126
|
+
}
|
|
127
|
+
/** Browser-safe prepareChart (no TA overlays). MCP/server uses prepare.ts which adds overlays. */
|
|
128
|
+
export function prepareChartCore(input) {
|
|
129
|
+
const maxPoints = input.options?.maxPoints ?? DEFAULT_CHART_MAX_POINTS;
|
|
130
|
+
const seriesOut = [];
|
|
131
|
+
for (const series of input.series) {
|
|
132
|
+
const dataResult = normalizeSeriesData(series.type, series.data, maxPoints);
|
|
133
|
+
if (!dataResult.ok) {
|
|
134
|
+
return {
|
|
135
|
+
ok: false,
|
|
136
|
+
reason: `Series "${series.id}": ${dataResult.reason}`,
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
seriesOut.push({
|
|
140
|
+
id: series.id,
|
|
141
|
+
type: series.type,
|
|
142
|
+
label: series.label,
|
|
143
|
+
data: dataResult.data,
|
|
144
|
+
...(series.priceScaleId ? { priceScaleId: series.priceScaleId } : {}),
|
|
145
|
+
...(series.overlay != null ? { overlay: series.overlay } : {}),
|
|
146
|
+
...(series.style ? { style: series.style } : {}),
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
const colorVolumeFromCandles = input.options?.colorVolumeFromCandles ?? true;
|
|
150
|
+
const seriesWithVolumeDirection = applyVolumeDirectionFromCandles(seriesOut, colorVolumeFromCandles);
|
|
151
|
+
const chartPayload = buildPaneLayout({
|
|
152
|
+
...(input.title?.trim() ? { title: input.title.trim() } : {}),
|
|
153
|
+
height: input.height ?? DEFAULT_CHART_HEIGHT,
|
|
154
|
+
series: seriesWithVolumeDirection,
|
|
155
|
+
});
|
|
156
|
+
return {
|
|
157
|
+
ok: true,
|
|
158
|
+
data: {
|
|
159
|
+
kind: CHART_V1_KIND,
|
|
160
|
+
chart: chartPayload,
|
|
161
|
+
},
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
export function isChartV1Payload(value) {
|
|
165
|
+
if (!value || typeof value !== 'object') {
|
|
166
|
+
return false;
|
|
167
|
+
}
|
|
168
|
+
const o = value;
|
|
169
|
+
return o.kind === CHART_V1_KIND && typeof o.chart === 'object' && o.chart != null;
|
|
170
|
+
}
|
|
171
|
+
//# sourceMappingURL=prepare-core.js.map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IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QACzC,OAAO,KAAK,CAAC;IACd,CAAC;IACD,MAAM,CAAC,GAAG,KAAgC,CAAC;IAC3C,OAAO,CAAC,CAAC,IAAI,KAAK,aAAa,IAAI,OAAO,CAAC,CAAC,KAAK,KAAK,QAAQ,IAAI,CAAC,CAAC,KAAK,IAAI,IAAI,CAAC;AACnF,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { SdkResult } from '../result.js';
|
|
2
|
+
import { type PrepareChartInput, type PrepareChartOutput } from './schemas.js';
|
|
3
|
+
import { isChartV1Payload } from './prepare-core.js';
|
|
4
|
+
export { isChartV1Payload };
|
|
5
|
+
export declare function prepareChart(input: PrepareChartInput): SdkResult<PrepareChartOutput>;
|
|
6
|
+
//# sourceMappingURL=prepare.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prepare.d.ts","sourceRoot":"","sources":["../../../src/core/chart/prepare.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,EAEN,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAmB,gBAAgB,EAAC,MAAM,mBAAmB,CAAC;AAErE,OAAO,EAAC,gBAAgB,EAAC,CAAC;AAE1B,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,SAAS,CAAC,kBAAkB,CAAC,CA+BpF"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { DEFAULT_CHART_HEIGHT, } from './schemas.js';
|
|
2
|
+
import { expandChartOverlays } from './overlays.js';
|
|
3
|
+
import { buildPaneLayout } from './panes.js';
|
|
4
|
+
import { prepareChartCore, isChartV1Payload } from './prepare-core.js';
|
|
5
|
+
export { isChartV1Payload };
|
|
6
|
+
export function prepareChart(input) {
|
|
7
|
+
if (!input.overlays?.length) {
|
|
8
|
+
return prepareChartCore(input);
|
|
9
|
+
}
|
|
10
|
+
const core = prepareChartCore({
|
|
11
|
+
...input,
|
|
12
|
+
overlays: undefined,
|
|
13
|
+
});
|
|
14
|
+
if (!core.ok) {
|
|
15
|
+
return core;
|
|
16
|
+
}
|
|
17
|
+
const expanded = expandChartOverlays(core.data.chart.series, input.overlays);
|
|
18
|
+
if (!expanded.ok) {
|
|
19
|
+
return expanded;
|
|
20
|
+
}
|
|
21
|
+
const chartPayload = buildPaneLayout({
|
|
22
|
+
...(input.title?.trim() ? { title: input.title.trim() } : {}),
|
|
23
|
+
height: input.height ?? DEFAULT_CHART_HEIGHT,
|
|
24
|
+
series: expanded.data,
|
|
25
|
+
});
|
|
26
|
+
return {
|
|
27
|
+
ok: true,
|
|
28
|
+
data: {
|
|
29
|
+
kind: core.data.kind,
|
|
30
|
+
chart: chartPayload,
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=prepare.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prepare.js","sourceRoot":"","sources":["../../../src/core/chart/prepare.ts"],"names":[],"mappings":"AACA,OAAO,EACN,oBAAoB,GAGpB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAC,mBAAmB,EAAC,MAAM,eAAe,CAAC;AAClD,OAAO,EAAC,eAAe,EAAC,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAC,gBAAgB,EAAE,gBAAgB,EAAC,MAAM,mBAAmB,CAAC;AAErE,OAAO,EAAC,gBAAgB,EAAC,CAAC;AAE1B,MAAM,UAAU,YAAY,CAAC,KAAwB;IACpD,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;QAC7B,OAAO,gBAAgB,CAAC,KAAK,CAAC,CAAC;IAChC,CAAC;IAED,MAAM,IAAI,GAAG,gBAAgB,CAAC;QAC7B,GAAG,KAAK;QACR,QAAQ,EAAE,SAAS;KACnB,CAAC,CAAC;IACH,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;QACd,OAAO,IAAI,CAAC;IACb,CAAC;IAED,MAAM,QAAQ,GAAG,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC7E,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QAClB,OAAO,QAAQ,CAAC;IACjB,CAAC;IAED,MAAM,YAAY,GAAG,eAAe,CAAC;QACpC,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,EAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC3D,MAAM,EAAE,KAAK,CAAC,MAAM,IAAI,oBAAoB;QAC5C,MAAM,EAAE,QAAQ,CAAC,IAAI;KACrB,CAAC,CAAC;IAEH,OAAO;QACN,EAAE,EAAE,IAAI;QACR,IAAI,EAAE;YACL,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI;YACpB,KAAK,EAAE,YAAY;SACnB;KACD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export { ChartOverlayInputSchema, PrepareChartOverlaysSchema } from './overlay-schemas.js';
|
|
3
|
+
export type { ChartOverlayInput } from './overlay-schemas.js';
|
|
4
|
+
export declare const CHART_V1_KIND: "continuum/chart/v1";
|
|
5
|
+
export declare const DEFAULT_CHART_MAX_POINTS = 5000;
|
|
6
|
+
export declare const DEFAULT_CHART_HEIGHT = 280;
|
|
7
|
+
export declare const MAX_CHART_SERIES = 40;
|
|
8
|
+
export declare const ChartSeriesTypeSchema: z.ZodEnum<{
|
|
9
|
+
line: "line";
|
|
10
|
+
candlestick: "candlestick";
|
|
11
|
+
area: "area";
|
|
12
|
+
histogram: "histogram";
|
|
13
|
+
}>;
|
|
14
|
+
export declare const ChartLineStyleSchema: z.ZodEnum<{
|
|
15
|
+
solid: "solid";
|
|
16
|
+
dashed: "dashed";
|
|
17
|
+
dotted: "dotted";
|
|
18
|
+
}>;
|
|
19
|
+
export declare const ChartSeriesStyleSchema: z.ZodObject<{
|
|
20
|
+
color: z.ZodOptional<z.ZodString>;
|
|
21
|
+
lineWidth: z.ZodOptional<z.ZodNumber>;
|
|
22
|
+
lineStyle: z.ZodOptional<z.ZodEnum<{
|
|
23
|
+
solid: "solid";
|
|
24
|
+
dashed: "dashed";
|
|
25
|
+
dotted: "dotted";
|
|
26
|
+
}>>;
|
|
27
|
+
}, z.core.$strict>;
|
|
28
|
+
export declare const ChartSeriesInputSchema: z.ZodObject<{
|
|
29
|
+
id: z.ZodString;
|
|
30
|
+
type: z.ZodEnum<{
|
|
31
|
+
line: "line";
|
|
32
|
+
candlestick: "candlestick";
|
|
33
|
+
area: "area";
|
|
34
|
+
histogram: "histogram";
|
|
35
|
+
}>;
|
|
36
|
+
label: z.ZodString;
|
|
37
|
+
data: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
38
|
+
priceScaleId: z.ZodOptional<z.ZodEnum<{
|
|
39
|
+
left: "left";
|
|
40
|
+
right: "right";
|
|
41
|
+
}>>;
|
|
42
|
+
overlay: z.ZodOptional<z.ZodBoolean>;
|
|
43
|
+
style: z.ZodOptional<z.ZodObject<{
|
|
44
|
+
color: z.ZodOptional<z.ZodString>;
|
|
45
|
+
lineWidth: z.ZodOptional<z.ZodNumber>;
|
|
46
|
+
lineStyle: z.ZodOptional<z.ZodEnum<{
|
|
47
|
+
solid: "solid";
|
|
48
|
+
dashed: "dashed";
|
|
49
|
+
dotted: "dotted";
|
|
50
|
+
}>>;
|
|
51
|
+
}, z.core.$strict>>;
|
|
52
|
+
}, z.core.$strict>;
|
|
53
|
+
export declare const PrepareChartInputSchema: z.ZodObject<{
|
|
54
|
+
title: z.ZodOptional<z.ZodString>;
|
|
55
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
56
|
+
series: z.ZodArray<z.ZodObject<{
|
|
57
|
+
id: z.ZodString;
|
|
58
|
+
type: z.ZodEnum<{
|
|
59
|
+
line: "line";
|
|
60
|
+
candlestick: "candlestick";
|
|
61
|
+
area: "area";
|
|
62
|
+
histogram: "histogram";
|
|
63
|
+
}>;
|
|
64
|
+
label: z.ZodString;
|
|
65
|
+
data: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
66
|
+
priceScaleId: z.ZodOptional<z.ZodEnum<{
|
|
67
|
+
left: "left";
|
|
68
|
+
right: "right";
|
|
69
|
+
}>>;
|
|
70
|
+
overlay: z.ZodOptional<z.ZodBoolean>;
|
|
71
|
+
style: z.ZodOptional<z.ZodObject<{
|
|
72
|
+
color: z.ZodOptional<z.ZodString>;
|
|
73
|
+
lineWidth: z.ZodOptional<z.ZodNumber>;
|
|
74
|
+
lineStyle: z.ZodOptional<z.ZodEnum<{
|
|
75
|
+
solid: "solid";
|
|
76
|
+
dashed: "dashed";
|
|
77
|
+
dotted: "dotted";
|
|
78
|
+
}>>;
|
|
79
|
+
}, z.core.$strict>>;
|
|
80
|
+
}, z.core.$strict>>;
|
|
81
|
+
overlays: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
82
|
+
type: z.ZodEnum<{
|
|
83
|
+
sma: "sma";
|
|
84
|
+
ema: "ema";
|
|
85
|
+
}>;
|
|
86
|
+
sourceSeriesId: z.ZodString;
|
|
87
|
+
period: z.ZodOptional<z.ZodNumber>;
|
|
88
|
+
id: z.ZodOptional<z.ZodString>;
|
|
89
|
+
label: z.ZodOptional<z.ZodString>;
|
|
90
|
+
overlay: z.ZodOptional<z.ZodBoolean>;
|
|
91
|
+
priceScaleId: z.ZodOptional<z.ZodEnum<{
|
|
92
|
+
left: "left";
|
|
93
|
+
right: "right";
|
|
94
|
+
}>>;
|
|
95
|
+
style: z.ZodOptional<z.ZodObject<{
|
|
96
|
+
color: z.ZodOptional<z.ZodString>;
|
|
97
|
+
lineWidth: z.ZodOptional<z.ZodNumber>;
|
|
98
|
+
lineStyle: z.ZodOptional<z.ZodEnum<{
|
|
99
|
+
solid: "solid";
|
|
100
|
+
dashed: "dashed";
|
|
101
|
+
dotted: "dotted";
|
|
102
|
+
}>>;
|
|
103
|
+
}, z.core.$strict>>;
|
|
104
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
105
|
+
type: z.ZodLiteral<"bollinger">;
|
|
106
|
+
sourceSeriesId: z.ZodString;
|
|
107
|
+
period: z.ZodOptional<z.ZodNumber>;
|
|
108
|
+
stdDev: z.ZodOptional<z.ZodNumber>;
|
|
109
|
+
id: z.ZodOptional<z.ZodString>;
|
|
110
|
+
overlay: z.ZodOptional<z.ZodBoolean>;
|
|
111
|
+
priceScaleId: z.ZodOptional<z.ZodEnum<{
|
|
112
|
+
left: "left";
|
|
113
|
+
right: "right";
|
|
114
|
+
}>>;
|
|
115
|
+
style: z.ZodOptional<z.ZodObject<{
|
|
116
|
+
color: z.ZodOptional<z.ZodString>;
|
|
117
|
+
lineWidth: z.ZodOptional<z.ZodNumber>;
|
|
118
|
+
lineStyle: z.ZodOptional<z.ZodEnum<{
|
|
119
|
+
solid: "solid";
|
|
120
|
+
dashed: "dashed";
|
|
121
|
+
dotted: "dotted";
|
|
122
|
+
}>>;
|
|
123
|
+
}, z.core.$strict>>;
|
|
124
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
125
|
+
type: z.ZodLiteral<"fibonacci">;
|
|
126
|
+
sourceSeriesId: z.ZodOptional<z.ZodString>;
|
|
127
|
+
range: z.ZodOptional<z.ZodObject<{
|
|
128
|
+
high: z.ZodNumber;
|
|
129
|
+
low: z.ZodNumber;
|
|
130
|
+
trend: z.ZodEnum<{
|
|
131
|
+
up: "up";
|
|
132
|
+
down: "down";
|
|
133
|
+
}>;
|
|
134
|
+
}, z.core.$strict>>;
|
|
135
|
+
levels: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
136
|
+
trend: z.ZodOptional<z.ZodEnum<{
|
|
137
|
+
up: "up";
|
|
138
|
+
down: "down";
|
|
139
|
+
}>>;
|
|
140
|
+
id: z.ZodOptional<z.ZodString>;
|
|
141
|
+
overlay: z.ZodOptional<z.ZodBoolean>;
|
|
142
|
+
priceScaleId: z.ZodOptional<z.ZodEnum<{
|
|
143
|
+
left: "left";
|
|
144
|
+
right: "right";
|
|
145
|
+
}>>;
|
|
146
|
+
style: z.ZodOptional<z.ZodObject<{
|
|
147
|
+
color: z.ZodOptional<z.ZodString>;
|
|
148
|
+
lineWidth: z.ZodOptional<z.ZodNumber>;
|
|
149
|
+
lineStyle: z.ZodOptional<z.ZodEnum<{
|
|
150
|
+
solid: "solid";
|
|
151
|
+
dashed: "dashed";
|
|
152
|
+
dotted: "dotted";
|
|
153
|
+
}>>;
|
|
154
|
+
}, z.core.$strict>>;
|
|
155
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
156
|
+
type: z.ZodLiteral<"rsi">;
|
|
157
|
+
sourceSeriesId: z.ZodString;
|
|
158
|
+
period: z.ZodOptional<z.ZodNumber>;
|
|
159
|
+
id: z.ZodOptional<z.ZodString>;
|
|
160
|
+
label: z.ZodOptional<z.ZodString>;
|
|
161
|
+
style: z.ZodOptional<z.ZodObject<{
|
|
162
|
+
color: z.ZodOptional<z.ZodString>;
|
|
163
|
+
lineWidth: z.ZodOptional<z.ZodNumber>;
|
|
164
|
+
lineStyle: z.ZodOptional<z.ZodEnum<{
|
|
165
|
+
solid: "solid";
|
|
166
|
+
dashed: "dashed";
|
|
167
|
+
dotted: "dotted";
|
|
168
|
+
}>>;
|
|
169
|
+
}, z.core.$strict>>;
|
|
170
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
171
|
+
type: z.ZodLiteral<"macd">;
|
|
172
|
+
sourceSeriesId: z.ZodString;
|
|
173
|
+
fastPeriod: z.ZodOptional<z.ZodNumber>;
|
|
174
|
+
slowPeriod: z.ZodOptional<z.ZodNumber>;
|
|
175
|
+
signalPeriod: z.ZodOptional<z.ZodNumber>;
|
|
176
|
+
id: z.ZodOptional<z.ZodString>;
|
|
177
|
+
style: z.ZodOptional<z.ZodObject<{
|
|
178
|
+
color: z.ZodOptional<z.ZodString>;
|
|
179
|
+
lineWidth: z.ZodOptional<z.ZodNumber>;
|
|
180
|
+
lineStyle: z.ZodOptional<z.ZodEnum<{
|
|
181
|
+
solid: "solid";
|
|
182
|
+
dashed: "dashed";
|
|
183
|
+
dotted: "dotted";
|
|
184
|
+
}>>;
|
|
185
|
+
}, z.core.$strict>>;
|
|
186
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
187
|
+
type: z.ZodLiteral<"stochasticrsi">;
|
|
188
|
+
sourceSeriesId: z.ZodString;
|
|
189
|
+
rsiPeriod: z.ZodOptional<z.ZodNumber>;
|
|
190
|
+
stochasticPeriod: z.ZodOptional<z.ZodNumber>;
|
|
191
|
+
kPeriod: z.ZodOptional<z.ZodNumber>;
|
|
192
|
+
dPeriod: z.ZodOptional<z.ZodNumber>;
|
|
193
|
+
id: z.ZodOptional<z.ZodString>;
|
|
194
|
+
style: z.ZodOptional<z.ZodObject<{
|
|
195
|
+
color: z.ZodOptional<z.ZodString>;
|
|
196
|
+
lineWidth: z.ZodOptional<z.ZodNumber>;
|
|
197
|
+
lineStyle: z.ZodOptional<z.ZodEnum<{
|
|
198
|
+
solid: "solid";
|
|
199
|
+
dashed: "dashed";
|
|
200
|
+
dotted: "dotted";
|
|
201
|
+
}>>;
|
|
202
|
+
}, z.core.$strict>>;
|
|
203
|
+
}, z.core.$strict>], "type">>>;
|
|
204
|
+
options: z.ZodOptional<z.ZodObject<{
|
|
205
|
+
maxPoints: z.ZodOptional<z.ZodNumber>;
|
|
206
|
+
colorVolumeFromCandles: z.ZodOptional<z.ZodBoolean>;
|
|
207
|
+
}, z.core.$strict>>;
|
|
208
|
+
}, z.core.$strict>;
|
|
209
|
+
export declare const ChartTimeSchema: z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
|
|
210
|
+
year: z.ZodNumber;
|
|
211
|
+
month: z.ZodNumber;
|
|
212
|
+
day: z.ZodNumber;
|
|
213
|
+
}, z.core.$strict>]>;
|
|
214
|
+
export declare const ChartPaneSchema: z.ZodObject<{
|
|
215
|
+
id: z.ZodString;
|
|
216
|
+
heightRatio: z.ZodNumber;
|
|
217
|
+
}, z.core.$strict>;
|
|
218
|
+
export declare const ChartSeriesOutputSchema: z.ZodObject<{
|
|
219
|
+
id: z.ZodString;
|
|
220
|
+
type: z.ZodEnum<{
|
|
221
|
+
line: "line";
|
|
222
|
+
candlestick: "candlestick";
|
|
223
|
+
area: "area";
|
|
224
|
+
histogram: "histogram";
|
|
225
|
+
}>;
|
|
226
|
+
label: z.ZodString;
|
|
227
|
+
data: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
228
|
+
priceScaleId: z.ZodOptional<z.ZodEnum<{
|
|
229
|
+
left: "left";
|
|
230
|
+
right: "right";
|
|
231
|
+
}>>;
|
|
232
|
+
paneId: z.ZodOptional<z.ZodString>;
|
|
233
|
+
overlay: z.ZodOptional<z.ZodBoolean>;
|
|
234
|
+
style: z.ZodOptional<z.ZodObject<{
|
|
235
|
+
color: z.ZodOptional<z.ZodString>;
|
|
236
|
+
lineWidth: z.ZodOptional<z.ZodNumber>;
|
|
237
|
+
lineStyle: z.ZodOptional<z.ZodEnum<{
|
|
238
|
+
solid: "solid";
|
|
239
|
+
dashed: "dashed";
|
|
240
|
+
dotted: "dotted";
|
|
241
|
+
}>>;
|
|
242
|
+
}, z.core.$strict>>;
|
|
243
|
+
}, z.core.$strict>;
|
|
244
|
+
export declare const ChartV1PayloadSchema: z.ZodObject<{
|
|
245
|
+
title: z.ZodOptional<z.ZodString>;
|
|
246
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
247
|
+
panes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
248
|
+
id: z.ZodString;
|
|
249
|
+
heightRatio: z.ZodNumber;
|
|
250
|
+
}, z.core.$strict>>>;
|
|
251
|
+
series: z.ZodArray<z.ZodObject<{
|
|
252
|
+
id: z.ZodString;
|
|
253
|
+
type: z.ZodEnum<{
|
|
254
|
+
line: "line";
|
|
255
|
+
candlestick: "candlestick";
|
|
256
|
+
area: "area";
|
|
257
|
+
histogram: "histogram";
|
|
258
|
+
}>;
|
|
259
|
+
label: z.ZodString;
|
|
260
|
+
data: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
261
|
+
priceScaleId: z.ZodOptional<z.ZodEnum<{
|
|
262
|
+
left: "left";
|
|
263
|
+
right: "right";
|
|
264
|
+
}>>;
|
|
265
|
+
paneId: z.ZodOptional<z.ZodString>;
|
|
266
|
+
overlay: z.ZodOptional<z.ZodBoolean>;
|
|
267
|
+
style: z.ZodOptional<z.ZodObject<{
|
|
268
|
+
color: z.ZodOptional<z.ZodString>;
|
|
269
|
+
lineWidth: z.ZodOptional<z.ZodNumber>;
|
|
270
|
+
lineStyle: z.ZodOptional<z.ZodEnum<{
|
|
271
|
+
solid: "solid";
|
|
272
|
+
dashed: "dashed";
|
|
273
|
+
dotted: "dotted";
|
|
274
|
+
}>>;
|
|
275
|
+
}, z.core.$strict>>;
|
|
276
|
+
}, z.core.$strict>>;
|
|
277
|
+
}, z.core.$strict>;
|
|
278
|
+
export declare const PrepareChartOutputSchema: z.ZodObject<{
|
|
279
|
+
kind: z.ZodLiteral<"continuum/chart/v1">;
|
|
280
|
+
chart: z.ZodObject<{
|
|
281
|
+
title: z.ZodOptional<z.ZodString>;
|
|
282
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
283
|
+
panes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
284
|
+
id: z.ZodString;
|
|
285
|
+
heightRatio: z.ZodNumber;
|
|
286
|
+
}, z.core.$strict>>>;
|
|
287
|
+
series: z.ZodArray<z.ZodObject<{
|
|
288
|
+
id: z.ZodString;
|
|
289
|
+
type: z.ZodEnum<{
|
|
290
|
+
line: "line";
|
|
291
|
+
candlestick: "candlestick";
|
|
292
|
+
area: "area";
|
|
293
|
+
histogram: "histogram";
|
|
294
|
+
}>;
|
|
295
|
+
label: z.ZodString;
|
|
296
|
+
data: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
297
|
+
priceScaleId: z.ZodOptional<z.ZodEnum<{
|
|
298
|
+
left: "left";
|
|
299
|
+
right: "right";
|
|
300
|
+
}>>;
|
|
301
|
+
paneId: z.ZodOptional<z.ZodString>;
|
|
302
|
+
overlay: z.ZodOptional<z.ZodBoolean>;
|
|
303
|
+
style: z.ZodOptional<z.ZodObject<{
|
|
304
|
+
color: z.ZodOptional<z.ZodString>;
|
|
305
|
+
lineWidth: z.ZodOptional<z.ZodNumber>;
|
|
306
|
+
lineStyle: z.ZodOptional<z.ZodEnum<{
|
|
307
|
+
solid: "solid";
|
|
308
|
+
dashed: "dashed";
|
|
309
|
+
dotted: "dotted";
|
|
310
|
+
}>>;
|
|
311
|
+
}, z.core.$strict>>;
|
|
312
|
+
}, z.core.$strict>>;
|
|
313
|
+
}, z.core.$strict>;
|
|
314
|
+
}, z.core.$strict>;
|
|
315
|
+
export type ChartSeriesType = z.infer<typeof ChartSeriesTypeSchema>;
|
|
316
|
+
export type ChartSeriesStyle = z.infer<typeof ChartSeriesStyleSchema>;
|
|
317
|
+
export type PrepareChartInput = z.infer<typeof PrepareChartInputSchema>;
|
|
318
|
+
export type PrepareChartOutput = z.infer<typeof PrepareChartOutputSchema>;
|
|
319
|
+
export type ChartV1Payload = z.infer<typeof ChartV1PayloadSchema>;
|
|
320
|
+
export type ChartTime = z.infer<typeof ChartTimeSchema>;
|
|
321
|
+
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/core/chart/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,E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