Expand description
Default type configuration for exchange operations Default Type Definitions for Exchange Configuration
This module provides type-safe configuration for selecting which market type (spot, swap, futures, margin, option) an exchange client should use by default when calling generic API methods.
§Overview
The types in this module enable:
DefaultType: Primary market type configuration (spot, swap, futures, margin, option)DefaultSubType: Secondary configuration for contract settlement (linear, inverse)
§Example
use ccxt_core::types::default_type::{DefaultType, DefaultSubType};
use std::str::FromStr;
// Create default types
let spot = DefaultType::Spot;
let swap = DefaultType::Swap;
// Parse from string (case-insensitive)
let futures = DefaultType::from_str("FUTURES").unwrap();
let margin = DefaultType::from_str("margin").unwrap();
// Display as lowercase
assert_eq!(spot.to_string(), "spot");
assert_eq!(swap.to_string(), "swap");
// Check market characteristics
assert!(!spot.is_derivative());
assert!(swap.is_derivative());
assert!(futures.is_contract());Enums§
- Default
SubType - Contract settlement type for derivatives
- Default
Type - Default market type for exchange operations
- Default
Type Error - Error type for DefaultType parsing
Functions§
- resolve_
market_ type - Resolves the effective market type for an API call