scalexm / trade-rs

Utilities for trading on crypto-currencies exchanges.
MIT License
14 stars 3 forks source link

`ApiClient` should be symbol agnostic #11

Closed scalexm closed 6 years ago

scalexm commented 6 years ago

Currently, an ApiClient is designed to be used with only one symbol. It should be changed to be symbol agnostic instead. The REST queries would then take arguments of the form e.g. WithSymbol<Order>, while the ApiClient::stream method would then have the following signature:

fn stream(&self, symbol: Symbol) -> Self::Stream;

This would be an ergonomic improvement (currently one needs to create multiple API clients in order to handle multiple symbols), and would be more consistent with the fact that ApiClient::balances returns a list of balances for all symbols.

scalexm commented 6 years ago

Solved in f4acac9b3a987a06858457827b75258f229c3255.