https://github.com/osslabz/mexc-client
A websocket client for the MEXC API
https://github.com/osslabz/mexc-client
crypto cryptocurrencies cryptocurrency exchange mexc mexc-api mexc-client mexc-java-client mexc-websocket-client websocket websocket-client
Last synced: about 1 year ago
JSON representation
A websocket client for the MEXC API
- Host: GitHub
- URL: https://github.com/osslabz/mexc-client
- Owner: osslabz
- License: apache-2.0
- Created: 2024-06-24T12:52:57.000Z (almost 2 years ago)
- Default Branch: dev
- Last Pushed: 2024-10-29T13:08:43.000Z (over 1 year ago)
- Last Synced: 2024-10-29T15:56:55.323Z (over 1 year ago)
- Topics: crypto, cryptocurrencies, cryptocurrency, exchange, mexc, mexc-api, mexc-client, mexc-java-client, mexc-websocket-client, websocket, websocket-client
- Language: Java
- Homepage:
- Size: 174 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Mexc-Client
============



[](https://search.maven.org/artifact/net.osslabz/mexc-client)
Connects to [MEXC's Websocket API](https://www.mexc.com/mexc-api) and allows to subscribe to various data channels.
Features:
---------
- OHLC streaming for all supported intervals
- Robust connection lost detection with automatic re-connect and resubscribe to previously subscribed topics
QuickStart
---------
Maven
------
```xml
net.osslabz
mexc-client
0.0.1
```
Usage
------
```java
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();
```
Logging
------
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.
Compatibility
------
mexc-client targets Java 17.