Search in sources :

Example 1 with StreamingMarketDataService

use of info.bitrich.xchangestream.core.StreamingMarketDataService in project XChange by knowm.

the class CoinjarStreamingMarketDataServiceIntegration method runTestUsdcAud.

@Test
public void runTestUsdcAud() {
    ExchangeSpecification defaultExchangeSpecification = new ExchangeSpecification(CoinjarStreamingExchange.class);
    StreamingExchange exchange = StreamingExchangeFactory.INSTANCE.createExchange(defaultExchangeSpecification);
    exchange.connect().blockingAwait();
    StreamingMarketDataService streamingMarketDataService = exchange.getStreamingMarketDataService();
    Disposable usdtOrderBookDisposable = streamingMarketDataService.getOrderBook(new CurrencyPair(Currency.USDC, Currency.AUD)).test().awaitCount(10).assertNoErrors();
    usdtOrderBookDisposable.dispose();
}
Also used : Disposable(io.reactivex.disposables.Disposable) StreamingMarketDataService(info.bitrich.xchangestream.core.StreamingMarketDataService) StreamingExchange(info.bitrich.xchangestream.core.StreamingExchange) ExchangeSpecification(org.knowm.xchange.ExchangeSpecification) CurrencyPair(org.knowm.xchange.currency.CurrencyPair) Test(org.junit.Test)

Example 2 with StreamingMarketDataService

use of info.bitrich.xchangestream.core.StreamingMarketDataService in project XChange by knowm.

the class CoinjarStreamingMarketDataServiceIntegration method runTestBtcAud.

@Test
public void runTestBtcAud() {
    ExchangeSpecification defaultExchangeSpecification = new ExchangeSpecification(CoinjarStreamingExchange.class);
    StreamingExchange exchange = StreamingExchangeFactory.INSTANCE.createExchange(defaultExchangeSpecification);
    exchange.connect().blockingAwait();
    StreamingMarketDataService streamingMarketDataService = exchange.getStreamingMarketDataService();
    Disposable btcOrderBookDisposable = streamingMarketDataService.getOrderBook(CurrencyPair.BTC_AUD).test().awaitCount(10).assertNoErrors();
    btcOrderBookDisposable.dispose();
}
Also used : Disposable(io.reactivex.disposables.Disposable) StreamingMarketDataService(info.bitrich.xchangestream.core.StreamingMarketDataService) StreamingExchange(info.bitrich.xchangestream.core.StreamingExchange) ExchangeSpecification(org.knowm.xchange.ExchangeSpecification) Test(org.junit.Test)

Aggregations

StreamingExchange (info.bitrich.xchangestream.core.StreamingExchange)2 StreamingMarketDataService (info.bitrich.xchangestream.core.StreamingMarketDataService)2 Disposable (io.reactivex.disposables.Disposable)2 Test (org.junit.Test)2 ExchangeSpecification (org.knowm.xchange.ExchangeSpecification)2 CurrencyPair (org.knowm.xchange.currency.CurrencyPair)1