Function: isWsFormattedUserDataEvent()
ts
function isWsFormattedUserDataEvent(data: WsFormattedMessage): data is WsUserDataEvents;Works for both the listen key & WS API user data stream workflows.
- For the listen key workflow, uses the wsKey to identify the connection dedicated to the user data stream.
- For the WS API user data stream, uses the eventType to identify user data events from a known list (
EVENT_TYPES_USER_DATA).
Parameters
| Parameter | Type |
|---|---|
data | WsFormattedMessage |
Returns
data is WsUserDataEvents