Update interval list to include 148m and extend mock API to return sample 148m candle

This commit is contained in:
DiTus
2026-03-18 22:22:04 +01:00
parent 15881b7db8
commit 1b6e307a79
2 changed files with 34 additions and 21 deletions

View File

@ -5,26 +5,39 @@ const PORT = 8000;
const HOST = '20.20.20.20'; const HOST = '20.20.20.20';
app.get('/api/v1/candles', (req, res) => { app.get('/api/v1/candles', (req, res) => {
res.json({ const { interval } = req.query;
candles: [ // Return mock candle data; include a sample for 148m interval
{ const mockCandles = [
time: Math.floor(Date.now() / 1000) - 86400, {
open: 27000, time: Math.floor(Date.now() / 1000) - 86400,
high: 27500, open: 27000,
low: 26900, high: 27500,
close: 27300, low: 26900,
volume: 1000 close: 27300,
}, volume: 1000
{ },
time: Math.floor(Date.now() / 1000) - 75600, {
open: 27300, time: Math.floor(Date.now() / 1000) - 75600,
high: 27800, open: 27300,
low: 27200, high: 27800,
close: 27700, low: 27200,
volume: 1200 close: 27700,
} volume: 1200
] }
}); ];
// For demonstration, add a dummy 148m candle if requested
if (interval === '148m') {
mockCandles.push({
time: Math.floor(Date.now() / 1000) - 64800, // example older candle
open: 27200,
high: 27600,
low: 27000,
close: 27400,
volume: 1100
});
}
res.json({ candles: mockCandles });
});
}); });
app.get('/api/v1/stats', (req, res) => { app.get('/api/v1/stats', (req, res) => {

View File

@ -1,4 +1,4 @@
export const INTERVALS = ['1m', '3m', '5m', '15m', '30m', '37m', '144m', '1h', '2h', '4h', '8h', '12h', '1d', '3d', '1w', '1M']; export const INTERVALS = ['1m', '3m', '5m', '15m', '30m', '37m', '148m', '1h', '2h', '4h', '8h', '12h', '1d', '3d', '1w', '1M'];
export const COLORS = { export const COLORS = {
tvBg: '#131722', tvBg: '#131722',