info.bitrich.xchangestream.coinjar.CoinjarStreamingExchange Maven / Gradle / Ivy
The newest version!
package info.bitrich.xchangestream.coinjar;
import info.bitrich.xchangestream.core.ProductSubscription;
import info.bitrich.xchangestream.core.StreamingExchange;
import info.bitrich.xchangestream.core.StreamingTradeService;
import io.reactivex.rxjava3.core.Completable;
import io.reactivex.rxjava3.core.Observable;
import org.knowm.xchange.coinjar.CoinjarExchange;
public class CoinjarStreamingExchange extends CoinjarExchange implements StreamingExchange {
private static final String API_URI = "wss://feed.exchange.coinjar.com/socket/websocket";
private CoinjarStreamingService streamingService;
private CoinjarStreamingMarketDataService streamingMarketDataService;
private CoinjarStreamingTradeService streamingTradeService;
@Override
protected void initServices() {
super.initServices();
this.streamingService =
new CoinjarStreamingService(API_URI, this.exchangeSpecification.getApiKey());
applyStreamingSpecification(getExchangeSpecification(), streamingService);
this.streamingMarketDataService = new CoinjarStreamingMarketDataService(streamingService);
this.streamingTradeService = new CoinjarStreamingTradeService(streamingService);
}
@Override
public Completable connect(ProductSubscription... args) {
return streamingService.connect();
}
@Override
public Completable disconnect() {
return streamingService.disconnect();
}
@Override
public boolean isAlive() {
return streamingService.isSocketOpen();
}
@Override
public Observable reconnectFailure() {
return streamingService.subscribeReconnectFailure();
}
@Override
public Observable
© 2015 - 2025 Weber Informatics LLC | Privacy Policy