knowm / XChange

XChange is a Java library providing a streamlined API for interacting with 60+ Bitcoin and Altcoin exchanges providing a consistent interface for trading and accessing market data.
http://knowm.org/open-source/xchange/
MIT License
3.81k stars 1.93k forks source link

org.knowm.xchange.exceptions.NotYetImplementedForExchangeException: getTrades of OkexStreamingExchange #4874

Closed MasonINTS closed 1 month ago

MasonINTS commented 1 month ago

I got error when using getTrades function of OkexStreamingExchange. Please help me StreamingExchange exchange = StreamingExchangeFactory.INSTANCE.createExchange(OkexStreamingExchange.class); exchange.connect().blockingAwait(); StreamingMarketDataService service = exchange .getStreamingMarketDataService(); Disposable subscriptionTrade = service .getTrades(currencyPair) .subscribe(trade -> log.info("Trade: {}", trade), throwable -> log.error("Error in trade subscription", throwable));

rizer1980 commented 1 month ago

Hi, MasonINTS getTrades(CurrencyPair.class) - deprecated. Instead use Instrument.class: Instrument currencyPair = new CurrencyPair("BTC/USDT");

MasonINTS commented 1 month ago

Thank you so much @rizer1980, My issue was solved.