User Data Stream
These are used to manage Listen Keys
that are used to receive User Data Stream Updates
in real time
Spot
StartUserStream
Starts a user stream by requesting a listen key.
This listen key can be used in subsequent requests to SubscribeToUserDataUpdates
The stream will close after 60
minutes unless a keep alive is send.
string listenKey = restClient.Spot.UserStream.StartUserStream();
socketClient.UserDataStreams.Updates(listenKey, ...);
KeepAliveUserStream
Sends a keep alive for the current user stream listen key to keep the stream from closing.
Stream auto closes after 60
minutes if no keep alive is send.
30
minute interval for keep alive is recommended.
restClient.Spot.UserStream.KeepAliveUserStream();
StopUserStream
Stops the current user stream
restClient.Spot.UserStream.StopUserStream();
Margin
StartUserStream
Starts a user stream for margin account by requesting a listen key.
This listen key can be used in subsequent requests to SubscribeToUserDataUpdates
The stream will close after 60
minutes unless a keep alive is send.
string listenKey = restClient.Margin.UserStream.StartUserStream();
socketClient.UserDataStreams.Updates(listenKey, ...);
KeepAliveUserStream
Sends a keep alive for the current user stream for margin account listen key to keep the stream from closing.
Stream auto closes after 60
minutes if no keep alive is send. 30
minute interval for keep alive is recommended.
restClient.Margin.UserStream.KeepAliveUserStream();
StopUserStream
Close the user stream for the cross margin account
restClient.Margin.UserStream.StopUserStream();
Isolated
StartIsolatedUserStream
Starts a user stream for margin account by requesting a listen key.
This listen key can be used in subsequent requests to SubscribeToUserDataUpdates
The stream will close after 60
minutes unless a keep alive is send.
string listenKey = restClient.Margin.IsolatedUserStream.StartIsolatedMarginUserStream();
socketClient.UserDataStreams.Updates(listenKey, ...);
KeepAliveIsolatedUserStream
Sends a keep alive for the current user stream for margin account listen key to keep the stream from closing.
Stream auto closes after 60
minutes if no keep alive is send. 30
minute interval for keep alive is recommended.
restClient.Margin.IsolatedUserStream.KeepAliveIsolatedMarginUserStream();
CloseIsolatedUserStream
Close the user stream for the isolated margin account
restClient.Margin.IsolatedUserStream.StopIsolatedMarginUserStream();
User Data Websocket Stream
Updates
Subscribes to the account update stream. Prior to using this, one of the StartUserStream
methods should be called.
socketClient.UserDataStreams.Updates();