public static UserTrades adaptTradeHistory(Map<Long, BTCETradeHistoryResult> tradeHistory) {
List<UserTrade> trades = new ArrayList<UserTrade>(tradeHistory.size());
for (Entry<Long, BTCETradeHistoryResult> entry : tradeHistory.entrySet()) {
BTCETradeHistoryResult result = entry.getValue();
OrderType type = result.getType() == BTCETradeHistoryResult.Type.buy ? OrderType.BID : OrderType.ASK;
String[] pair = result.getPair().split("_");
BigDecimal price = result.getRate();
BigDecimal tradableAmount = result.getAmount();
Date timeStamp = DateUtils.fromMillisUtc(result.getTimestamp() * 1000L);
String tradeId = String.valueOf(entry.getKey());
String orderId = String.valueOf(result.getOrderId());
CurrencyPair currencyPair = new CurrencyPair(pair[0].toUpperCase(), pair[1].toUpperCase());
trades.add(new UserTrade(type, tradableAmount, currencyPair, price, timeStamp, tradeId, orderId, null, null));
}
return new UserTrades(trades, TradeSortType.SortByTimestamp);