add option to sign and broadcast automatically
MODIFY
WalletWasabi.Fluent/Helpers/TransactionHelpers.cs
WalletWasabi.Fluent/Helpers/TransactionHelpers.cs
@@ -91,7 +91,7 @@ namespace WalletWasabi.Fluent.Helpers
return psbt.ExtractSmartTransaction();
}
- public static async Task ExportTransactionToBinaryAsync(BuildTransactionResult transaction)
+ public static async Task<bool> ExportTransactionToBinaryAsync(BuildTransactionResult transaction)
{
var psbtExtension = "psbt";
var filePath = await FileDialogHelper.ShowSaveFileDialogAsync("Export transaction", psbtExtension);
@@ -104,7 +104,11 @@ namespace WalletWasabi.Fluent.Helpers
filePath = $"{filePath}.{psbtExtension}";
}
await File.WriteAllBytesAsync(filePath, transaction.Psbt.ToBytes());
+
+ return true;
}
+
+ return false;
}
}
}

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionPreviewViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/TransactionPreviewViewModel.cs
@@ -51,12 +51,17 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
PayJoinUrl = info.PayJoinClient?.PaymentUrl.AbsoluteUri;
IsPayJoin = PayJoinUrl is not null;
- if (wallet.KeyManager.PreferPsbtWorkflow)
+ if (PreferPsbtWorkflow)
{
+ SkipCommand = ReactiveCommand.CreateFromTask(async () => await OnConfirmAsync(transaction));
NextCommand = ReactiveCommand.CreateFromTask(async () =>
{
- await TransactionHelpers.ExportTransactionToBinaryAsync(transaction);
+ var saved = await TransactionHelpers.ExportTransactionToBinaryAsync(transaction);
+
+ if (saved)
+ {
Navigate().To(new SuccessViewModel("The PSBT has been successfully created."));
+ }
});
_nextButtonText = "Save PSBT file";
}
@@ -68,6 +73,8 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
}
+ public bool PreferPsbtWorkflow => _wallet.KeyManager.PreferPsbtWorkflow;
+
public string AmountText { get; }
public string AddressText { get; }

MODIFY
WalletWasabi.Fluent/Views/Wallets/Send/TransactionPreviewView.axaml
WalletWasabi.Fluent/Views/Wallets/Send/TransactionPreviewView.axaml
EnableCancel="{Binding EnableCancel}"
EnableBack="{Binding EnableBack}"
EnableNext="True" NextContent="{Binding NextButtonText}"
+ EnableSkip="{Binding PreferPsbtWorkflow}" SkipContent="Confirm"
IsBusy="{Binding IsBusy}"
ScrollViewer.VerticalScrollBarVisibility="Auto">
<StackPanel Spacing="20">

add option to sign and broadcast automatically