*/
@Override
public OrderBook getOrderBook(CurrencyPair currencyPair, Object... args) throws IOException {
String pairs = com.xeiam.xchange.btce.v3.BTCEUtils.getPair(currencyPair);
BTCEDepthWrapper btceDepthWrapper = null;
if (args.length > 0) {
Object arg0 = args[0];
if (!(arg0 instanceof Integer) || ((Integer) arg0 < 1) || ((Integer) arg0 > FULL_SIZE)) {
throw new ExchangeException("Orderbook size argument must be an Integer in the range: (1, 2000)!");
}
else {
btceDepthWrapper = getBTCEDepth(pairs, (Integer) arg0);
}
}
else { // default to full orderbook
btceDepthWrapper = getBTCEDepth(pairs, FULL_SIZE);
}
// Adapt to XChange DTOs
List<LimitOrder> asks = BTCEAdapters.adaptOrders(btceDepthWrapper.getDepth(BTCEUtils.getPair(currencyPair)).getAsks(), currencyPair, "ask", "");
List<LimitOrder> bids = BTCEAdapters.adaptOrders(btceDepthWrapper.getDepth(BTCEUtils.getPair(currencyPair)).getBids(), currencyPair, "bid", "");
return new OrderBook(null, asks, bids);
}