Use promptpin
MODIFY
WalletWasabi.Gui/Models/LoadWalletEntry.cs
WalletWasabi.Gui/Models/LoadWalletEntry.cs
@@ -30,6 +30,10 @@ namespace WalletWasabi.Gui.Models
{
WalletName = hwi.Type.ToString() + $" - Device Not Ready";
}
+ else if (hwi.NeedPin)
+ {
+ WalletName = hwi.Type.ToString();
+ }
else
{
WalletName = hwi.Type.ToString() + $" - Error: {hwi.Error}";

MODIFY
WalletWasabi.Gui/Tabs/WalletManager/LoadWalletViewModel.cs
WalletWasabi.Gui/Tabs/WalletManager/LoadWalletViewModel.cs
@@ -410,10 +410,18 @@ namespace WalletWasabi.Gui.Tabs.WalletManager
TryRefreshHardwareWallets(hwis);
return await LoadKeyManagerAsync(requirePassword, isHardwareWallet);
}
+ else if (selectedWallet.HardwareWalletInfo.NeedPin)
+ {
+ if (!await HwiProcessManager.PromptPinAsync(selectedWallet.HardwareWalletInfo))
+ {
+ throw new IOException("promptpin request failed.");
+ }
+ selectedWallet.HardwareWalletInfo.SetNeedPinFalse();
+ }
if (selectedWallet.HardwareWalletInfo.MasterFingerprint is null)
{
- throw new InvalidOperationException("Hardware wallet didn't provided a master fingerprint.");
+ throw new InvalidOperationException("Hardware wallet didn't provide a master fingerprint.");
}
if (!TryFindWalletByMasterFingerprint(selectedWallet.HardwareWalletInfo.MasterFingerprint.Value, out walletName))

MODIFY
WalletWasabi/Hwi/Models/HardwareWalletInfo.cs
WalletWasabi/Hwi/Models/HardwareWalletInfo.cs
@@ -28,6 +28,8 @@ namespace WalletWasabi.Hwi.Models
Ready = true;
Initialized = true;
+ NeedPin = false;
+
if (Error != null)
{
if (Error.Contains("Not initialized", StringComparison.OrdinalIgnoreCase))
@@ -41,15 +43,26 @@ namespace WalletWasabi.Hwi.Models
{
Ready = false;
}
+ else if (Error.Contains("Unlock by using 'promptpin' and then 'sendpin'"))
+ {
+ NeedPin = true;
+ }
}
}
public HDFingerprint? MasterFingerprint { get; }
public bool Initialized { get; }
+ public bool NeedPin { get; private set; }
public bool Ready { get; }
public string SerialNumber { get; }
public HardwareWalletType Type { get; }
public string Path { get; }
- public string Error { get; }
+ public string Error { get; private set; }
+
+ public void SetNeedPinFalse()
+ {
+ NeedPin = false;
+ Error = "";
+ }
}
}

Use promptpin