fix(data): add missing 3d and 1M Binance kline intervals (#312)

Binance supports 16 kline intervals (1s,1m,3m,5m,15m,30m,1h,2h,4h,6h,8h,
12h,1d,3d,1w,1M); the live-binance `Interval` enum listed only 14, missing
three-day (`3d`) and one-month (`1M`). Add both variants in Binance order
with their wire-format strings, and extend the exhaustive as_str test.
This commit is contained in:
kingchenc
2026-06-16 00:51:52 +02:00
committed by GitHub
parent d362ae26a3
commit baf4d0ff47
2 changed files with 12 additions and 0 deletions
+6
View File
@@ -92,7 +92,9 @@ pub enum Interval {
EightHours,
TwelveHours,
OneDay,
ThreeDays,
OneWeek,
OneMonth,
}
impl Interval {
@@ -112,7 +114,9 @@ impl Interval {
Self::EightHours => "8h",
Self::TwelveHours => "12h",
Self::OneDay => "1d",
Self::ThreeDays => "3d",
Self::OneWeek => "1w",
Self::OneMonth => "1M",
}
}
}
@@ -413,7 +417,9 @@ mod tests {
(Interval::EightHours, "8h"),
(Interval::TwelveHours, "12h"),
(Interval::OneDay, "1d"),
(Interval::ThreeDays, "3d"),
(Interval::OneWeek, "1w"),
(Interval::OneMonth, "1M"),
];
for (iv, expected) in pairs {
assert_eq!(iv.as_str(), *expected);