Type alias KumaOrderEventData

Order updates received from the WebSocket differ from orders retreived from the REST API in several ways.

  • In addition to the order types received when getting orders from the REST API, WebSocket update events may also provide the following undefined type indicating a KumaOrderEventDataSystemFill where the fills property will include a FillTypeSystem fill matching KumaOrderFillEventDataSystem
  • It is best to narrow on the type property between these types and all the others as shown in the example below.
    • This is made easiest by using the OrderType enum as shown.

Example

 import { OrderType } from '@kumabid/kuma-sdk';

if (!orderEventData.type) {
// orderLong is of type IKumaOrderEventDataSystemFill
} else {
// orderLong is of type KumaOrderEventDataGeneral
switch(orderEventData.type) {
case OrderType.fill:
break;
// ...etc
}
}


See