pub struct BitgetOptions {
pub product_type: String,
pub default_type: DefaultType,
pub default_sub_type: Option<DefaultSubType>,
pub recv_window: u64,
pub testnet: bool,
}Expand description
Bitget-specific options.
§Example
use ccxt_exchanges::bitget::BitgetOptions;
use ccxt_core::types::default_type::{DefaultType, DefaultSubType};
let options = BitgetOptions {
default_type: DefaultType::Swap,
default_sub_type: Some(DefaultSubType::Linear),
..Default::default()
};Fields§
§product_type: StringProduct type: spot, umcbl (USDT-M), dmcbl (Coin-M).
This is kept for backward compatibility with existing configurations.
When using default_type and default_sub_type, this field is automatically
derived from those values.
default_type: DefaultTypeDefault trading type (spot/swap/futures/option).
This determines which product type to use for API calls. Bitget uses product_type-based filtering:
Spot-> product_type=spotSwap+ Linear -> product_type=umcbl (USDT-M)Swap+ Inverse -> product_type=dmcbl (Coin-M)Futures+ Linear -> product_type=umcbl (USDT-M futures)Futures+ Inverse -> product_type=dmcbl (Coin-M futures)
default_sub_type: Option<DefaultSubType>Default sub-type for contract settlement (linear/inverse).
Linear: USDT-margined contracts (product_type=umcbl)Inverse: Coin-margined contracts (product_type=dmcbl)
Only applicable when default_type is Swap or Futures.
Ignored for Spot type.
recv_window: u64Receive window in milliseconds.
testnet: boolEnables testnet environment.
Implementations§
Source§impl BitgetOptions
impl BitgetOptions
Sourcepub fn effective_product_type(&self) -> &str
pub fn effective_product_type(&self) -> &str
Returns the effective product_type based on default_type and default_sub_type.
This method maps the DefaultType and DefaultSubType to Bitget’s product_type:
Spot-> “spot”Swap+ Linear (or None) -> “umcbl” (USDT-M perpetuals)Swap+ Inverse -> “dmcbl” (Coin-M perpetuals)Futures+ Linear (or None) -> “umcbl” (USDT-M futures)Futures+ Inverse -> “dmcbl” (Coin-M futures)Margin-> “spot” (margin uses spot markets)Option-> “spot” (options not fully supported, fallback to spot)
§Example
use ccxt_exchanges::bitget::BitgetOptions;
use ccxt_core::types::default_type::{DefaultType, DefaultSubType};
let mut options = BitgetOptions::default();
options.default_type = DefaultType::Swap;
options.default_sub_type = Some(DefaultSubType::Linear);
assert_eq!(options.effective_product_type(), "umcbl");
options.default_sub_type = Some(DefaultSubType::Inverse);
assert_eq!(options.effective_product_type(), "dmcbl");Trait Implementations§
Source§impl Clone for BitgetOptions
impl Clone for BitgetOptions
Source§fn clone(&self) -> BitgetOptions
fn clone(&self) -> BitgetOptions
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 BitgetOptions
impl Debug for BitgetOptions
Source§impl Default for BitgetOptions
impl Default for BitgetOptions
Source§impl<'de> Deserialize<'de> for BitgetOptions
impl<'de> Deserialize<'de> for BitgetOptions
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 BitgetOptions
impl RefUnwindSafe for BitgetOptions
impl Send for BitgetOptions
impl Sync for BitgetOptions
impl Unpin for BitgetOptions
impl UnwindSafe for BitgetOptions
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