Connects to MEXC's Websocket API and allows to subscribe to various data channels.
- OHLC streaming for all supported intervals
- Robust connection lost detection with automatic re-connect and resubscribe to previously subscribed topics
<dependency>
<groupId>net.osslabz</groupId>
<artifactId>mexc-client</artifactId>
<version>0.0.1</version>
</dependency>
MexcClient client = new MexcClient();
client.subscribe(new CurrencyPair("BTC", "USDT"), Interval.PT1M, ohlc -> {
log.debug("{}", ohlc);
});
client.unsubscribe(new CurrencyPair("BTC", "USDT"), Interval.PT1M);
client.close();
This project uses slf4j-api but doesn't package an implementation. This is up to the using application. For the tests logback is backing slf4j as implementation, with a default configuration logging to STOUT.
mexc-client targets Java 17.