Function: appendEventIfMissing()
ts
function appendEventIfMissing(
wsMsg: any,
wsKey: WsKey,
eventType: string | undefined
): void;For some topics, the received event does not include any information on the topic the event is for (e.g. book tickers).
This method extracts this using available context, to add an "eventType" property if missing.
- For the old WebsocketClient, this is extracted using the WsKey.
- For the new multiplex Websocketclient, this is extracted using the "stream" parameter.
Parameters
| Parameter | Type |
|---|---|
wsMsg | any |
wsKey | WsKey |
eventType | string | undefined |
Returns
void