Skip to content

Commit 2b45ebd

Browse files
committed
export dropdown show all pairs
1 parent 082ef1f commit 2b45ebd

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

src/modules/services.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ const services: Services = {
401401
return candleExportHttp;
402402
}
403403

404-
return (candleExportHttp = new CandleExportHttp(this.getCandlestickRepository(), this.getProfileService()));
404+
return (candleExportHttp = new CandleExportHttp(this.getCandlestickRepository(), this.getCcxtCandleWatchService()));
405405
},
406406

407407
getExchangeCandleCombine: function (): ExchangeCandleCombine {
Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { CandlestickRepository } from '../../repository';
2+
import type { CcxtCandleWatchService } from './ccxt_candle_watch_service';
23

34
export interface ExchangeSymbolPair {
45
exchange: string;
@@ -8,19 +9,14 @@ export interface ExchangeSymbolPair {
89
export class CandleExportHttp {
910
constructor(
1011
private candlestickRepository: CandlestickRepository,
11-
private profileService: { getProfiles(): { exchange: string; bots?: { pair: string }[] }[] }
12+
private ccxtCandleWatchService: CcxtCandleWatchService
1213
) {}
1314

1415
async getCandles(exchange: string, symbol: string, period: string, start: Date, end: Date): Promise<any[]> {
1516
return this.candlestickRepository.getCandlesInWindow(exchange, symbol, period, start, end);
1617
}
1718

1819
async getPairs(): Promise<ExchangeSymbolPair[]> {
19-
return this.profileService.getProfiles().flatMap(profile =>
20-
(profile.bots ?? []).map(bot => ({
21-
exchange: profile.exchange,
22-
symbol: bot.pair
23-
}))
24-
);
20+
return this.ccxtCandleWatchService.getWatchedPairs();
2521
}
2622
}

0 commit comments

Comments
 (0)