public class ItBitTradesDemo {
public static void main(String[] args) throws Exception {
// Use the factory to get BTC-E exchange API using default settings
Exchange bitfinex = ExchangeFactory.INSTANCE.createExchange(ItBitExchange.class.getName());
ExchangeSpecification defaultExchangeSpecification = bitfinex.getDefaultExchangeSpecification();
defaultExchangeSpecification.setUserName("xxx");
defaultExchangeSpecification.setApiKey("xxx");
defaultExchangeSpecification.setSecretKey("xxx");
defaultExchangeSpecification.setExchangeSpecificParametersItem("walletId", "xx");
defaultExchangeSpecification.setExchangeSpecificParametersItem("userId", "xxx");
bitfinex.applySpecification(defaultExchangeSpecification);
// get all services
PollingMarketDataService marketDataService = bitfinex.getPollingMarketDataService();
PollingAccountService accout = bitfinex.getPollingAccountService();
PollingTradeService trades = bitfinex.getPollingTradeService();
OrderBook orderBook = marketDataService.getOrderBook(new CurrencyPair("XBT", "USD"));
System.out.println("BIDS: " + orderBook.getBids());
System.out.println("ASKS: " + orderBook.getAsks());