pub struct BithumbWebSocketTrader { /* private fields */ }Expand description
Bithumb WebSocket Trading Client
Provides real-time market data and private account updates via WebSocket. Trading operations are handled through the REST API integration.
Implementations§
Source§impl BithumbWebSocketTrader
impl BithumbWebSocketTrader
Sourcepub fn new(auth: Arc<BithumbAuth>) -> Self
pub fn new(auth: Arc<BithumbAuth>) -> Self
Create a SmartString ID with the given prefix and a UUID suffix
This helper reduces boilerplate when creating unique identifiers for orders, tickets, and other entities that need UUID-based IDs.
§Examples
let order_id = Self::create_smart_id("bithumb_order");
let ticket_id = Self::create_smart_id("bithumb");Create a new Bithumb WebSocket trader instance
Sourcepub fn connection_state(&self) -> BithumbConnectionState
pub fn connection_state(&self) -> BithumbConnectionState
Get current connection state
Sourcepub fn is_connected(&self) -> bool
pub fn is_connected(&self) -> bool
Check if currently connected and authenticated
Sourcepub fn is_authenticated(&self) -> bool
pub fn is_authenticated(&self) -> bool
Check if WebSocket is authenticated
Sourcepub fn get_connection_health(&self) -> BithumbConnectionHealth
pub fn get_connection_health(&self) -> BithumbConnectionHealth
Get detailed connection health information
Sourcepub async fn connect(&self, report_tx: Sender<ExecutionReport>) -> Result<()>
pub async fn connect(&self, report_tx: Sender<ExecutionReport>) -> Result<()>
Connect to Bithumb private WebSocket endpoint
Sourcepub async fn disconnect(&self) -> Result<()>
pub async fn disconnect(&self) -> Result<()>
Disconnect from WebSocket
Trait Implementations§
Source§impl Clone for BithumbWebSocketTrader
impl Clone for BithumbWebSocketTrader
Source§impl Exchange for BithumbWebSocketTrader
impl Exchange for BithumbWebSocketTrader
Source§fn place_order<'life0, 'async_trait>(
&'life0 self,
_order: Order,
_report_sender: Sender<ExecutionReport>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn place_order<'life0, 'async_trait>(
&'life0 self,
_order: Order,
_report_sender: Sender<ExecutionReport>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Places a new order on the exchange
Source§fn cancel_order<'life0, 'async_trait>(
&'life0 self,
_order_id: SmartString,
_report_sender: Sender<ExecutionReport>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn cancel_order<'life0, 'async_trait>(
&'life0 self,
_order_id: SmartString,
_report_sender: Sender<ExecutionReport>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Cancels an existing order
Source§fn modify_order<'life0, 'async_trait>(
&'life0 self,
_order_id: SmartString,
_new_price: Option<Decimal>,
_new_quantity: Option<Decimal>,
_report_sender: Sender<ExecutionReport>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn modify_order<'life0, 'async_trait>(
&'life0 self,
_order_id: SmartString,
_new_price: Option<Decimal>,
_new_quantity: Option<Decimal>,
_report_sender: Sender<ExecutionReport>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Modifies an existing order
Source§fn cancel_all_orders<'life0, 'async_trait>(
&'life0 self,
_instrument_id: Option<InstrumentId>,
_report_sender: Sender<ExecutionReport>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn cancel_all_orders<'life0, 'async_trait>(
&'life0 self,
_instrument_id: Option<InstrumentId>,
_report_sender: Sender<ExecutionReport>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Cancels all open orders, optionally filtered by instrument
Source§fn get_order_status<'life0, 'life1, 'async_trait>(
&'life0 self,
_order_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<OrderStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_order_status<'life0, 'life1, 'async_trait>(
&'life0 self,
_order_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<OrderStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Retrieves the status of an order
Source§fn connect<'life0, 'async_trait>(
&'life0 self,
_report_sender: Sender<ExecutionReport>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn connect<'life0, 'async_trait>(
&'life0 self,
_report_sender: Sender<ExecutionReport>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Connects to the exchange
Source§fn disconnect<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn disconnect<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Disconnects from the exchange
Source§fn is_connected<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn is_connected<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Checks if connected to the exchange
Source§fn get_instruments<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<SmallVec<[InstrumentId; 32]>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_instruments<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<SmallVec<[InstrumentId; 32]>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Gets a list of instruments supported by this exchange
Auto Trait Implementations§
impl Freeze for BithumbWebSocketTrader
impl !RefUnwindSafe for BithumbWebSocketTrader
impl Send for BithumbWebSocketTrader
impl Sync for BithumbWebSocketTrader
impl Unpin for BithumbWebSocketTrader
impl !UnwindSafe for BithumbWebSocketTrader
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