Readonly
typeThe type property is used to determine the shape of the data property of the update event.
enum MessageEventType
Readonly
dataOrder updates received from the WebSocket differ from orders retreived from the REST API in several ways.
undefined
type indicating a IDEXOrderEventDataSystemFill
where the fills
property will include a FillTypeSystem fill matching
IDEXOrderFillEventDataSystemtype
property between these types and all the
others as shown in the example below. import { OrderEventType } from '@idexio/idex-sdk';
// ...
const orderEventData = orderEvent.data
if (
orderEventData.type === OrderEventType.liquidation ||
orderEventData.type === OrderEventType.deleverage
) {
// orderEventData is of type IDEXOrderEventDataLiquidation | IDEXOrderEventDataDeleverage
} else {
// orderEventData is of type IDEXOrderEventDataGeneral
}
type IDEXOrderEventData
subscription
Websocket messages always include a type property which dictates the shape of itsdata
property.type
will be the name of the subscription that the message correlates to.IDEX<name>Event
interface will document its provideddata
shape and properties.subscriptions
property when dispatched.See
IDEXSubscriptionEventBase