Skip to content
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
23 changes: 12 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,25 @@ python = ["pyo3"]

[dependencies]
async-trait = "0.1"
base64 = "0.12.3"
chrono = { version = "0.4.11", features = ["std", "serde"] }
dotenv = "0.15.0"
futures = "0.3.5"
futures-util = "0.3.8"
base64 = "0.13"
chrono = { version = "0.4", features = ["std", "serde"] }
dotenv = "0.15"
futures = "0.3"
futures-util = "0.3"
hex = "0.4.2"
hmac = "0.8.1"
log = "0.4.8"
reqwest = { version = "0.10", features = ["json", "blocking"] }
reqwest = { version = "0.11", features = ["json", "blocking"] }
rust_decimal = "1.7.0"
sugar = "0.2.0"
serde = { version = "1.0.114", features = ["derive"] }
serde_json = "1.0.55"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
serde_urlencoded = "0.6.1"
thiserror = "1.0.20"
tokio = { version = "0.2", features = ["full"] }
tokio-tungstenite = { version = "0.10.1", features = ["tls"] }
tungstenite = "0.11.0"
tokio = { version = "1.0", features = ["full"] }
tokio-stream = "0.1"
tokio-tungstenite = { version = "0.13", features = ["tls"] }
tungstenite = "0.12"
sha2 = "0.9.1"
url = "2.1.1"
derive_more = "0.99"
Expand Down
2 changes: 1 addition & 1 deletion src/coinbase/prelude.rs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pub type Result<T> = std::result::Result<T, OpenLimitError>;
pub type Result<T> = std::result::Result<T, OpenLimitsError>;
2 changes: 2 additions & 0 deletions src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,6 @@ pub enum OpenLimitsError {
NotParsableResponse(String),
#[error("")]
MissingParameter(String),
#[error("")]
InvalidParameter(String),
}
1 change: 1 addition & 0 deletions src/model/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ pub struct CancelAllOrdersRequest {
#[derive(Serialize, Deserialize, Clone, Constructor, Debug)]
pub struct GetOrderHistoryRequest {
pub market_pair: Option<String>,
pub order_status: Option<Vec<OrderStatus>>,
pub paginator: Option<Paginator>,
}

Expand Down
10 changes: 10 additions & 0 deletions src/model/python.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use crate::nash::{Environment, NashCredentials, NashParameters};
use pyo3::exceptions::PyException;
use pyo3::prelude::{FromPyObject, IntoPy, PyObject, PyResult, Python, ToPyObject};
use pyo3::types::PyDict;
use std::time::Duration;

// Python to Rust...

Expand Down Expand Up @@ -199,12 +200,21 @@ impl<'a> FromPyObject<'a> for NashParameters {
"timeout not included in nash credentials",
))?
.extract()?;
let timeout = Duration::from_millis(timeout);
let sign_states_loop_interval: Option<u64> = py_dict
.get_item("timeout")
.ok_or(PyException::new_err(
"sign states loop interval not included in nash credentials",
))?
.extract()?;
let sign_states_loop_interval = sign_states_loop_interval.map(Duration::from_millis);
Ok(NashParameters {
affiliate_code,
credentials,
client_id,
environment,
timeout,
sign_states_loop_interval,
})
}
}
Expand Down
Loading