Disable coinjoin tab
MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/CoinJoinTabView.xaml
WalletWasabi.Gui/Controls/WalletExplorer/CoinJoinTabView.xaml
</ScrollViewer>
</controls:GroupBox>
<controls:GroupBox Grid.Row="0" Grid.Column="0" Title="CoinJoin" Padding="5" Margin="0 5 5 0">
+
<Grid Grid.Row="0" Grid.Column="0" Classes="content">
<Grid.RowDefinitions>
<RowDefinition Height="150" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
- <StackPanel Grid.Column="0" Spacing="10">
+ <StackPanel IsVisible="{Binding IsWatchOnly}" Grid.Column="0" Spacing="8">
+ <StackPanel VerticalAlignment="Center">
+ <TextBlock Text="Hardware and watch-only wallets cannot coinjoin :(" />
+ </StackPanel>
+ </StackPanel>
+ <StackPanel IsVisible="{Binding !IsWatchOnly}" Grid.Column="0" Spacing="10">
<controls:NoparaPasswordBox Password="{Binding Password}" Watermark="Password" UseFloatingWatermark="True" MinWidth="173" Margin="0 20 0 0" />
<DockPanel Grid.Row="0" Grid.Column="1" LastChildFill="True" IsEnabled="{Binding !IsEnqueueBusy}">
<Button Command="{Binding EnqueueCommand}" DockPanel.Dock="Right">

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/CoinJoinTabViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/CoinJoinTabViewModel.cs
@@ -11,8 +11,10 @@ using System.Text;
using System.Threading.Tasks;
using WalletWasabi.Gui.ViewModels;
using WalletWasabi.Helpers;
+using WalletWasabi.KeyManagement;
using WalletWasabi.Logging;
using WalletWasabi.Models.ChaumianCoinJoin;
+using WalletWasabi.Services;
using static WalletWasabi.Gui.Models.ShieldLevelHelper;
namespace WalletWasabi.Gui.Controls.WalletExplorer

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/WalletActionViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/WalletActionViewModel.cs
@@ -3,6 +3,8 @@ using AvalonStudio.Shell;
using ReactiveUI;
using System.Reactive;
using WalletWasabi.Gui.ViewModels;
+using WalletWasabi.KeyManagement;
+using WalletWasabi.Services;
namespace WalletWasabi.Gui.Controls.WalletExplorer
{
@@ -10,6 +12,10 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
{
public WalletViewModel Wallet { get; }
+ public WalletService WalletService => Wallet.WalletService;
+ public KeyManager KeyManager => WalletService.KeyManager;
+ public bool IsWatchOnly => KeyManager.IsWatchOnly;
+
public WalletActionViewModel(string title, WalletViewModel walletViewModel)
: base(title)
{

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/WalletInfoView.xaml
WalletWasabi.Gui/Controls/WalletExplorer/WalletInfoView.xaml
<controls:GroupBox Title="Keys" TextBlock.FontSize="16" Padding="30" Margin="0 10 0 0">
<Grid Classes="content">
<StackPanel Orientation="Vertical" Spacing="2">
- <StackPanel Orientation="Horizontal">
+ <StackPanel IsVisible="{Binding !IsWatchOnly}" Orientation="Horizontal">
<TextBlock Text="Encrypted Extended Master Private Key: " />
<controls:ExtendedTextBox Text="{Binding EncryptedExtendedMasterPrivateKey , ConverterParameter=40, Converter={StaticResource LurkingWifeModeStringConverter}, Mode=OneWay}" Classes="selectableTextBlock" />
</StackPanel>
- <StackPanel Orientation="Horizontal">
+ <StackPanel IsVisible="{Binding !IsWatchOnly}" Orientation="Horizontal">
<TextBlock Text="Extended Master Private Key: " />
<controls:ExtendedTextBox Text="{Binding ExtendedMasterPrivateKey}" Classes="selectableTextBlock" />
</StackPanel>
- <StackPanel Orientation="Horizontal">
+ <StackPanel IsVisible="{Binding !IsWatchOnly}" Orientation="Horizontal">
<TextBlock Text="Extended Master zprv: " />
<controls:ExtendedTextBox Text="{Binding ExtendedMasterZprv}" Classes="selectableTextBlock" />
</StackPanel>
<controls:ExtendedTextBox Text="{Binding AccountKeyPath}" Classes="selectableTextBlock" />
</StackPanel>
- <StackPanel Orientation="Horizontal">
+ <StackPanel IsVisible="{Binding !IsWatchOnly}" Orientation="Horizontal">
<TextBlock Text="Extended Account Private Key: " />
<controls:ExtendedTextBox Text="{Binding ExtendedAccountPrivateKey}" Classes="selectableTextBlock" />
</StackPanel>
- <StackPanel Orientation="Horizontal">
+ <StackPanel IsVisible="{Binding !IsWatchOnly}" Orientation="Horizontal">
<TextBlock Text="Extended Account zprv: " />
<controls:ExtendedTextBox Text="{Binding ExtendedAccountZprv}" Classes="selectableTextBlock" />
</StackPanel>
<controls:ExtendedTextBox Text="{Binding ExtendedAccountZpub, ConverterParameter=60, Converter={StaticResource LurkingWifeModeStringConverter}, Mode=OneWay}" Classes="selectableTextBlock" />
</StackPanel>
- <StackPanel Margin="0 10 0 0" Spacing="10" Orientation="Horizontal">
+ <StackPanel IsVisible="{Binding !IsWatchOnly}" Margin="0 10 0 0" Spacing="10" Orientation="Horizontal">
<controls:NoparaPasswordBox Password="{Binding Password}" Watermark="Password" UseFloatingWatermark="True" MinWidth="173" MaxWidth="173" />
<DockPanel VerticalAlignment="Top" LastChildFill="True">
<Button Command="{Binding ShowSensitiveKeysCommand}" DockPanel.Dock="Right">

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/WalletInfoViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/WalletInfoViewModel.cs
@@ -84,12 +84,9 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
public CancellationTokenSource Closing { private set; get; }
- public WalletService WalletService => Wallet.WalletService;
- public KeyManager KeyManager => WalletService.KeyManager;
-
public string ExtendedAccountPublicKey => KeyManager.ExtPubKey.ToString(Global.Network);
public string ExtendedAccountZpub => KeyManager.ExtPubKey.ToZpub(Global.Network);
- public string EncryptedExtendedMasterPrivateKey => KeyManager.EncryptedSecret.ToWif();
+ public string EncryptedExtendedMasterPrivateKey => KeyManager?.EncryptedSecret?.ToWif() ?? "";
public string AccountKeyPath => $"m/{KeyManager.AccountKeyPath.ToString()}";
public ReactiveCommand<Unit, Unit> ShowSensitiveKeysCommand { get; }

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/WalletViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/WalletViewModel.cs
@@ -24,7 +24,8 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
: base(Path.GetFileNameWithoutExtension(walletService.KeyManager.FilePath))
{
WalletService = walletService;
- Name = Path.GetFileNameWithoutExtension(WalletService.KeyManager.FilePath);
+ var keyManager = WalletService.KeyManager;
+ Name = Path.GetFileNameWithoutExtension(keyManager.FilePath);
SetBalance(Name);

MODIFY
WalletWasabi.Gui/Tabs/WalletManager/LoadWalletViewModel.cs
WalletWasabi.Gui/Tabs/WalletManager/LoadWalletViewModel.cs
@@ -336,7 +336,7 @@ namespace WalletWasabi.Gui.Tabs.WalletManager
walletName = $"{selectedHwi.Type}-{selectedHwi.Fingerprint}";
var path = Global.GetWalletFullPath(walletName);
- KeyManager.CreateNew(extPubKey, path);
+ KeyManager.CreateNewWatchOnly(extPubKey, path);
}
}
else

MODIFY
WalletWasabi/KeyManagement/KeyManager.cs
WalletWasabi/KeyManagement/KeyManager.cs
@@ -125,7 +125,7 @@ namespace WalletWasabi.KeyManagement
return new KeyManager(encryptedSecret, extKey.ChainCode, extKey.Derive(AccountKeyPath).Neuter(), false, new BlockchainState(), filePath);
}
- public static KeyManager CreateNew(ExtPubKey extPubKey, string filePath = null)
+ public static KeyManager CreateNewWatchOnly(ExtPubKey extPubKey, string filePath = null)
{
return new KeyManager(null, null, extPubKey, null, new BlockchainState(), filePath);
}
@@ -380,6 +380,11 @@ namespace WalletWasabi.KeyManagement
public ExtKey GetMasterExtKey(string password)
{
+ if (IsWatchOnly)
+ {
+ throw new SecurityException("This is a watchonly wallet.");
+ }
+
try
{
Key secret = EncryptedSecret.GetKey(password);

Disable coinjoin tab