pub struct CoinbaseUnifiedClient { /* private fields */ }Expand description
Unified Coinbase Trading Client
Coordinates between REST, WebSocket, and FIX protocols to provide optimal trading experience with automatic failover and protocol selection.
Implementations§
Source§impl CoinbaseUnifiedClient
impl CoinbaseUnifiedClient
Sourcepub fn new(
auth: Arc<CoinbaseAuth>,
config: UnifiedClientConfig,
instrument_registry: Arc<dyn InstrumentRegistry>,
) -> Result<Self>
pub fn new( auth: Arc<CoinbaseAuth>, config: UnifiedClientConfig, instrument_registry: Arc<dyn InstrumentRegistry>, ) -> Result<Self>
Create a new unified client
Sourcepub async fn connect_with_report_sender(
&self,
report_tx: Sender<ExecutionReport>,
) -> Result<()>
pub async fn connect_with_report_sender( &self, report_tx: Sender<ExecutionReport>, ) -> Result<()>
Connect all enabled protocols with report sender
Sourcepub async fn disconnect(&self) -> Result<()>
pub async fn disconnect(&self) -> Result<()>
Disconnect all protocols
Sourcepub fn get_connection_status(&self) -> (bool, bool, bool)
pub fn get_connection_status(&self) -> (bool, bool, bool)
Get connection status
Sourcepub fn is_connected(&self) -> bool
pub fn is_connected(&self) -> bool
Check if any protocol is connected
Trait Implementations§
Source§impl Exchange for CoinbaseUnifiedClient
impl Exchange for CoinbaseUnifiedClient
Source§fn cancel_all_orders<'life0, 'async_trait>(
&'life0 self,
instrument_id: Option<InstrumentId>,
report_tx: 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_tx: Sender<ExecutionReport>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Cancel all orders
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,
Connect 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,
Disconnect 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,
Check if connected
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,
Get available instruments
Source§fn send_fix_message<'life0, 'async_trait>(
&'life0 self,
_message: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn send_fix_message<'life0, 'async_trait>(
&'life0 self,
_message: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Send FIX message (not supported for unified client)
Source§fn receive_fix_message<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn receive_fix_message<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Receive FIX message (not supported for unified client)
Source§fn place_order<'life0, 'async_trait>(
&'life0 self,
order: Order,
report_tx: 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_tx: 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_tx: 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_tx: 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_quantity: Option<Decimal>,
new_price: Option<Decimal>,
report_tx: 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_quantity: Option<Decimal>,
new_price: Option<Decimal>,
report_tx: Sender<ExecutionReport>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Modifies an existing order
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
Auto Trait Implementations§
impl Freeze for CoinbaseUnifiedClient
impl !RefUnwindSafe for CoinbaseUnifiedClient
impl Send for CoinbaseUnifiedClient
impl Sync for CoinbaseUnifiedClient
impl Unpin for CoinbaseUnifiedClient
impl !UnwindSafe for CoinbaseUnifiedClient
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