Map<String, dynamic> toJson() => { "value": value, "currency": currency.toJson(), "metadata": metadata }..removeWhere( (dynamic key, dynamic value) => key == null || value == null);