Add Script Type column
MODIFY
WalletWasabi.Fluent/ViewModels/CoinControl/CoinSelectorViewModel.cs
WalletWasabi.Fluent/ViewModels/CoinControl/CoinSelectorViewModel.cs
@@ -40,6 +40,7 @@ public class CoinSelectorViewModel : ViewModelBase, IDisposable
IndicatorsColumn(),
AmountColumn(),
AnonymityScoreColumn(),
+ ScriptTypeColumn(),
pocketColumn
}
};
@@ -167,6 +168,19 @@ 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)
@@ -202,6 +216,23 @@ 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/ViewModels/CoinControl/Core/CoinCoinControlItemViewModel.cs
WalletWasabi.Fluent/ViewModels/CoinControl/Core/CoinCoinControlItemViewModel.cs
@@ -20,6 +20,7 @@ public class CoinCoinControlItemViewModel : CoinControlItemViewModelBase
BannedUntilUtc = smartCoin.BannedUntilUtc;
IsSelected = false;
CanBeSelected = !IsCoinjoining;
+ ScriptType = smartCoin.ScriptType;
}
public SmartCoin SmartCoin { get; }

MODIFY
WalletWasabi.Fluent/ViewModels/CoinControl/Core/CoinControlItemViewModelBase.cs
WalletWasabi.Fluent/ViewModels/CoinControl/Core/CoinControlItemViewModelBase.cs
@@ -58,4 +58,6 @@ public abstract class CoinControlItemViewModelBase : ViewModelBase
this.RaiseAndSetIfChanged(ref _isSelected, value);
}
}
+
+ public ScriptType? ScriptType { get; protected set; }
}

MODIFY
WalletWasabi.Fluent/ViewModels/CoinControl/Core/PocketCoinControlItemViewModel.cs
WalletWasabi.Fluent/ViewModels/CoinControl/Core/PocketCoinControlItemViewModel.cs
@@ -24,6 +24,7 @@ public class PocketCoinControlItemViewModel : CoinControlItemViewModelBase, IDis
Labels = pocket.Labels;
Children = pocket.Coins.OrderByDescending(x => x.Amount).Select(coin => new CoinCoinControlItemViewModel(coin)).ToList();
CanBeSelected = true;
+ ScriptType = null;
Children
.AsObservableChangeSet()

Add Script Type column