[][src]Trait trade::api::ApiClient

pub trait ApiClient: GenerateOrderId {
    type Stream: Stream<Item = Notification, Error = ()> + Send + 'static;
    fn find_symbol(&self, symbol: &str) -> Option<Symbol>;
fn stream_with_flags(
        &self,
        symbol: Symbol,
        flags: NotificationFlags
    ) -> Self::Stream;
fn order(
        &self,
        order: WithSymbol<&Order>
    ) -> Box<dyn Future<Item = Timestamped<OrderAck>, Error = OrderError> + Send + 'static>;
fn cancel(
        &self,
        cancel: WithSymbol<&Cancel>
    ) -> Box<dyn Future<Item = Timestamped<CancelAck>, Error = CancelError> + Send + 'static>;
fn ping(
        &self
    ) -> Box<dyn Future<Item = Timestamped<()>, Error = Error> + Send + 'static>;
fn balances(
        &self
    ) -> Box<dyn Future<Item = Balances, Error = Error> + Send + 'static>; fn stream(&self, symbol: Symbol) -> Self::Stream { ... } }

A trait implemented by clients of various exchanges API.

Associated Types

Type returned by the stream implementor, used for continuously receiving notifications.

Required Methods

Find a symbol by name.

Start streaming notifications, only forward those indicated by flags.

Send an order to the exchange.

Send a cancel order to the exchange.

Note

Do no try to cancel an order if said order has not yet been confirmed by the exchange.

Send a ping to the exchange. This can be used to measure the whole roundtrip time, including authentication and passage through the various software layers. For binance, the exchange must be pinged regularly in order to keep the listen key alive.

Note

Only work for binance right now.

Retrieve balances for this account.

Provided Methods

Start streaming notifications.

Implementors

impl ApiClient for trade::api::binance::Client
[src]

impl ApiClient for trade::api::gdax::Client
[src]

impl ApiClient for trade::api::hitbtc::Client
[src]