package info.bitrich.xchangestream.bankera;

import info.bitrich.xchangestream.core.StreamingExchange;
import info.bitrich.xchangestream.core.StreamingExchangeFactory;
import org.knowm.xchange.currency.CurrencyPair;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class BankeraManualExample {
    private static final Logger LOGGER = LoggerFactory.getLogger(BankeraManualExample.class);

    public static void main(String[] args) {
      StreamingExchange exchange = StreamingExchangeFactory.INSTANCE
          .createExchange(BankeraStreamingExchange.class.getName());

      exchange.connect().blockingAwait();
      exchange.getStreamingMarketDataService()
          .getOrderBook(CurrencyPair.ETH_BTC)
          .subscribe(orderBook -> {
            LOGGER.debug("ORDERBOOK: {}", orderBook.toString());
          }, throwable -> LOGGER.error("ERROR in getting order book: ", throwable));

      exchange.getStreamingMarketDataService()
          .getTicker(CurrencyPair.ETH_BTC)
          .subscribe(tick -> {
            LOGGER.debug("TICKER: {}", tick.toString());
          }, throwable -> LOGGER.error("ERROR in getting tick ", throwable));

      exchange.getStreamingMarketDataService()
          .getTrades(CurrencyPair.ETH_BTC)
          .subscribe(trade -> {
            LOGGER.debug("TRADES: {}", trade.toString());
          }, throwable -> LOGGER.error("ERROR in getting trade ", throwable));

      try {
        Thread.sleep(100000);
      } catch (InterruptedException e) {
        e.printStackTrace();
      }

      exchange.disconnect().subscribe(() -> LOGGER.info("Disconnected"));

    }
}

@@ -746,38 +746,24 @@
 orderBook -%3E
- %7B%0A           
  LOGGER.debu
@@ -794,33 +794,33 @@
 Book.toString())
-;
+,
 %0A          %7D, th
@@ -806,34 +806,35 @@
 g()),%0A          
-%7D,
+   
  throwable -%3E LO
@@ -895,265 +895,8 @@
 );%0A%0A
-      exchange.getStreamingMarketDataService()%0A          .getTicker(CurrencyPair.ETH_BTC)%0A          .subscribe(tick -%3E %7B%0A            LOGGER.debug(%22TICKER: %7B%7D%22, tick.toString());%0A          %7D, throwable -%3E LOGGER.error(%22ERROR in getting tick %22, throwable));%0A%0A
     
@@ -1014,23 +1014,8 @@
 e -%3E
- %7B%0A            
 LOGG
@@ -1054,17 +1054,17 @@
 tring())
-;
+,
 %0A       
@@ -1070,10 +1070,11 @@
     
-%7D,
+   
  thr
@@ -1175,17 +1175,16 @@
 ep(10000
-0
 );%0A     

remove tickers