public static CoinsuperGenericOrder adaptOrder ( String orderId , OrderList orderList ) { BigDecimal averagePrice = new BigDecimal ( orderList . getPriceLimit ( ) ) ; BigDecimal cumulativeAmount = new BigDecimal ( orderList . getQuantity ( ) ) ; BigDecimal totalFee = new BigDecimal ( orderList . getFee ( ) ) ; BigDecimal amount = new BigDecimal ( orderList . getQuantity ( ) ) ; OrderType action = OrderType . ASK ; if ( orderList . getAction ( ) . equals ( "Buy" ) ) { action = OrderType . BID ; } // Order Status UNDEAL:Not Executed，PARTDEAL:Partially Executed，DEAL:Order Complete，CANCEL: // Canceled OrderStatus orderStatus = OrderStatus . PENDING_NEW ; if ( orderList . getState ( ) . equals ( "UNDEAL" ) ) { orderStatus = OrderStatus . PENDING_NEW ; } else if ( orderList . getState ( ) . equals ( "Canceled" ) ) { orderStatus = OrderStatus . CANCELED ; } CoinsuperGenericOrder coinsuperGenericOrder = new CoinsuperGenericOrder ( action , amount , new CurrencyPair ( orderList . getSymbol ( ) ) , orderId , CommonUtil . timeStampToDate ( orderList . getUtcCreate ( ) ) , averagePrice , cumulativeAmount , totalFee , orderStatus ) ; return coinsuperGenericOrder ; }
There is no method to discern market versus limit order type - so this returns a generic GenericOrder as a status