diff --git a/Plugins/BTCPayServer.Plugins.Breez/BTCPayServer.Plugins.Breez.csproj b/Plugins/BTCPayServer.Plugins.Breez/BTCPayServer.Plugins.Breez.csproj index 56edb3d..da07f55 100644 --- a/Plugins/BTCPayServer.Plugins.Breez/BTCPayServer.Plugins.Breez.csproj +++ b/Plugins/BTCPayServer.Plugins.Breez/BTCPayServer.Plugins.Breez.csproj @@ -9,7 +9,7 @@ Breez / Greenlight Lightweight lightning baby! - 1.0.4 + 1.0.5 true diff --git a/Plugins/BTCPayServer.Plugins.Breez/Views/Breez/Receive.cshtml b/Plugins/BTCPayServer.Plugins.Breez/Views/Breez/Receive.cshtml index c459eb6..365566d 100644 --- a/Plugins/BTCPayServer.Plugins.Breez/Views/Breez/Receive.cshtml +++ b/Plugins/BTCPayServer.Plugins.Breez/Views/Breez/Receive.cshtml @@ -1,4 +1,5 @@ -@using BTCPayServer.Models.StoreViewModels +@using BTCPayServer.Lightning +@using BTCPayServer.Models.StoreViewModels @using BTCPayServer.Plugins.Breez @using BTCPayServer.Security @inject BreezService BreezService @@ -16,7 +17,7 @@ return; var nodeState = sdk.NodeInfo(); - var max = nodeState.maxReceivableMsat / 1000; + var max = LightMoney.MilliSatoshis(nodeState.maxReceivableMsat); } @@ -36,7 +37,7 @@
- +
diff --git a/Plugins/BTCPayServer.Plugins.Breez/Views/Breez/Send.cshtml b/Plugins/BTCPayServer.Plugins.Breez/Views/Breez/Send.cshtml index f979ad8..ea8181e 100644 --- a/Plugins/BTCPayServer.Plugins.Breez/Views/Breez/Send.cshtml +++ b/Plugins/BTCPayServer.Plugins.Breez/Views/Breez/Send.cshtml @@ -1,4 +1,5 @@ -@using BTCPayServer.Models.StoreViewModels +@using BTCPayServer.Lightning +@using BTCPayServer.Models.StoreViewModels @using BTCPayServer.Plugins.Breez @using BTCPayServer.Security @inject BreezService BreezService @@ -16,7 +17,7 @@ return; var nodeState = sdk.NodeInfo(); - var max = nodeState.maxPayableMsat / 1000; + var max = LightMoney.MilliSatoshis(nodeState.maxPayableMsat).ToUnit(LightMoneyUnit.Satoshi); } diff --git a/Plugins/BTCPayServer.Plugins.Breez/Views/Breez/SwapIn.cshtml b/Plugins/BTCPayServer.Plugins.Breez/Views/Breez/SwapIn.cshtml index daef8c5..5e55528 100644 --- a/Plugins/BTCPayServer.Plugins.Breez/Views/Breez/SwapIn.cshtml +++ b/Plugins/BTCPayServer.Plugins.Breez/Views/Breez/SwapIn.cshtml @@ -45,20 +45,15 @@ } - - - - - + + + + + -
+
-
-

- @ViewData["Title"] -

