Skip to content

Commit

Permalink
Fixed ListenKey property not set on spot websocket account data updates
Browse files Browse the repository at this point in the history
  • Loading branch information
JKorf committed Nov 19, 2024
1 parent 02c180a commit 9064ee1
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,29 @@ public BinanceSpotUserDataSubscription(
public override CallResult DoHandleMessage(SocketConnection connection, DataEvent<object> message)
{
if (message.Data is BinanceCombinedStream<BinanceStreamPositionsUpdate> positionUpdate)
{
positionUpdate.Data.ListenKey = positionUpdate.Stream;
_positionHandler?.Invoke(message.As(positionUpdate.Data, positionUpdate.Stream, null, SocketUpdateType.Update));
}
else if (message.Data is BinanceCombinedStream<BinanceStreamBalanceUpdate> balanceUpdate)
{
balanceUpdate.Data.ListenKey = balanceUpdate.Stream;
_balanceHandler?.Invoke(message.As(balanceUpdate.Data, balanceUpdate.Stream, null, SocketUpdateType.Update));
}
else if (message.Data is BinanceCombinedStream<BinanceStreamOrderUpdate> orderUpdate)
{
orderUpdate.Data.ListenKey = orderUpdate.Stream;
_orderHandler?.Invoke(message.As(orderUpdate.Data, orderUpdate.Stream, orderUpdate.Data.Symbol, SocketUpdateType.Update));
}
else if (message.Data is BinanceCombinedStream<BinanceStreamOrderList> orderListUpdate)
{
orderListUpdate.Data.ListenKey = orderListUpdate.Stream;
_orderListHandler?.Invoke(message.As(orderListUpdate.Data, orderListUpdate.Stream, null, SocketUpdateType.Update));
}
else if (message.Data is BinanceCombinedStream<BinanceStreamEvent> listenKeyExpired)
{
_listenKeyExpiredHandler?.Invoke(message.As(listenKeyExpired.Data, listenKeyExpired.Stream, null, SocketUpdateType.Update));
}

return new CallResult(null);
}
Expand Down

0 comments on commit 9064ee1

Please sign in to comment.