import { OrderType } from '@katanaperps/katana-perps-sdk';
if (!orderEventData.type) {
// orderLong is of type IKatanaPerpsOrderEventDataSystemFill
} else {
// orderLong is of type KatanaPerpsOrderEventDataGeneral
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.
undefinedtype indicating a KatanaPerpsOrderEventDataSystemFill where thefillsproperty will include a FillTypeSystem fill matching KatanaPerpsOrderFillEventDataSystemtypeproperty between these types and all the others as shown in the example below.