toJson method

Map<String, dynamic> toJson()

Converts an Order to a JSON object.

Implementation

Map<String, dynamic> toJson() => {
      'orderId': orderId,
      'productId': productId,
      'userId': userId,
      'orderConfiguration': orderConfiguration,
      'side': side?.toCB(),
      'clientOrderId': clientOrderId,
      'status': status?.toCB(),
      'timeInForce': timeInForce?.toCB(),
      'createdTime': createdTime?.toIso8601String(),
      'completionPercentage': completionPercentage,
      'filledSize': filledSize,
      'averageFilledPrice': averageFilledPrice,
      'fee': fee,
      'numberOfFills': numberOfFills,
      'filledValue': filledValue,
      'pendingCancel': pendingCancel,
      'sizeInQuote': sizeInQuote,
      'totalFees': totalFees,
      'sizeInclusiveOfFees': sizeInclusiveOfFees,
      'totalValueAfterFees': totalValueAfterFees,
      'triggerStatus': triggerStatus?.toCB(),
      'orderType': orderType?.toCB(),
      'rejectReason': rejectReason?.toCB(),
      'settled': settled,
      'productType': productType?.toCB(),
      'rejectMessage': rejectMessage,
      'cancelMessage': cancelMessage
    };