Skip to content

Commit

Permalink
Merge pull request #219 from fortynine/master
Browse files Browse the repository at this point in the history
Some minor fixes: default wss endpoint, dependencies upgrade and futures general endpoint ping
  • Loading branch information
wisespace-io authored Dec 3, 2023
2 parents aaa615a + 02d956a commit 3017e13
Show file tree
Hide file tree
Showing 10 changed files with 195 additions and 117 deletions.
16 changes: 8 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,21 @@ path = "src/lib.rs"
hex = "0.4"
hmac = "0.12.1"
sha2 = "0.10.6"
serde = { version = "1.0.126", features = ["derive"] }
serde = { version = "1.0.174", features = ["derive"] }
serde_json = "1.0"
error-chain = { version = "0.12.4", default-features = false }
reqwest = { version = "0.11.4", features = ["blocking", "json"] }
tungstenite = { version = "0.18.0", features = ["native-tls"] }
url = "2.2.2"
reqwest = { version = "0.11.8", features = ["blocking", "json"] }
tungstenite = { version = "0.19.0", features = ["native-tls"] }
url = "2.4.0"

[features]
vendored-tls = ["reqwest/native-tls-vendored", "tungstenite/native-tls-vendored"]

[dev-dependencies]
csv ="1.1.6"
mockito = "0.31.0"
env_logger = "0.9.0"
criterion = "0.3"
csv ="1.2.2"
mockito = "1.1.0"
env_logger = "0.10.0"
criterion = "0.5"
float-cmp = "0.9.0"
serde_json = "1.0"

Expand Down
2 changes: 1 addition & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ impl Default for Config {
fn default() -> Self {
Self {
rest_api_endpoint: "https://api.binance.com".into(),
ws_endpoint: "wss://stream.binance.com:9443/ws".into(),
ws_endpoint: "wss://stream.binance.com/ws".into(),

futures_rest_api_endpoint: "https://fapi.binance.com".into(),
futures_ws_endpoint: "wss://fstream.binance.com/ws".into(),
Expand Down
3 changes: 2 additions & 1 deletion src/futures/general.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use error_chain::bail;

use crate::model::Empty;
use crate::futures::model::{ExchangeInformation, ServerTime, Symbol};
use crate::client::Client;
use crate::errors::Result;
Expand All @@ -14,7 +15,7 @@ pub struct FuturesGeneral {
impl FuturesGeneral {
// Test connectivity
pub fn ping(&self) -> Result<String> {
self.client.get(API::Futures(Futures::Ping), None)?;
self.client.get::<Empty>(API::Futures(Futures::Ping), None)?;
Ok("pong".into())
}

Expand Down
4 changes: 2 additions & 2 deletions src/websockets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ enum WebsocketAPI {
impl WebsocketAPI {
fn params(self, subscription: &str) -> String {
match self {
WebsocketAPI::Default => format!("wss://stream.binance.com:9443/ws/{}", subscription),
WebsocketAPI::Default => format!("wss://stream.binance.com/ws/{}", subscription),
WebsocketAPI::MultiStream => format!(
"wss://stream.binance.com:9443/stream?streams={}",
"wss://stream.binance.com/stream?streams={}",
subscription
),
WebsocketAPI::Custom(url) => format!("{}/{}", url, subscription),
Expand Down
Loading

0 comments on commit 3017e13

Please sign in to comment.