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,8 +5,9 @@ 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, time: Math.floor(Date.now() / 1000) - 86400,
open: 27000, open: 27000,
@ -23,7 +24,19 @@ app.get('/api/v1/candles', (req, res) => {
close: 27700, close: 27700,
volume: 1200 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 });
}); });
}); });

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',