Files
BTCPayServerPlugins/Plugins/BTCPayServer.Plugins.Breez/Views/Breez/SwapInRefund.cshtml
Kukks 9b90e10b66 wip
2024-10-18 09:46:16 +02:00

61 lines
2.6 KiB
Plaintext

@using BTCPayServer
@using BTCPayServer.Plugins.Breez
@using BTCPayServer.Security
@using BTCPayServer.Services.Invoices
@using Microsoft.AspNetCore.Mvc.TagHelpers
@using Microsoft.AspNetCore.Routing
@model string
@inject BreezService BreezService
@inject PaymentMethodHandlerDictionary PaymentMethodHandlerDictionary
@{
var storeId = Context.GetImplicitStoreId();
var address = Context.GetRouteValue("address").ToString();
ViewData.SetActivePage("Breez", "Create Swapin Refund", "SwapIn");
var deriv = Context.GetStoreData().GetDerivationSchemeSettings(PaymentMethodHandlerDictionary, "BTC");
var sdk = BreezService.GetClient(storeId)?.Sdk;
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>
}
</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="All" class="text-danger"></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" list="addresses" 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/>
</div>
</div>
</div>
</form>