pub struct ConfigurableExchangeClient { /* private fields */ }Expand description
A generic exchange client driven entirely by a VenueDescriptor.
No venue-specific Rust code — all behavior comes from the YAML descriptor.
Implementations§
Source§impl ConfigurableExchangeClient
impl ConfigurableExchangeClient
Sourcepub fn new(descriptor: VenueDescriptor) -> Self
👎Deprecated since 0.8.0: pass the transport: use ConfigurableExchangeClient::with_http
pub fn new(descriptor: VenueDescriptor) -> Self
pass the transport: use ConfigurableExchangeClient::with_http
Create a new client from a venue descriptor, with a transport built from the environment.
Sourcepub fn with_http(descriptor: VenueDescriptor, http: Arc<dyn HttpClient>) -> Self
pub fn with_http(descriptor: VenueDescriptor, http: Arc<dyn HttpClient>) -> Self
Create a client that sends its requests through http.
Sourcepub fn descriptor(&self) -> &VenueDescriptor
pub fn descriptor(&self) -> &VenueDescriptor
The venue descriptor driving this client.
Sourcepub fn format_pair(&self, base: &str, quote: Option<&str>) -> String
pub fn format_pair(&self, base: &str, quote: Option<&str>) -> String
Format a pair using the venue’s symbol config.
Sourcepub async fn fetch_assets(&self) -> Result<Vec<AssetInfo>>
pub async fn fetch_assets(&self) -> Result<Vec<AssetInfo>>
The venue’s coin list (the assets capability): each asset’s
networks and token contracts. Items without a symbol are skipped.
Trait Implementations§
Source§impl Clone for ConfigurableExchangeClient
impl Clone for ConfigurableExchangeClient
Source§impl Debug for ConfigurableExchangeClient
impl Debug for ConfigurableExchangeClient
Source§impl OhlcClient for ConfigurableExchangeClient
impl OhlcClient for ConfigurableExchangeClient
Source§fn fetch_ohlc<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
pair_symbol: &'life1 str,
interval: &'life2 str,
limit: u32,
) -> Pin<Box<dyn Future<Output = Result<Vec<Candle>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn fetch_ohlc<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
pair_symbol: &'life1 str,
interval: &'life2 str,
limit: u32,
) -> Pin<Box<dyn Future<Output = Result<Vec<Candle>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Fetch OHLC candlesticks for the given pair symbol. Read more
Source§impl TradeHistoryClient for ConfigurableExchangeClient
impl TradeHistoryClient for ConfigurableExchangeClient
Source§fn fetch_recent_trades<'life0, 'life1, 'async_trait>(
&'life0 self,
pair_symbol: &'life1 str,
limit: u32,
) -> Pin<Box<dyn Future<Output = Result<Vec<Trade>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn fetch_recent_trades<'life0, 'life1, 'async_trait>(
&'life0 self,
pair_symbol: &'life1 str,
limit: u32,
) -> Pin<Box<dyn Future<Output = Result<Vec<Trade>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Fetch the most recent trades for the given pair symbol.
limit controls the maximum number of trades returned.Auto Trait Implementations§
impl !RefUnwindSafe for ConfigurableExchangeClient
impl !UnwindSafe for ConfigurableExchangeClient
impl Forget for ConfigurableExchangeClient
impl Freeze for ConfigurableExchangeClient
impl Send for ConfigurableExchangeClient
impl Sync for ConfigurableExchangeClient
impl Unpin for ConfigurableExchangeClient
impl UnsafeUnpin for ConfigurableExchangeClient
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