pub struct OKXExecClientConfig {Show 18 fields
pub api_key: Option<String>,
pub api_secret: Option<String>,
pub api_passphrase: Option<String>,
pub instrument_types: Vec<OKXInstrumentType>,
pub contract_types: Option<Vec<OKXContractType>>,
pub instrument_families: Option<Vec<String>>,
pub base_url_http: Option<String>,
pub base_url_ws_private: Option<String>,
pub base_url_ws_business: Option<String>,
pub is_demo: bool,
pub http_timeout_secs: Option<u64>,
pub use_fills_channel: bool,
pub use_mm_mass_cancel: bool,
pub max_retries: Option<u32>,
pub retry_delay_initial_ms: Option<u64>,
pub retry_delay_max_ms: Option<u64>,
pub margin_mode: Option<OKXMarginMode>,
pub use_spot_margin: bool,
}Expand description
Configuration for the OKX execution client.
Fields§
§api_key: Option<String>Optional API key for authenticated endpoints.
api_secret: Option<String>Optional API secret for authenticated endpoints.
api_passphrase: Option<String>Optional API passphrase for authenticated endpoints.
instrument_types: Vec<OKXInstrumentType>Instrument types the execution client should support.
contract_types: Option<Vec<OKXContractType>>Contract type filter applied to operations.
instrument_families: Option<Vec<String>>Instrument families to load (e.g., “BTC-USD”, “ETH-USD”). Required for OPTIONS. Optional for FUTURES/SWAP. Not applicable for SPOT/MARGIN.
base_url_http: Option<String>Optional override for the HTTP base URL.
base_url_ws_private: Option<String>Optional override for the private WebSocket URL.
base_url_ws_business: Option<String>Optional override for the business WebSocket URL.
is_demo: boolWhen true the client will use OKX demo endpoints.
http_timeout_secs: Option<u64>Optional HTTP timeout in seconds.
use_fills_channel: boolEnables consumption of the fills WebSocket channel when true.
use_mm_mass_cancel: boolEnables mass-cancel support when true.
max_retries: Option<u32>Optional maximum retry attempts for requests.
retry_delay_initial_ms: Option<u64>Optional initial retry delay in milliseconds.
retry_delay_max_ms: Option<u64>Optional maximum retry delay in milliseconds.
margin_mode: Option<OKXMarginMode>Optional margin mode (CROSS or ISOLATED) for margin/derivative accounts.
use_spot_margin: boolEnables margin/leverage for SPOT trading when true.
Implementations§
Source§impl OKXExecClientConfig
impl OKXExecClientConfig
Sourcepub fn has_api_credentials(&self) -> bool
pub fn has_api_credentials(&self) -> bool
Returns true when all API credential fields are populated.
Sourcepub fn http_base_url(&self) -> String
pub fn http_base_url(&self) -> String
Returns the HTTP base URL, falling back to the default when unset.
Sourcepub fn ws_private_url(&self) -> String
pub fn ws_private_url(&self) -> String
Returns the private WebSocket URL, respecting the demo flag and overrides.
Sourcepub fn ws_business_url(&self) -> String
pub fn ws_business_url(&self) -> String
Returns the business WebSocket URL, respecting the demo flag and overrides.
Trait Implementations§
Source§impl Clone for OKXExecClientConfig
impl Clone for OKXExecClientConfig
Source§fn clone(&self) -> OKXExecClientConfig
fn clone(&self) -> OKXExecClientConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OKXExecClientConfig
impl Debug for OKXExecClientConfig
Auto Trait Implementations§
impl Freeze for OKXExecClientConfig
impl RefUnwindSafe for OKXExecClientConfig
impl Send for OKXExecClientConfig
impl Sync for OKXExecClientConfig
impl Unpin for OKXExecClientConfig
impl UnwindSafe for OKXExecClientConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more