public static void FromJson(JToken json, out string algorithm, out HashRate hashRate) { var jsonProperty = (JProperty)json; algorithm = jsonProperty.Name; hashRate = new HashRate(jsonProperty.Value.Value <double>(), Metric.Unit); }
public static JProperty ToJson(this string algorithm, HashRate hashRate) => new JProperty(algorithm, hashRate.Convert(Metric.Unit).Value);