public static OpenOrders adaptOrders(Map<Long, BTCEOrder> btceOrderMap) {
List<LimitOrder> limitOrders = new ArrayList<LimitOrder>();
for (Long id : btceOrderMap.keySet()) {
BTCEOrder bTCEOrder = btceOrderMap.get(id);
OrderType orderType = bTCEOrder.getType() == BTCEOrder.Type.buy ? OrderType.BID : OrderType.ASK;
String[] pair = bTCEOrder.getPair().split("_");
BigDecimal price = bTCEOrder.getRate();
Date timestamp = DateUtils.fromMillisUtc(bTCEOrder.getTimestampCreated() * 1000L);
CurrencyPair currencyPair = new CurrencyPair(pair[0].toUpperCase(), pair[1].toUpperCase());
limitOrders.add(new LimitOrder(orderType, bTCEOrder.getAmount(), currencyPair, Long.toString(id), timestamp, price));
}
return new OpenOrders(limitOrders);
}