use of org.knowm.xchange.exmo.dto.trade.ExmoTradeHistoryParams in project XChange by knowm.
the class ExmoTradeService method getTradeHistory.
@Override
public UserTrades getTradeHistory(TradeHistoryParams params) throws IOException {
Integer limit = 10000;
Long offset = 0L;
List<CurrencyPair> currencyPairs = new ArrayList<>();
if (params instanceof ExmoTradeHistoryParams) {
ExmoTradeHistoryParams exmoTradeHistoryParams = (ExmoTradeHistoryParams) params;
currencyPairs.addAll(exmoTradeHistoryParams.getCurrencyPairs());
} else if (params instanceof TradeHistoryParamCurrencyPair) {
TradeHistoryParamCurrencyPair tradeHistoryParamCurrencyPair = (TradeHistoryParamCurrencyPair) params;
currencyPairs.add(tradeHistoryParamCurrencyPair.getCurrencyPair());
}
if (params instanceof TradeHistoryParamLimit) {
limit = ((TradeHistoryParamLimit) params).getLimit();
}
if (params instanceof TradeHistoryParamOffset) {
offset = ((TradeHistoryParamOffset) params).getOffset();
}
List<UserTrade> trades = trades(limit, offset, currencyPairs);
return new UserTrades(trades, Trades.TradeSortType.SortByTimestamp);
}
Aggregations