Closed plopezlpz closed 6 years ago
The argument should probably be a new type of Params class similar to that used in TradeHistory for example.
Related to #2018
@npomfret In MarketDataService
all existing methods accept CurrencyPair
as argument, I'd prefer to keep the argument as Collection<CurrencyPair>
to keep it consistent. With this API if we want to get all tickers then we can just pass the result of Exchange#getExchangeSymbols()
and we would get all the currency pairs for the exchange.
Why not have both? The existing method (that takes a single currency pair) becomes a convenience can just delegates down to the new method.
You can also use this new object to store the optional limit
parameter that some exchanges support for reducing the size of the order book. It's a much neater solution than the existing varargs approach.
@npomfret Ok, I've updated the PR with a generic params: #2388
Usage can be MarketDataService#getTickers((CurrencyPairsParam) () -> currencyPairs)
FYI - in java 8 adding a default implementation that just delegates is pretty easy...
I did the same for withdrawFunds
: https://github.com/timmolter/XChange/pull/2392/commits/3c3e91aa8aa0031497c9b627fcb7f2a07bd50275
Solved by #2446
It would be good to add a new method:
MarketDataService#getTickers(Collection<CurrencyPair>, Object...)
to get multiple tickets (or all tickers) in one request. At least CexIO's and Kraken's APIs support that:GET https://cex.io/api/tickers/{symbol1}/{symbol2}
GET https://api.kraken.com/0/public/Ticker?pair=pair1,pair2