Files
btcpayserver-breez-nodeless…/BTCPayServer.Plugins.BreezSpark/Views/BreezSpark/SwapInRefund.cshtml
2025-12-10 17:44:29 +01:00

73 lines
3.5 KiB
Plaintext

@using BTCPayServer
@using BTCPayServer.Plugins.BreezSpark
@using BTCPayServer.Security
@using BTCPayServer.Services.Invoices
@using Microsoft.AspNetCore.Mvc.TagHelpers
@using Microsoft.AspNetCore.Routing
@model string
@inject BreezSparkService BreezService
@inject PaymentMethodHandlerDictionary PaymentMethodHandlerDictionary
@* @inject BTCPayNetworkProvider BTCPayNetworkProvider *@
@{
var storeId = Context.GetImplicitStoreId();
var address = Context.GetRouteValue("address").ToString();
ViewData.SetActivePage("Breez", "Create Swapin Refund", "SwapIn");
@* TODO: Fix for v2.2.1 - derivation settings check needed *@
var sdk = BreezService.GetClient(storeId)?.Sdk;
// Use standard fee rates since RecommendedFees API may have changed
var standardFees = new { fastestFee = 10, halfHourFee = 5, hourFee = 3, economyFee = 2, minimumFee = 1 };
}
<datalist id="fees">
<option value="@standardFees.fastestFee">Fastest fee (@standardFees.fastestFee sat/vB)</option>
<option value="@standardFees.halfHourFee">Half hour fee (@standardFees.halfHourFee sat/vB)</option>
<option value="@standardFees.hourFee">Hour fee (@standardFees.hourFee sat/vB)</option>
<option value="@standardFees.economyFee">Economic fee (@standardFees.economyFee sat/vB)</option>
<option value="@standardFees.minimumFee">Minimum fee (@standardFees.minimumFee sat/vB)</option>
</datalist>
<datalist list="addresses">
@*
@if (derivationSettings is not null)
{
<option value="store"> Store wallet</option>
}
*@
</datalist>
<form method="post" asp-action="SwapInRefund" asp-route-storeId="@storeId" asp-route-address="@address">
<div class="row mb-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>
<a href="https://docs.btcpayserver.org/Forms" target="_blank" rel="noreferrer noopener" title="More information...">
<vc:icon symbol="info"/>
</a>
</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>
<div class="form-group">
<label for="txid" class="form-label" data-required>Transaction ID</label>
<input type="text" id="txid" name="txid" class="form-control" required/>
</div>
<div class="form-group">
<label for="vout" class="form-label" data-required>Output Index</label>
<input type="number" id="vout" name="vout" class="form-control" required/>
</div>
<div class="form-group">
<label for="refundAddress" class="form-label" data-required>Refund Address</label>
<input type="text" id="refundAddress" name="refundAddress" class="form-control" required/>
</div>
<div class="form-group">
<label for="satPerByte" class="form-label">Fee Rate (sat/vB)</label>
<input type="number" id="satPerByte" name="satPerByte" list="fees" class="form-control" value="@standardFees.halfHourFee"/>
<small class="form-text text-muted">Choose from preset fee rates or enter custom value</small>
</div>
<button type="submit" class="btn btn-primary">Process Refund</button>
</div>
</div>
</form>