Map<String, dynamic> toJson() { return { 'hex_bytes': hexBytes, 'curve_type': curveType, }..removeWhere((key, value) => value == null); }