FuturesPosition.fromCBJson constructor
Creates a FuturesPosition from a Coinbase JSON object.
Implementation
factory FuturesPosition.fromCBJson(Map<String, dynamic> json) {
return FuturesPosition(
productId: json['product_id'],
contractSize: json['contract_size'],
side: json['side'],
amount: json['amount'],
avgEntryPrice: json['avg_entry_price'],
currentPrice: json['current_price'],
unrealizedPnl: json['unrealized_pnl'],
expiry: json['expiry'],
underlyingAsset: json['underlying_asset'],
assetImgUrl: json['asset_img_url'],
productName: json['product_name'],
venue: json['venue'],
notionalValue: json['notional_value'],
assetColor: json['asset_color'],
lastTradedAt: json['last_traded_at'],
rollDate: json['roll_date'],
);
}