From 4f952b606b4d3d722131232321c8a1fd77bcb5d9 Mon Sep 17 00:00:00 2001 From: soulmachine Date: Fri, 5 Jul 2024 09:05:44 +0000 Subject: [PATCH 1/3] cargo upgrade --- crypto-message/Cargo.toml | 12 ++++++------ crypto-message/src/proto/message.rs | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/crypto-message/Cargo.toml b/crypto-message/Cargo.toml index f6c0d9d..f3f8b30 100644 --- a/crypto-message/Cargo.toml +++ b/crypto-message/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "crypto-message" -version = "1.1.20" +version = "1.1.21" edition = "2021" description = "Unified data structures for all cryptocurrency exchanges." license = "Apache-2.0" @@ -12,11 +12,11 @@ keywords = ["cryptocurrency", "blockchain", "trading"] ahash = "0.8.11" crypto-market-type = "1.1.6" crypto-msg-type = "1.0.12" -protobuf = "3.4.0" -serde = { version = "1.0.197", features = ["derive"] } -serde_json = "1.0.115" -strum = "0.26.2" -strum_macros = "0.26.2" +protobuf = "3.5.0" +serde = { version = "1.0.203", features = ["derive"] } +serde_json = "1.0.120" +strum = "0.26.3" +strum_macros = "0.26.4" [features] f32 = [] diff --git a/crypto-message/src/proto/message.rs b/crypto-message/src/proto/message.rs index 99b225b..eddbe5d 100644 --- a/crypto-message/src/proto/message.rs +++ b/crypto-message/src/proto/message.rs @@ -23,7 +23,7 @@ /// Generated files are compatible only with the same version /// of protobuf runtime. -const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_4_0; +const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_5_0; /// Tick-by-tick trade message. #[derive(PartialEq,Clone,Default,Debug)] From 77636fc227785fe3086e1115cd4da855cb225ac8 Mon Sep 17 00:00:00 2001 From: soulmachine Date: Fri, 5 Jul 2024 09:25:22 +0000 Subject: [PATCH 2/3] Fixed bitmex test cases --- crypto-msg-parser/Cargo.toml | 22 +++++++++++----------- crypto-msg-parser/src/exchanges/bitmex.rs | 14 ++++++++------ 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/crypto-msg-parser/Cargo.toml b/crypto-msg-parser/Cargo.toml index 2969afb..e8e1e36 100644 --- a/crypto-msg-parser/Cargo.toml +++ b/crypto-msg-parser/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "crypto-msg-parser" -version = "2.9.1" +version = "2.9.2" authors = ["soulmachine "] edition = "2021" description = "Parse websocket messages from cryptocurreny exchanges" @@ -9,17 +9,17 @@ repository = "https://github.com/crypto-crawler/crypto-msg-parser/tree/main/cryp keywords = ["cryptocurrency", "blockchain", "trading"] [dependencies] -chrono = "0.4.31" -crypto-contract-value = "1.7.24" +chrono = "0.4.38" +crypto-contract-value = "1.7.25" crypto-market-type = "1.1.6" crypto-msg-type = "1.0.12" -crypto-message = "1.1.19" -crypto-pair = "2.3.19" +crypto-message = "1.1.21" +crypto-pair = "2.3.20" if_chain = "1.0.2" once_cell = "1.19.0" -reqwest = { version = "0.11.23", features = ["blocking", "gzip"] } -simple-error = "0.3.0" -serde = { version = "1.0.193", features = ["derive"] } -serde_json = "1.0.108" -strum = "0.25.0" -strum_macros = "0.25.3" +reqwest = { version = "0.12.5", features = ["blocking", "gzip"] } +simple-error = "0.3.1" +serde = { version = "1.0.203", features = ["derive"] } +serde_json = "1.0.120" +strum = "0.26.3" +strum_macros = "0.26.4" diff --git a/crypto-msg-parser/src/exchanges/bitmex.rs b/crypto-msg-parser/src/exchanges/bitmex.rs index 90aaa44..74f0e79 100644 --- a/crypto-msg-parser/src/exchanges/bitmex.rs +++ b/crypto-msg-parser/src/exchanges/bitmex.rs @@ -18,7 +18,7 @@ const EXCHANGE_NAME: &str = "bitmex"; // symbol -> tickSize static SYMBOL_INDEX_AND_TICK_SIZE_MAP: Lazy> = Lazy::new(|| { - let mut m: HashMap = vec![ + let m: HashMap = vec![ ("A50G16", (65, 2.5)), ("A50H16", (67, 2.5)), ("A50J16", (72, 2.5)), @@ -491,14 +491,16 @@ static SYMBOL_INDEX_AND_TICK_SIZE_MAP: Lazy> = Laz .map(|x| (x.0.to_string(), x.1)) .collect(); - let from_online = fetch_tick_sizes(); - for (symbol, tick_size) in from_online { - m.insert(symbol, tick_size); - } + // deprecated by May 31st 2023 + // let from_online = fetch_tick_sizes(); + // for (symbol, tick_size) in from_online { + // m.insert(symbol, tick_size); + // } m }); +#[allow(dead_code)] fn fetch_tick_sizes() -> BTreeMap { #[derive(Serialize, Deserialize)] #[allow(non_snake_case)] @@ -566,7 +568,7 @@ struct RawOrder { id: usize, side: String, // Sell, Buy size: Option, // None if action = delete - price: Option, // None if action = delete + price: Option, // always exists after May 31st 2023, see https://www.bitmex.com/app/wsAPI#OrderBookL2 timestamp: Option, #[serde(flatten)] extra: HashMap, From 4ee4356d04029dbf83154295641d57ccd389ac20 Mon Sep 17 00:00:00 2001 From: soulmachine Date: Fri, 5 Jul 2024 09:28:17 +0000 Subject: [PATCH 3/3] cargo fmt --- crypto-msg-parser/src/exchanges/bitmex.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto-msg-parser/src/exchanges/bitmex.rs b/crypto-msg-parser/src/exchanges/bitmex.rs index 74f0e79..645b4e6 100644 --- a/crypto-msg-parser/src/exchanges/bitmex.rs +++ b/crypto-msg-parser/src/exchanges/bitmex.rs @@ -568,7 +568,7 @@ struct RawOrder { id: usize, side: String, // Sell, Buy size: Option, // None if action = delete - price: Option, // always exists after May 31st 2023, see https://www.bitmex.com/app/wsAPI#OrderBookL2 + price: Option, /* always exists after May 31st 2023, see https://www.bitmex.com/app/wsAPI#OrderBookL2 */ timestamp: Option, #[serde(flatten)] extra: HashMap,