binance-exchange / binance-java-api

binance-java-api is a lightweight Java library for the Binance API, supporting synchronous and asynchronous requests, as well as event streaming using WebSockets.
MIT License
831 stars 628 forks source link

websocket stream don't support extra config #351

Open ramarro123 opened 3 years ago

ramarro123 commented 3 years ago

it seems that

public Closeable onDepthEvent(String symbols, BinanceApiCallback<DepthEvent> callback) {
    String channel = (String)Arrays.stream(symbols.split(",")).map(String::trim).map((s) -> {
        return String.format("%s@depth", s);
    }).collect(Collectors.joining("/"));
    return this.createNewWebSocket(channel, new BinanceApiWebSocketListener(callback, DepthEvent.class));
}

don't allow to use the params specified here

https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-streams.md#all-book-tickers-stream

for instance

Stream Names: symbol>@depth<levels OR symbol>@depth<**levels**@100ms

Update Speed: 1000ms or 100ms