Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some minor fixes: default wss endpoint, dependencies upgrade and futures general endpoint ping #219

Merged
merged 3 commits into from
Dec 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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