*/
@Override
public OrderBook getOrderBook(CurrencyPair currencyPair, Object... args) throws IOException {
// Request data
ANXDepthWrapper anxDepthWrapper = null;
if (args.length > 0) {
if (args[0] instanceof String) {
if ("full" == args[0]) {
anxDepthWrapper = getANXFullOrderBook(currencyPair);
}
else {
anxDepthWrapper = getANXPartialOrderBook(currencyPair);
}
}
else {
throw new ExchangeException("Orderbook type argument must be a String!");
}
}
else { // default to full orderbook
anxDepthWrapper = getANXFullOrderBook(currencyPair);
}
// Adapt to XChange DTOs
List<LimitOrder> asks = ANXAdapters.adaptOrders(anxDepthWrapper.getAnxDepth().getAsks(), currencyPair.baseSymbol, currencyPair.counterSymbol, "ask", "");
List<LimitOrder> bids = ANXAdapters.adaptOrders(anxDepthWrapper.getAnxDepth().getBids(), currencyPair.baseSymbol, currencyPair.counterSymbol, "bid", "");
Date date = new Date(anxDepthWrapper.getAnxDepth().getMicroTime() / 1000);
return new OrderBook(date, asks, bids);
}