-
@if (inProgressSwap is not null) { @@ -71,7 +66,7 @@
-
+
Please send an amount between
@Money.Satoshis(inProgressSwap.minAllowedDeposit).ToDecimal(MoneyUnit.BTC) and @Money.Satoshis(inProgressSwap.maxAllowedDeposit).ToDecimal(MoneyUnit.BTC)BTC
@if (deriv is not null) { diff --git a/Plugins/BTCPayServer.Plugins.Breez/Views/Breez/SwapInRefund.cshtml b/Plugins/BTCPayServer.Plugins.Breez/Views/Breez/SwapInRefund.cshtml index ac3e438..36ae375 100644 --- a/Plugins/BTCPayServer.Plugins.Breez/Views/Breez/SwapInRefund.cshtml +++ b/Plugins/BTCPayServer.Plugins.Breez/Views/Breez/SwapInRefund.cshtml @@ -14,11 +14,11 @@ } - - - - - + + + + + diff --git a/Plugins/BTCPayServer.Plugins.Breez/Views/Breez/SwapOut.cshtml b/Plugins/BTCPayServer.Plugins.Breez/Views/Breez/SwapOut.cshtml index f09dcb8..25e8381 100644 --- a/Plugins/BTCPayServer.Plugins.Breez/Views/Breez/SwapOut.cshtml +++ b/Plugins/BTCPayServer.Plugins.Breez/Views/Breez/SwapOut.cshtml @@ -24,6 +24,7 @@ { storeId = Context.GetImplicitStoreId(); } + var sdk = BreezService.GetClient(storeId)?.Sdk; if (sdk is null) return; @@ -34,11 +35,11 @@ } - - - - - + + + + + @if (deriv is not null) @@ -56,7 +57,6 @@
-
@@ -71,10 +71,12 @@
+

Minimum: @swapOutRec.min, Maximum: @swapOutRec.max

