Order.fromCBJson constructor

Order.fromCBJson(
  1. Map<String, dynamic> json
)

Creates an Order from a Coinbase JSON object.

Implementation

Order.fromCBJson(Map<String, dynamic> json)
    : orderId = json['order_id'],
      productId = json['product_id'],
      userId = json['user_id'],
      orderConfiguration =
          OrderConfiguration.fromCBJson(json['order_configuration']),
      side = OrderSide.fromCB(json['side']),
      clientOrderId = json['client_order_id'],
      status = OrderStatus.fromCB(json['status']),
      timeInForce = TimeInForce.fromCB(json['time_in_force']),
      createdTime = DateTime.parse(json['created_time']),
      completionPercentage = nullableDouble(json, 'completion_percentage'),
      filledSize = nullableDouble(json, 'filled_size'),
      averageFilledPrice = nullableDouble(json, 'average_filled_price'),
      fee = json['fee'],
      numberOfFills = nullableDouble(json, 'number_of_fills'),
      filledValue = nullableDouble(json, 'filled_value'),
      pendingCancel = json['pending_cancel'],
      sizeInQuote = json['size_in_quote'],
      totalFees = nullableDouble(json, 'total_fees'),
      sizeInclusiveOfFees = json['size_inclusive_of_fees'],
      totalValueAfterFees = nullableDouble(json, 'total_value_after_fees'),
      triggerStatus = TriggerStatus.fromCB(json['trigger_status']),
      orderType = OrderType.fromCB(json['order_type']),
      rejectReason = RejectReason.fromCB(json['reject_reason']),
      settled = json['settled'],
      productType = ProductType.fromCB(json['product_type']),
      rejectMessage = json['reject_message'],
      cancelMessage = json['cancel_message'];