From ef8071ba93c5b7085ddc0e7215a48043e127dae5 Mon Sep 17 00:00:00 2001 From: d11n Date: Thu, 16 Jan 2025 06:36:23 +0100 Subject: [PATCH] App: SignalR-related updates (#6537) Adds Newtonsoft JSON converters for the SignalR connection, which we need to pass data back and forth. --- BTCPayServer.Client/App/IBTCPayAppHubClient.cs | 3 +-- BTCPayServer/BTCPayServer.csproj | 1 + BTCPayServer/Hosting/Startup.cs | 6 +++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/BTCPayServer.Client/App/IBTCPayAppHubClient.cs b/BTCPayServer.Client/App/IBTCPayAppHubClient.cs index 78e0c17a8..05f7090dc 100644 --- a/BTCPayServer.Client/App/IBTCPayAppHubClient.cs +++ b/BTCPayServer.Client/App/IBTCPayAppHubClient.cs @@ -44,7 +44,7 @@ public interface IBTCPayAppHubServer Task DeriveScript(string identifier); Task TrackScripts(string identifier, string[] scripts); Task UpdatePsbt(string[] identifiers, string psbt); - Task GetUTXOs(string[] identifiers); + Task> GetUTXOs(string[] identifiers); Task> GetTransactions(string[] identifiers); Task SendInvoiceUpdate(LightningInvoice lightningInvoice); Task GetCurrentMaster(); @@ -94,7 +94,6 @@ public class TransactionDetectedRequest public class CoinResponse { - public string? Identifier{ get; set; } public bool Confirmed { get; set; } public string? Script { get; set; } public string? Outpoint { get; set; } diff --git a/BTCPayServer/BTCPayServer.csproj b/BTCPayServer/BTCPayServer.csproj index 3f3f45b2f..9ac706557 100644 --- a/BTCPayServer/BTCPayServer.csproj +++ b/BTCPayServer/BTCPayServer.csproj @@ -81,6 +81,7 @@ + diff --git a/BTCPayServer/Hosting/Startup.cs b/BTCPayServer/Hosting/Startup.cs index 51b59a00d..58cc25637 100644 --- a/BTCPayServer/Hosting/Startup.cs +++ b/BTCPayServer/Hosting/Startup.cs @@ -115,7 +115,11 @@ namespace BTCPayServer.Hosting services.AddBTCPayServer(Configuration, Logs); services.AddProviderStorage(); services.AddSession(); - services.AddSignalR(); + services.AddSignalR().AddNewtonsoftJsonProtocol(options => + { + NBitcoin.JsonConverters.Serializer.RegisterFrontConverters(options.PayloadSerializerSettings); + options.PayloadSerializerSettings.Converters.Add(new BTCPayServer.Lightning.JsonConverters.LightMoneyJsonConverter()); + }); services.AddFido2(options => { options.ServerName = "BTCPay Server";