mirror of
https://github.com/aljazceru/BTCPayServerPlugins.git
synced 2025-12-17 07:34:24 +01:00
update breez
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
<PropertyGroup>
|
||||
<Product>Breez / Greenlight</Product>
|
||||
<Description>Lightweight lightning baby!</Description>
|
||||
<Version>1.0.4</Version>
|
||||
<Version>1.0.5</Version>
|
||||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||
</PropertyGroup>
|
||||
<!-- Plugin development properties -->
|
||||
|
||||
@@ -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 @@
|
||||
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
|
||||
<div class="form-group">
|
||||
<label for="amount" class="form-label">Amount (sats)</label>
|
||||
<input type="number"id="amount" min="0" max="@max" name="amount" class="form-control"/>
|
||||
<input type="number"id="amount" min="0" max="@max.ToUnit(LightMoneyUnit.Satoshi)" name="amount" class="form-control"/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -45,20 +45,15 @@
|
||||
}
|
||||
|
||||
<datalist id="fees">
|
||||
<option value="@f.fastestFee">Fastest fee</option>
|
||||
<option value="@f.halfHourFee">Half hour fee</option>
|
||||
<option value="@f.hourFee">Hour fee</option>
|
||||
<option value="@f.economyFee">Economic fee</option>
|
||||
<option value="@f.minimumFee">Minimum fee</option>
|
||||
<option value="@f.fastestFee">Fastest fee (@f.fastestFee sat/vB)</option>
|
||||
<option value="@f.halfHourFee">Half hour fee (@f.halfHourFee sat/vB)</option>
|
||||
<option value="@f.hourFee">Hour fee (@f.hourFee sat/vB)</option>
|
||||
<option value="@f.economyFee">Economic fee (@f.economyFee sat/vB)</option>
|
||||
<option value="@f.minimumFee">Minimum fee (@f.minimumFee sat/vB)</option>
|
||||
</datalist>
|
||||
|
||||
<div class="row mb-4">
|
||||
<div class="row mb-4 mt-4">
|
||||
<div class="col-12">
|
||||
<div class="d-flex align-items-center justify-content-between mb-3">
|
||||
<h3 class="mb-0">
|
||||
<span>@ViewData["Title"]</span>
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
@if (inProgressSwap is not null)
|
||||
{
|
||||
@@ -71,7 +66,7 @@
|
||||
<vc:truncate-center text="@inProgressSwap.bitcoinAddress" padding="15" elastic="true" classes="form-control-plaintext" id="Address"/>
|
||||
<label for="Address">Address</label>
|
||||
</div>
|
||||
<div>
|
||||
<div class="w-100">
|
||||
<span class="text-muted">Please send an amount between <br/> @Money.Satoshis(inProgressSwap.minAllowedDeposit).ToDecimal(MoneyUnit.BTC) and @Money.Satoshis(inProgressSwap.maxAllowedDeposit).ToDecimal(MoneyUnit.BTC)BTC </span>
|
||||
@if (deriv is not null)
|
||||
{
|
||||
|
||||
@@ -14,11 +14,11 @@
|
||||
}
|
||||
|
||||
<datalist id="fees">
|
||||
<option value="@f.fastestFee">Fastest fee</option>
|
||||
<option value="@f.halfHourFee">Half hour fee</option>
|
||||
<option value="@f.hourFee">Hour fee</option>
|
||||
<option value="@f.economyFee">Economic fee</option>
|
||||
<option value="@f.minimumFee">Minimum fee</option>
|
||||
<option value="@f.fastestFee">Fastest fee (@f.fastestFee sat/vB)</option>
|
||||
<option value="@f.halfHourFee">Half hour fee (@f.halfHourFee sat/vB)</option>
|
||||
<option value="@f.hourFee">Hour fee (@f.hourFee sat/vB)</option>
|
||||
<option value="@f.economyFee">Economic fee (@f.economyFee sat/vB)</option>
|
||||
<option value="@f.minimumFee">Minimum fee (@f.minimumFee sat/vB)</option>
|
||||
</datalist>
|
||||
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
{
|
||||
storeId = Context.GetImplicitStoreId();
|
||||
}
|
||||
|
||||
var sdk = BreezService.GetClient(storeId)?.Sdk;
|
||||
if (sdk is null)
|
||||
return;
|
||||
@@ -34,11 +35,11 @@
|
||||
}
|
||||
|
||||
<datalist id="fees">
|
||||
<option value="@f.fastestFee">Fastest fee</option>
|
||||
<option value="@f.halfHourFee">Half hour fee</option>
|
||||
<option value="@f.hourFee">Hour fee</option>
|
||||
<option value="@f.economyFee">Economic fee</option>
|
||||
<option value="@f.minimumFee">Minimum fee</option>
|
||||
<option value="@f.fastestFee">Fastest fee (@f.fastestFee sat/vB)</option>
|
||||
<option value="@f.halfHourFee">Half hour fee (@f.halfHourFee sat/vB)</option>
|
||||
<option value="@f.hourFee">Hour fee (@f.hourFee sat/vB)</option>
|
||||
<option value="@f.economyFee">Economic fee (@f.economyFee sat/vB)</option>
|
||||
<option value="@f.minimumFee">Minimum fee (@f.minimumFee sat/vB)</option>
|
||||
</datalist>
|
||||
<datalist list="addresses">
|
||||
@if (deriv is not null)
|
||||
@@ -56,7 +57,6 @@
|
||||
</h3>
|
||||
<div class="d-flex gap-3 mt-3 mt-sm-0">
|
||||
|
||||
<button type="submit" class="btn btn-primary">Create</button>
|
||||
</div>
|
||||
</div>
|
||||
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
|
||||
@@ -71,10 +71,12 @@
|
||||
<div class="form-group">
|
||||
<label for="amount" class="form-label" data-required>Amount (sats)</label>
|
||||
<input type="number" min="@swapOutRec.min" max="@swapOutRec.max" id="amount" name="amount" class="form-control" required/>
|
||||
<p class="text-muted">Minimum: @swapOutRec.min, Maximum: @swapOutRec.max</p>
|
||||
</div>
|
||||
<input type="hidden" name="feesHash" value="@swapOutRec.feesHash"/>
|
||||
|
||||
|
||||
<button type="submit" class="btn btn-primary d-none">Create</button>
|
||||
@if (inProgressSwaps?.Any() is true)
|
||||
{
|
||||
<table class="table">
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
<datalist id="fees">
|
||||
<option value="@f.fastestFee">Fastest fee (@f.fastestFee sat/vB)</option>
|
||||
<option value="@f.halfHourFee">Half hour fee (@f.halfHourFee sat/vB)</option>
|
||||
<option value="@f.hourFee">Hour fee (@f.hourFee sat/vB)</option>
|
||||
<option value="@f.economyFee">Economic fee (@f.economyFee sat/vB)</option>
|
||||
<option value="@f.minimumFee">Minimum fee (@f.minimumFee sat/vB)</option>
|
||||
</datalist>
|
||||
<datalist list="addresses">
|
||||
@if (deriv is not null)
|
||||
{
|
||||
<option value="store"> Store wallet</option>
|
||||
<option value="store"> Store wallet</option>
|
||||
}
|
||||
</datalist>
|
||||
<datalist id="fees">
|
||||
<option value="@f.fastestFee">Fastest fee</option>
|
||||
<option value="@f.halfHourFee">Half hour fee</option>
|
||||
<option value="@f.hourFee">Hour fee</option>
|
||||
<option value="@f.economyFee">Economic fee</option>
|
||||
<option value="@f.minimumFee">Minimum fee</option>
|
||||
</datalist>
|
||||
|
||||
<form method="post" asp-action="Sweep" asp-route-storeId="@storeId">
|
||||
|
||||
<div class="row mb-4">
|
||||
<div class="col-12">
|
||||
<div class="d-flex align-items-center justify-content-between mb-3">
|
||||
@@ -48,20 +55,14 @@
|
||||
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="address" class="form-label" data-required>address</label>
|
||||
<input type="text" list="addresses" id="address" name="address" class="form-control" required/>
|
||||
<label for="address" class="form-label" data-required>Address</label>
|
||||
<input type="text" id="address" list="addresses" name="address" class="form-control" required/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="satPerByte" class="form-label" data-required>Fees</label>
|
||||
<input type="number" min="@f.minimumFee" list="satPerByte" id="satPerByte" name="satPerByte" class="form-control" required/>
|
||||
<label for="satPerByte" class="form-label" data-required>Feerate</label>
|
||||
<input type="number" min="@f.minimumFee" list="fees" id="satPerByte" name="satPerByte" class="form-control" required/>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary">Create</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@section PageFootContent {
|
||||
<partial name="_ValidationScriptsPartial"/>
|
||||
}
|
||||
</form>
|
||||
@@ -2,4 +2,9 @@
|
||||
Layout = "../Shared/_NavLayout.cshtml";
|
||||
ViewData["NavPartialName"] = "_Nav";
|
||||
}
|
||||
<style>
|
||||
#mainContent > section {
|
||||
padding: 3rem !important;
|
||||
}
|
||||
</style>
|
||||
@RenderBody()
|
||||
@@ -41,7 +41,6 @@ public class WabiSabiController : ControllerBase, IWabiSabiApiRequestHandler
|
||||
[HttpPost("status")]
|
||||
public async Task<RoundStateResponse> 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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user