mirror of
https://github.com/discountry/ritmex-bot.git
synced 2026-09-11 09:18:08 +00:00
fix: reverse Kline entries in mapKlines function to maintain chronological order
This commit is contained in:
@@ -1162,7 +1162,7 @@ function mapTicker(response: IApiTickerResponse, symbol: string): AsterTicker |
|
|||||||
}
|
}
|
||||||
|
|
||||||
function mapKlines(response: IApiCandlestickResponse, symbol: string): AsterKline[] {
|
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),
|
openTime: nsToMs(entry.open_time ?? Date.now() * ONE_SECOND_IN_NANOSECONDS),
|
||||||
closeTime: nsToMs(entry.close_time ?? Date.now() * ONE_SECOND_IN_NANOSECONDS),
|
closeTime: nsToMs(entry.close_time ?? Date.now() * ONE_SECOND_IN_NANOSECONDS),
|
||||||
open: entry.open ?? "0",
|
open: entry.open ?? "0",
|
||||||
|
|||||||
Reference in New Issue
Block a user