import { OrderType } from '@idexio/idex-sdk';
if (!orderEventData.type) {
// orderLong is of type IIDEXOrderEventDataSystemFill
} else {
// orderLong is of type IDEXOrderEventDataGeneral
switch(orderEventData.type) {
case OrderType.fill:
break;
// ...etc
}
}
Order updates received from the WebSocket differ from orders retreived from the REST API in several ways.
undefined
type indicating a IDEXOrderEventDataSystemFill where thefills
property will include a FillTypeSystem fill matching IDEXOrderFillEventDataSystemtype
property between these types and all the others as shown in the example below.