2021-08-01 15:13:12 +02:00
@addTagHelper *, BundlerMinifier.TagHelpers
2021-09-27 03:31:23 +02:00
@inject BTCPayServer.Security.ContentSecurityPolicies csp
2020-03-26 11:59:28 +01:00
@using Microsoft.AspNetCore.Mvc.ModelBinding
2019-05-21 10:10:07 +02:00
@model WalletSendModel
2018-02-12 19:27:36 +01:00
@{
2021-12-31 08:36:38 +01:00
var walletId = Context.GetRouteValue("walletId").ToString();
2018-02-12 19:27:36 +01:00
Layout = "../Shared/_NavLayout.cshtml";
2021-12-31 08:36:38 +01:00
ViewData.SetActivePage(WalletsNavPages.Send, $"Send {Model.CryptoCode}", walletId);
2021-09-27 03:31:23 +02:00
csp.Add("worker-src", "blob:");
2020-02-13 09:18:43 +01:00
}
2021-04-08 15:32:42 +02:00
2021-05-19 04:39:27 +02:00
@section PageHeadContent
{
<link href="~/vendor/vue-qrcode-reader/vue-qrcode-reader.css" rel="stylesheet" asp-append-version="true"/>
<style>
2021-08-30 23:02:08 +02:00
.crypto-fee-link { padding-left: 1rem; padding-right: 1rem; }
.btn-group > .crypto-fee-link:last-of-type {
border-top-right-radius: .2rem !important;
border-bottom-right-radius: .2rem !important;
}
2021-05-19 04:39:27 +02:00
</style>
}
@section PageFootContent
{
<bundle name="wwwroot/bundles/wallet-send-bundle.min.js"></bundle>
}
2020-10-21 14:03:11 +02:00
<partial name="CameraScanner"/>
2020-08-03 10:12:21 +02:00
2019-11-01 22:15:02 +01:00
<div class="row">
2022-01-28 09:06:02 +01:00
<div class="col-xl-8 col-xxl-constrain @(!Model.InputSelection && Model.Outputs.Count == 1 ? "transaction-output-form" : "")">
2021-12-31 08:36:38 +01:00
<form method="post" asp-action="WalletSend" asp-route-walletId="@walletId">
2020-03-19 09:44:47 +01:00
<input type="hidden" asp-for="InputSelection" />
2020-09-11 09:23:08 +02:00
<input type="hidden" asp-for="FiatDivisibility" />
<input type="hidden" asp-for="CryptoDivisibility" />
2020-01-21 09:33:12 +01:00
<input type="hidden" asp-for="NBXSeedAvailable" />
2019-05-21 11:44:49 +02:00
<input type="hidden" asp-for="Fiat" />
<input type="hidden" asp-for="Rate" />
<input type="hidden" asp-for="CurrentBalance" />
2021-08-01 14:12:00 +02:00
<input type="hidden" asp-for="ImmatureBalance" />
2019-05-21 11:44:49 +02:00
<input type="hidden" asp-for="CryptoCode" />
2020-02-13 09:18:43 +01:00
<input type="hidden" name="BIP21" id="BIP21" />
2021-06-14 07:06:56 +02:00
2019-05-21 10:10:07 +02:00
<ul class="text-danger">
@foreach (var errors in ViewData.ModelState.Where(pair => pair.Key == string.Empty && pair.Value.ValidationState == ModelValidationState.Invalid))
{
2021-06-14 07:06:56 +02:00
foreach (var error in errors.Value.Errors)
2019-05-21 10:10:07 +02:00
{
<li>@error.ErrorMessage</li>
}
}
</ul>
2020-05-05 12:06:59 +02:00
2019-05-21 11:44:49 +02:00
@if (Model.Outputs.Count == 1)
{
<div class="form-group">
2021-08-04 13:58:46 +02:00
<div class="d-flex align-items-center justify-content-between">
<label asp-for="Outputs[0].DestinationAddress" class="form-label"></label>
2021-10-09 03:39:34 +02:00
<button type="submit" name="command" value="add-output" class="d-inline-block ms-2 btn text-primary btn-link p-0 mb-2">
<span class="fa fa-plus"></span> Add another destination
</button>
2021-08-04 13:58:46 +02:00
</div>
<input asp-for="Outputs[0].DestinationAddress" class="form-control font-monospace" autofocus autocomplete="off" />
2019-05-21 11:44:49 +02:00
<span asp-validation-for="Outputs[0].DestinationAddress" class="text-danger"></span>
</div>
<div class="form-group">
2021-10-09 03:39:34 +02:00
<div class="d-flex align-items-center justify-content-between">
<label asp-for="Outputs[0].Amount" class="form-label"></label>
<button type="submit" name="command" value="toggle-input-selection" class="d-inline-block ms-2 btn text-primary btn-link p-0 mb-2" id="toggleInputSelection"><span class="fa fa-@(Model.InputSelection ? "eye-slash" : "eye") "></span> @(Model.InputSelection ? "Hide" : "Show") coin selection</button>
</div>
2019-05-21 11:44:49 +02:00
<div class="input-group">
2021-08-04 13:58:46 +02:00
<input asp-for="Outputs[0].Amount" type="number" step="any" min="0" asp-format="{0}" class="form-control output-amount hide-number-spin" />
2021-05-19 04:39:27 +02:00
<div class="input-group-text fiat-value" style="display:none;">
<span class="input-group-text p-0">=</span>
2021-08-04 13:58:46 +02:00
<input type="number" class="input-group-text fiat-value-edit-input py-0 hide-number-spin" min="0" step="any" style="max-width:100px" />
2021-05-19 04:39:27 +02:00
<span class="input-group-text p-0">@Model.Fiat</span>
2019-05-21 11:44:49 +02:00
</div>
2019-05-21 10:10:07 +02:00
</div>
2019-05-21 11:44:49 +02:00
<span asp-validation-for="Outputs[0].Amount" class="text-danger"></span>
2021-10-09 03:39:34 +02:00
<p class="form-text text-secondary mb-0 crypto-info">
2021-08-01 14:12:00 +02:00
Your available balance is
2020-04-07 18:12:15 +02:00
<button type="button" class="crypto-balance-link btn btn-link p-0 align-baseline">@Model.CurrentBalance</button> <span>@Model.CryptoCode</span>.
2021-08-01 15:13:12 +02:00
@if (Model.ImmatureBalance > 0)
2021-08-01 14:12:00 +02:00
{
2021-08-01 15:13:12 +02:00
<span><br><span class="text-warning">âš </span> @Model.ImmatureBalance @Model.CryptoCode are still immature and require additional confirmations.</span>
2021-08-01 14:12:00 +02:00
}
2019-05-21 11:44:49 +02:00
</p>
</div>
}
else
{
2021-10-09 03:39:34 +02:00
<div class="list-group list-group-flush">
2019-05-21 11:44:49 +02:00
@for (var index = 0; index < Model.Outputs.Count; index++)
{
2021-10-09 03:39:34 +02:00
<div class="list-group-item transaction-output-form px-0 pt-0 pb-3 mb-3">
<div class="form-group">
<div class="d-flex align-items-center justify-content-between">
<label asp-for="Outputs[index].DestinationAddress" class="form-label"></label>
<button type="submit" name="command" value="@($"remove-output:{index}")" class="d-inline-block ms-2 btn text-danger btn-link p-0 mb-2">
<span class="fa fa-times"></span> Remove Destination
2019-05-21 10:10:07 +02:00
</button>
2019-05-21 11:44:49 +02:00
</div>
2021-10-09 03:39:34 +02:00
<input asp-for="Outputs[index].DestinationAddress" class="form-control" autocomplete="off"/>
<span asp-validation-for="Outputs[index].DestinationAddress" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="Outputs[index].Amount" class="form-label"></label>
<div class="input-group">
<input asp-for="Outputs[index].Amount" type="number" min="0" step="any" asp-format="{0}" class="form-control output-amount hide-number-spin" />
<div class="input-group-text fiat-value" style="display:none;">
<span class="input-group-text p-0">=</span>
<input type="number" class="input-group-text fiat-value-edit-input py-0 hide-number-spin" min="0" step="any" style="max-width:100px" />
<span class="input-group-text p-0">@Model.Fiat</span>
</div>
</div>
<p class="form-text text-secondary crypto-info mb-2">
Your available balance is
<button type="button" class="crypto-balance-link btn btn-link p-0 align-baseline">@Model.CurrentBalance</button> <span>@Model.CryptoCode</span>.
@if (Model.ImmatureBalance > 0)
{
<span><br>Note: @Model.ImmatureBalance @Model.CryptoCode are still immature and require additional confirmations.</span>
}
</p>
<span asp-validation-for="Outputs[index].Amount" class="text-danger"></span>
</div>
<div class="form-check">
<input type="checkbox" asp-for="Outputs[index].SubtractFeesFromOutput" class="form-check-input subtract-fees" />
<label asp-for="Outputs[index].SubtractFeesFromOutput" class="form-check-label"></label>
<span asp-validation-for="Outputs[index].SubtractFeesFromOutput" class="text-danger"></span>
2019-05-21 10:10:07 +02:00
</div>
</div>
2019-05-21 11:44:49 +02:00
}
</div>
2021-10-09 03:39:34 +02:00
<div class="d-grid gap-3 d-md-block mt-n2">
<button type="submit" name="command" value="add-output" class="btn btn-secondary me-md-1"><span class="fa fa-plus"></span> Add another destination</button>
<button type="submit" name="command" value="toggle-input-selection" class="btn btn-secondary" id="toggleInputSelection"><span class="fa fa-@(Model.InputSelection ? "eye-slash" : "eye") "></span> @(Model.InputSelection ? "Hide" : "Show") coin selection</button>
</div>
2019-05-21 11:44:49 +02:00
}
2021-10-09 03:39:34 +02:00
@if (Model.InputSelection)
{
<partial name="CoinSelection" />
}
2020-08-03 10:12:21 +02:00
<div class="form-group my-4">
2021-05-19 04:39:27 +02:00
<label asp-for="FeeSatoshiPerByte" class="form-label"></label>
2021-08-04 13:58:46 +02:00
<input asp-for="FeeSatoshiPerByte" type="number" min="0" step="any" class="form-control" style="max-width:14ch;" />
2020-05-05 12:06:59 +02:00
<span asp-validation-for="FeeSatoshiPerByte" class="text-danger"></span>
2018-03-23 08:24:57 +01:00
<span id="FeeRate-Error" class="text-danger"></span>
2020-05-07 22:34:39 +02:00
@if (Model.RecommendedSatoshiPerByte.Any())
{
2022-01-26 06:54:29 +01:00
<div class="text-start mt-4 d-flex align-items-sm-center flex-column flex-sm-row">
2021-08-30 23:02:08 +02:00
<span class="text-secondary me-3">
2020-05-07 22:34:39 +02:00
Confirm in the next
</span>
2021-08-30 23:02:08 +02:00
<div class="btn-group btn-group-toggle feerate-options mt-2 mt-sm-0" role="group" data-bs-toggle="buttons">
2020-05-07 22:34:39 +02:00
@for (var index = 0; index < Model.RecommendedSatoshiPerByte.Count; index++)
{
var feeRateOption = Model.RecommendedSatoshiPerByte[index];
2021-08-30 23:02:08 +02:00
<button type="button" class="btn btn-sm btn-secondary crypto-fee-link" value="@feeRateOption.FeeRate" data-bs-toggle="tooltip" title="@feeRateOption.FeeRate sat/b">
2020-05-07 22:34:39 +02:00
@feeRateOption.Target.TimeString()
</button>
2020-05-16 22:07:24 +02:00
<input type="hidden" asp-for="RecommendedSatoshiPerByte[index].Target" />
<input type="hidden" asp-for="RecommendedSatoshiPerByte[index].FeeRate" />
2020-05-07 22:34:39 +02:00
}
</div>
</div>
}
2018-03-23 08:24:57 +01:00
</div>
2019-05-21 11:44:49 +02:00
@if (Model.Outputs.Count == 1)
{
<div class="form-group">
2019-10-14 05:07:41 +02:00
<div class="form-check">
<input type="checkbox" asp-for="Outputs[0].SubtractFeesFromOutput" class="form-check-input subtract-fees" />
<label asp-for="Outputs[0].SubtractFeesFromOutput" class="form-check-label"></label>
<span asp-validation-for="Outputs[0].SubtractFeesFromOutput" class="text-danger"></span>
</div>
2019-05-21 11:44:49 +02:00
</div>
}
2020-05-05 12:06:59 +02:00
2021-05-19 04:39:27 +02:00
<div class="my-4">
2022-01-26 06:54:29 +01:00
<button class="btn btn-link text-primary p-0" type="button" id="AdvancedSettingsButton" data-bs-toggle="collapse" data-bs-target="#AdvancedSettings" aria-expanded="false" aria-controls="AdvancedSettings">
2019-11-08 22:31:21 +01:00
Advanced settings
</button>
2021-05-19 04:39:27 +02:00
<div id="AdvancedSettings" class="collapse">
<div class="pt-3 pb-1">
2020-05-24 14:11:33 +02:00
<div class="form-group">
<div class="form-check">
<input asp-for="NoChange" class="form-check-input" />
<label asp-for="NoChange" class="form-check-label"></label>
2021-07-06 10:35:42 +02:00
<a href="https://docs.btcpayserver.org/Wallet/#dont-create-utxo-change" target="_blank" rel="noreferrer noopener">
2021-04-08 15:32:42 +02:00
<span class="fa fa-question-circle-o text-secondary" title="More information..."></span>
2020-05-24 14:11:33 +02:00
</a>
</div>
2020-06-14 15:45:58 +02:00
</div>
2020-06-12 13:58:55 +02:00
<div class="form-group">
<div class="form-check">
<input asp-for="AlwaysIncludeNonWitnessUTXO" class="form-check-input"/>
<label asp-for="AlwaysIncludeNonWitnessUTXO" class="form-check-label"></label>
2021-07-06 10:35:42 +02:00
<a href="https://medium.com/@@jmacato/wasabi-wallets-advisory-for-trezor-users-7d942c727f92" target="_blank" rel="noreferrer noopener">
2021-04-08 15:32:42 +02:00
<span class="fa fa-question-circle-o text-secondary" title="More information..."></span>
2020-06-14 15:45:58 +02:00
</a>
2020-06-12 13:58:55 +02:00
</div>
</div>
2019-05-08 08:24:20 +02:00
@if (Model.SupportRBF)
{
2020-05-24 14:11:33 +02:00
<div class="form-group">
2021-06-06 13:44:54 +02:00
<label asp-for="AllowFeeBump" class="form-label"></label>
2021-07-06 10:35:42 +02:00
<a href="https://docs.btcpayserver.org/Wallet/#rbf-replace-by-fee" target="_blank" rel="noreferrer noopener">
2021-04-08 15:32:42 +02:00
<span class="fa fa-question-circle-o text-secondary" title="More information..."></span>
2019-05-21 10:10:07 +02:00
</a>
2021-05-19 04:39:27 +02:00
<select asp-for="AllowFeeBump" class="form-select w-auto">
2020-05-24 14:11:33 +02:00
<option value="Maybe">Randomize for higher privacy</option>
<option value="Yes">Yes</option>
<option value="No">No</option>
</select>
2019-05-21 10:10:07 +02:00
</div>
2019-05-08 08:24:20 +02:00
}
2020-06-17 14:43:56 +02:00
@if (!string.IsNullOrEmpty(Model.PayJoinBIP21))
2020-01-06 13:57:32 +01:00
{
<div class="form-group">
2021-05-19 04:39:27 +02:00
<label asp-for="PayJoinBIP21" class="form-label"></label>
2020-06-17 14:43:56 +02:00
<input asp-for="PayJoinBIP21" class="form-control" />
<span asp-validation-for="PayJoinBIP21" class="text-danger"></span>
2020-01-06 13:57:32 +01:00
</div>
}
2019-05-08 05:34:33 +02:00
</div>
</div>
</div>
2022-02-17 10:07:41 +01:00
<div class="form-group d-flex gap-3 mt-2">
2022-02-10 04:24:28 +01:00
<button type="submit" id="SignTransaction" name="command" value="sign" class="btn btn-primary">Sign transaction</button>
2022-02-17 10:07:41 +01:00
<a class="btn btn-secondary" asp-controller="UIWallets" asp-action="WalletPSBT" asp-route-walletId="@walletId" id="PSBT">PSBT</a>
<button type="button" id="bip21parse" class="btn btn-secondary" title="Paste BIP21/Address"><i class="fa fa-paste"></i></button>
<button type="button" id="scanqrcode" class="btn btn-secondary only-for-js" data-bs-toggle="modal" data-bs-target="#scanModal" title="Scan BIP21/Address with camera"><i class="fa fa-camera"></i></button>
2019-01-15 15:50:45 +01:00
</div>
2018-03-23 08:24:57 +01:00
</form>
</div>
2018-02-12 19:27:36 +01:00
</div>