public static OpenOrders adaptOpenOrders(HitbtcOrder[] openOrdersRaw) {
List<LimitOrder> openOrders = new ArrayList<LimitOrder>(openOrdersRaw.length);
for (int i = 0; i < openOrdersRaw.length; i++) {
HitbtcOrder o = openOrdersRaw[i];
OrderType type = o.getSide().equals("buy") ? OrderType.BID : OrderType.ASK;
String base = o.getSymbol().substring(0, 3);
String counter = o.getSymbol().substring(3, 6);
LimitOrder order = new LimitOrder(type, o.getExecQuantity(), new CurrencyPair(base, counter), o.getClientOrderId(), new Date(o.getLastTimestamp()), o.getOrderPrice());
openOrders.add(order);
}
return new OpenOrders(openOrders);