+ @if (inProgressSwaps?.Any() is true) { diff --git a/Plugins/BTCPayServer.Plugins.Breez/Views/Breez/Sweep.cshtml b/Plugins/BTCPayServer.Plugins.Breez/Views/Breez/Sweep.cshtml index 60ee337..78d75f7 100644 --- a/Plugins/BTCPayServer.Plugins.Breez/Views/Breez/Sweep.cshtml +++ b/Plugins/BTCPayServer.Plugins.Breez/Views/Breez/Sweep.cshtml @@ -1,39 +1,46 @@ @using BTCPayServer -@using BTCPayServer.Abstractions.Extensions +@using BTCPayServer.Models.StoreViewModels @using BTCPayServer.Plugins.Breez @using BTCPayServer.Security -@model string +@using Microsoft.AspNetCore.Mvc.TagHelpers @inject BreezService BreezService @inject BTCPayNetworkProvider BtcPayNetworkProvider @{ - var storeId = Context.GetImplicitStoreId(); Layout = "_Layout"; ViewData.SetActivePage("Breez", "Sweep", "Sweep"); - + string storeId = null; + if (Model is string s) + { + storeId = s; + } + else if (Model is StoreDashboardViewModel dashboardModel) + { + storeId = dashboardModel.StoreId; + } + else + { + storeId = Context.GetImplicitStoreId(); + } var sdk = BreezService.GetClient(storeId)?.Sdk; - var f = sdk.RecommendedFees(); - var info = sdk.NodeInfo(); - - + if (sdk is null) + return; var deriv = Context.GetStoreData().GetDerivationSchemeSettings(BtcPayNetworkProvider, "BTC"); - + var f = sdk.RecommendedFees(); } + + + + + + + @if (deriv is not null) { - + } - - - - - - - - -
@@ -48,20 +55,14 @@
- - + +
- - + +
- -
- - -@section PageFootContent { - -} \ No newline at end of file + \ No newline at end of file diff --git a/Plugins/BTCPayServer.Plugins.Breez/Views/Breez/_Layout.cshtml b/Plugins/BTCPayServer.Plugins.Breez/Views/Breez/_Layout.cshtml index 9035365..0517521 100644 --- a/Plugins/BTCPayServer.Plugins.Breez/Views/Breez/_Layout.cshtml +++ b/Plugins/BTCPayServer.Plugins.Breez/Views/Breez/_Layout.cshtml @@ -2,4 +2,9 @@ Layout = "../Shared/_NavLayout.cshtml"; ViewData["NavPartialName"] = "_Nav"; } + @RenderBody() \ No newline at end of file diff --git a/Plugins/BTCPayServer.Plugins.Wabisabi/Coordinator/WabiSabiController.cs b/Plugins/BTCPayServer.Plugins.Wabisabi/Coordinator/WabiSabiController.cs index a469969..4ead252 100644 --- a/Plugins/BTCPayServer.Plugins.Wabisabi/Coordinator/WabiSabiController.cs +++ b/Plugins/BTCPayServer.Plugins.Wabisabi/Coordinator/WabiSabiController.cs @@ -41,7 +41,6 @@ public class WabiSabiController : ControllerBase, IWabiSabiApiRequestHandler [HttpPost("status")] public async Task GetStatusAsync(RoundStateRequest request, CancellationToken cancellationToken) { - var before = DateTimeOffset.UtcNow; var response = await Arena.GetStatusAsync(request, cancellationToken); var medians = CoinJoinFeeRateStatStore.GetDefaultMedians(); var affiliateInformation = AffiliationManager.GetAffiliateInformation(); @@ -55,8 +54,6 @@ public class WabiSabiController : ControllerBase, IWabiSabiApiRequestHandler { using CancellationTokenSource timeoutCts = new(RequestTimeout); using CancellationTokenSource linkedCts = CancellationTokenSource.CreateLinkedTokenSource(timeoutCts.Token, cancellationToken); - - var before = DateTimeOffset.UtcNow; var ret = await IdempotencyRequestCache.GetCachedResponseAsync(request, action: Arena.ConfirmConnectionAsync, linkedCts.Token); return ret; @@ -68,7 +65,6 @@ public class WabiSabiController : ControllerBase, IWabiSabiApiRequestHandler using CancellationTokenSource timeoutCts = new(RequestTimeout); using CancellationTokenSource linkedCts = CancellationTokenSource.CreateLinkedTokenSource(timeoutCts.Token, cancellationToken); - var before = DateTimeOffset.UtcNow; InputRegistrationResponse ret = await IdempotencyRequestCache.GetCachedResponseAsync(request, Arena.RegisterInputAsync, linkedCts.Token); return ret; } @@ -79,7 +75,6 @@ public class WabiSabiController : ControllerBase, IWabiSabiApiRequestHandler using CancellationTokenSource timeoutCts = new(RequestTimeout); using CancellationTokenSource linkedCts = CancellationTokenSource.CreateLinkedTokenSource(timeoutCts.Token, cancellationToken); - var before = DateTimeOffset.UtcNow; await IdempotencyRequestCache.GetCachedResponseAsync(request, action: Arena.RegisterOutputCoreAsync, linkedCts.Token); } @@ -90,7 +85,6 @@ public class WabiSabiController : ControllerBase, IWabiSabiApiRequestHandler using CancellationTokenSource timeoutCts = new(RequestTimeout); using CancellationTokenSource linkedCts = CancellationTokenSource.CreateLinkedTokenSource(timeoutCts.Token, cancellationToken); - var before = DateTimeOffset.UtcNow; var ret = await IdempotencyRequestCache.GetCachedResponseAsync(request, action: Arena.ReissuanceAsync, linkedCts.Token); return ret; @@ -99,14 +93,12 @@ public class WabiSabiController : ControllerBase, IWabiSabiApiRequestHandler [HttpPost("input-unregistration")] public async Task RemoveInputAsync(InputsRemovalRequest request, CancellationToken cancellableToken) { - var before = DateTimeOffset.UtcNow; await Arena.RemoveInputAsync(request, cancellableToken); } [HttpPost("transaction-signature")] public async Task SignTransactionAsync(TransactionSignaturesRequest request, CancellationToken cancellableToken) { - var before = DateTimeOffset.UtcNow; await Arena.SignTransactionAsync(request, cancellableToken); } @@ -114,7 +106,6 @@ public class WabiSabiController : ControllerBase, IWabiSabiApiRequestHandler [HttpPost("ready-to-sign")] public async Task ReadyToSignAsync(ReadyToSignRequestRequest request, CancellationToken cancellableToken) { - var before = DateTimeOffset.UtcNow; await Arena.ReadyToSignAsync(request, cancellableToken); }