wisespace-io / binance-rs

Rust Library for the Binance API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WebSocket @trade not supported

arekbal opened this issue · comments

commented

Thank you for your work, overall.

But ;)
I couldn't receive any Trade events.

I found this part in websocket processing(stream to events):

} else if msg.find(AGGREGATED_TRADE) != None {
            let trade: TradesEvent = from_str(msg)?;
            (self.handler)(WebsocketEvent::Trade(trade))?

Its wrong, according to this:
https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-streams.md#trade-streams

aggrTrade only happens when you subscribe to @aggrTrade.
'trade' is the one it should respect - @trade.

EDIT: Upon review... the @trade just wasn't supported and Trade meant AggrTrades. This PR enables the @trade stream.

PR: #70