convertJson static method

Product convertJson(
  1. Map<String, dynamic> jsonObject
)

Implementation

static Product convertJson(Map<String, dynamic> jsonObject) {
  String id = jsonObject['id'];
  String? baseCurrency = jsonObject['base_currency'];
  String? quoteCurrency = jsonObject['quote_currency'];
  double? quoteIncrement = double.parse(jsonObject['quote_increment']);
  double? baseIncrement = double.parse(jsonObject['base_increment']);
  String? displayName = jsonObject['display_name'];
  double? minMarketFunds = double.parse(jsonObject['min_market_funds']);
  bool marginEnabled = jsonObject['margin_enabled'];
  bool postOnly = jsonObject['post_only'];
  bool limitOnly = jsonObject['limit_only'];
  bool cancelOnly = jsonObject['cancel_only'];
  String? status = jsonObject['status'];
  String? statusMessage = jsonObject['status_message'];
  bool tradingDisabled = jsonObject['trading_disabled'];
  bool fxStablecoin = jsonObject['fx_stablecoin'];
  double? maxSlippagePercentage =
      double.parse(jsonObject['max_slippage_percentage']);
  bool auctionMode = jsonObject['auction_mode'];

  return Product(
      id,
      baseCurrency,
      quoteCurrency,
      quoteIncrement,
      baseIncrement,
      displayName,
      minMarketFunds,
      marginEnabled,
      postOnly,
      limitOnly,
      cancelOnly,
      status,
      statusMessage,
      tradingDisabled,
      fxStablecoin,
      maxSlippagePercentage,
      auctionMode);
}