fix: reverse Kline entries in mapKlines function to maintain chronological order

This commit is contained in:
discountry
2025-10-23 20:01:49 +08:00
parent e7dedbba2c
commit 295c6a47b7
+1 -1
View File
@@ -1162,7 +1162,7 @@ function mapTicker(response: IApiTickerResponse, symbol: string): AsterTicker |
}
function mapKlines(response: IApiCandlestickResponse, symbol: string): AsterKline[] {
return (response.result ?? []).map((entry) => ({
return (response.result ?? []).reverse().map((entry) => ({
openTime: nsToMs(entry.open_time ?? Date.now() * ONE_SECOND_IN_NANOSECONDS),
closeTime: nsToMs(entry.close_time ?? Date.now() * ONE_SECOND_IN_NANOSECONDS),
open: entry.open ?? "0",