use of org.knowm.xchange.latoken.dto.marketdata.LatokenTrades in project XChange by knowm.
the class LatokenAdapters method adaptTrades.
public static Trades adaptTrades(Exchange exchange, LatokenTrades latokenTrades) {
CurrencyPair pair = adaptCurrencyPair(exchange, latokenTrades.getSymbol());
List<Trade> trades = latokenTrades.getTrades().stream().map(latokenTrade -> adaptTrade(latokenTrade, pair)).collect(Collectors.toList());
return new Trades(trades, TradeSortType.SortByTimestamp);
}
use of org.knowm.xchange.latoken.dto.marketdata.LatokenTrades in project XChange by knowm.
the class LatokenMarketDataService method getTrades.
@Override
public Trades getTrades(CurrencyPair pair, Object... args) throws IOException {
try {
int limit = maxTrades;
if (args != null && args.length == 1) {
Object arg0 = args[0];
if (!(arg0 instanceof Integer)) {
throw new ExchangeException("Maximal number of trades must be an Integer!");
} else {
limit = (Integer) arg0;
}
}
LatokenTrades latokenTrades = getLatokenTrades(pair, limit);
return LatokenAdapters.adaptTrades(this.exchange, latokenTrades);
} catch (LatokenException e) {
throw LatokenErrorAdapter.adapt(e);
}
}
Aggregations