mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-26 04:55:15 +00:00
Simplified message type
This commit is contained in:
parent
9a714cf082
commit
1f6330da88
|
@ -826,7 +826,7 @@ export function createBotSubStore(botId: string, botName: string) {
|
|||
break;
|
||||
case FtWsMessageTypes.newCandle:
|
||||
console.log('exitFill', msg);
|
||||
const [pair, timeframe] = msg.data.key;
|
||||
const [pair, timeframe] = msg.data;
|
||||
// TODO: check for active bot ...
|
||||
if (pair === this.selectedPair) {
|
||||
showAlert(`New Candle for ${pair}`, 'success');
|
||||
|
@ -869,16 +869,20 @@ export function createBotSubStore(botId: string, botName: string) {
|
|||
onConnected: () => {
|
||||
console.log('subscribing');
|
||||
this.websocketStarted = true;
|
||||
const subscriptions = [
|
||||
FtWsMessageTypes.whitelist,
|
||||
FtWsMessageTypes.entryFill,
|
||||
FtWsMessageTypes.exitFill,
|
||||
/*'new_candle' /*'analyzed_df'*/
|
||||
];
|
||||
if (this.botApiVersion >= 2.21) {
|
||||
subscriptions.push(FtWsMessageTypes.newCandle);
|
||||
}
|
||||
|
||||
send(
|
||||
JSON.stringify({
|
||||
type: 'subscribe',
|
||||
data: [
|
||||
FtWsMessageTypes.whitelist,
|
||||
FtWsMessageTypes.entryFill,
|
||||
FtWsMessageTypes.exitFill,
|
||||
FtWsMessageTypes.newCandle,
|
||||
/*'new_candle' /*'analyzed_df'*/
|
||||
],
|
||||
data: subscriptions,
|
||||
}),
|
||||
);
|
||||
send(
|
||||
|
|
|
@ -29,14 +29,10 @@ export interface FtExitFillMessage extends FtBaseWsMessage {
|
|||
// ...
|
||||
}
|
||||
|
||||
export interface NewCandleMessage {
|
||||
/** Pair, timeframe, candletype*/
|
||||
key: [string, string, string];
|
||||
}
|
||||
|
||||
export interface FtNewCandleMessage extends FtBaseWsMessage {
|
||||
type: FtWsMessageTypes.newCandle;
|
||||
data: NewCandleMessage;
|
||||
/** Pair, timeframe, candletype*/
|
||||
data: [string, string, string];
|
||||
// ...
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user