Add KeyPathConverter
ADD
WalletWasabi/JsonConverters/KeyPathJsonConverter.cs
+using NBitcoin;
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace WalletWasabi.JsonConverters
+{
+ public class KeyPathJsonConverter : JsonConverter
+ {
+ /// <inheritdoc />
+ public override bool CanConvert(Type objectType)
+ {
+ return objectType == typeof(KeyPath);
+ }
+
+ /// <inheritdoc />
+ public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
+ {
+ var s = (string)reader.Value;
+ if (string.IsNullOrWhiteSpace(s))
+ {
+ return null;
+ }
+ var kp = KeyPath.Parse(s.Trim());
+
+ return kp;
+ }
+
+ /// <inheritdoc />
+ public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
+ {
+ var kp = (KeyPath)value;
+
+ var s = kp.ToString();
+ writer.WriteValue(s);
+ }
+ }
+}

MODIFY
WalletWasabi/KeyManagement/KeyManager.cs
WalletWasabi/KeyManagement/KeyManager.cs
@@ -6,7 +6,6 @@ using System.IO;
using System.Linq;
using System.Security;
using System.Text;
-using NBitcoin.JsonConverters;
using WalletWasabi.Helpers;
using WalletWasabi.Hwi.Models;
using WalletWasabi.JsonConverters;
@@ -27,7 +26,7 @@ namespace WalletWasabi.KeyManagement
public byte[] ChainCode { get; }
[JsonProperty(Order = 3)]
- [JsonConverter(typeof(JsonConverters.HDFingerprintJsonConverter))]
+ [JsonConverter(typeof(HDFingerprintJsonConverter))]
public HDFingerprint? MasterFingerprint { get; private set; }
[JsonProperty(Order = 4)]

Add KeyPathConverter