Integrate Script Type in Indicators
ADD
WalletWasabi.Fluent/Converters/ScriptTypeConverter.cs
+using System.Globalization;
+using Avalonia.Data.Converters;
+using NBitcoin;
+
+namespace WalletWasabi.Fluent.Converters;
+
+public class ScriptTypeConverter : IValueConverter
+{
+ public static readonly ScriptTypeConverter Instance = new();
+
+ public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
+ {
+ return value switch
+ {
+ ScriptType.MultiSig => "",
+ null => "",
+ ScriptType.Witness => "",
+ ScriptType.P2SH => "",
+ ScriptType.P2PK => "",
+ ScriptType.P2PKH => "",
+ ScriptType.P2WSH => "SW",
+ ScriptType.P2WPKH => "SW",
+ ScriptType.Taproot => "TR",
+ _ => throw new ArgumentOutOfRangeException(nameof(value), value, null)
+ };
+ }
+
+ public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
+ {
+ throw new NotSupportedException();
+ }
+}

MODIFY
WalletWasabi.Fluent/ViewModels/CoinControl/CoinSelectorViewModel.cs
WalletWasabi.Fluent/ViewModels/CoinControl/CoinSelectorViewModel.cs
@@ -41,7 +41,6 @@ public class CoinSelectorViewModel : ViewModelBase, IDisposable
AmountColumn(),
AnonymityScoreColumn(),
pocketColumn,
- ScriptTypeColumn()
}
};
@@ -168,19 +167,6 @@ public class CoinSelectorViewModel : ViewModelBase, IDisposable
});
}
- private IColumn<CoinControlItemViewModelBase> ScriptTypeColumn()
- {
- return new PlainTextColumn<CoinControlItemViewModelBase>(
- "Script Type",
- node => GetScriptType(node.ScriptType),
- GridLength.Auto,
- new ColumnOptions<CoinControlItemViewModelBase>
- {
- CompareAscending = SortAscending<CoinControlItemViewModelBase, Money>(x => x.Amount),
- CompareDescending = SortDescending<CoinControlItemViewModelBase, Money>(x => x.Amount)
- });
- }
-
private static int GetLabelPriority(CoinControlItemViewModelBase coin)
{
if (coin.Labels == CoinPocketHelper.PrivateFundsText)
@@ -216,23 +202,6 @@ public class CoinSelectorViewModel : ViewModelBase, IDisposable
return 0;
}
- private static string GetScriptType(ScriptType? nodeScriptType)
- {
- return nodeScriptType switch
- {
- ScriptType.MultiSig => "",
- null => "",
- ScriptType.Witness => "",
- ScriptType.P2SH => "",
- ScriptType.P2PK => "",
- ScriptType.P2PKH => "",
- ScriptType.P2WSH => "SW",
- ScriptType.P2WPKH => "SW",
- ScriptType.Taproot => "TR",
- _ => throw new ArgumentOutOfRangeException(nameof(nodeScriptType), nodeScriptType, null)
- };
- }
-
private static IReadOnlyCollection<PocketCoinControlItemViewModel> CreatePocketItems(IEnumerable<Pocket> pockets)
{
return pockets

MODIFY
WalletWasabi.Fluent/Views/CoinControl/Core/Cells/IndicatorsCellView.axaml
WalletWasabi.Fluent/Views/CoinControl/Core/Cells/IndicatorsCellView.axaml
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:core="clr-namespace:WalletWasabi.Fluent.ViewModels.CoinControl.Core"
+ xmlns:converters="clr-namespace:WalletWasabi.Fluent.Converters"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:DataType="core:CoinControlItemViewModelBase"
x:CompileBindings="True"
<PathIcon IsVisible="{Binding !IsCoinjoining}"
Data="{StaticResource wallet_action_coinjoin}"
Height="15"
- Opacity="0.3"
+ Opacity="0.6"
ToolTip.Tip="Not coinjoining" />
</Panel>
+ <Border BorderThickness="1" IsVisible="{Binding #ScriptType.Text, Converter={x:Static StringConverters.IsNotNullOrEmpty}}" BorderBrush="{DynamicResource TextControlForeground}" Opacity="0.6" CornerRadius="4" Padding="3">
+ <TextBlock Classes="h10" x:Name="ScriptType" Text="{Binding ScriptType, Converter={x:Static converters:ScriptTypeConverter.Instance}}" />
+ </Border>
+
<!-- Banned -->
<PathIcon IsVisible="{Binding IsBanned}"
Data="{StaticResource warning_filled}"

Integrate Script Type in Indicators