pub struct OkxOptions {
pub account_mode: String,
pub default_type: DefaultType,
pub default_sub_type: Option<DefaultSubType>,
pub testnet: bool,
}Expand description
OKX-specific options.
§Example
use ccxt_exchanges::okx::OkxOptions;
use ccxt_core::types::default_type::{DefaultType, DefaultSubType};
let options = OkxOptions {
default_type: DefaultType::Swap,
default_sub_type: Some(DefaultSubType::Linear),
..Default::default()
};Fields§
§account_mode: StringAccount mode: cash (spot), cross (cross margin), isolated (isolated margin).
This is kept for backward compatibility with existing configurations.
default_type: DefaultTypeDefault trading type (spot/margin/swap/futures/option).
This determines which instrument type (instType) to use for API calls. OKX uses a unified V5 API, so this primarily affects market filtering rather than endpoint selection.
default_sub_type: Option<DefaultSubType>Default sub-type for contract settlement (linear/inverse).
Linear: USDT-margined contractsInverse: Coin-margined contracts
Only applicable when default_type is Swap, Futures, or Option.
Ignored for Spot and Margin types.
testnet: boolEnables demo trading environment.
Trait Implementations§
Source§impl Clone for OkxOptions
impl Clone for OkxOptions
Source§fn clone(&self) -> OkxOptions
fn clone(&self) -> OkxOptions
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OkxOptions
impl Debug for OkxOptions
Source§impl Default for OkxOptions
impl Default for OkxOptions
Source§impl<'de> Deserialize<'de> for OkxOptions
impl<'de> Deserialize<'de> for OkxOptions
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for OkxOptions
impl RefUnwindSafe for OkxOptions
impl Send for OkxOptions
impl Sync for OkxOptions
impl Unpin for OkxOptions
impl UnwindSafe for OkxOptions
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
Mutably borrows from an owned value. Read more