btcpayserver/BTCPayServer/Views/UIWallets/WalletSigningOptions.cshtml

101 lines
4.5 KiB
Plaintext

@using BTCPayServer.Controllers
@model WalletSigningOptionsModel
@inject BTCPayNetworkProvider BTCPayNetworkProvider
@{
var walletId = WalletId.Parse(Context.GetRouteValue("walletId").ToString());
var cancelUrl = Model.ReturnUrl ?? Url.Action(nameof(UIWalletsController.WalletTransactions), new { walletId });
var backUrl = Model.BackUrl != null ? $"{Model.BackUrl}?returnUrl={Model.ReturnUrl}" : null;
Layout = "_LayoutWizard";
ViewData.SetActivePage(WalletsNavPages.Send, "Sign the transaction", walletId.ToString());
}
@section Navbar {
@if (backUrl != null)
{
<a href="@Url.EnsureLocal(backUrl, Context.Request)" id="GoBack">
<vc:icon symbol="back" />
</a>
}
<a href="@Url.EnsureLocal(cancelUrl, Context.Request)" id="CancelWizard" class="cancel">
<vc:icon symbol="close" />
</a>
}
<header class="text-center">
<h1>Choose your signing method</h1>
<p class="lead text-secondary mt-3">You can sign the transaction using one of the following methods.</p>
</header>
<form method="post" asp-action="WalletSign" asp-route-walletId="@walletId">
<partial name="SigningContext" for="SigningContext" />
<input type="hidden" asp-for="ReturnUrl" />
<input type="hidden" asp-for="BackUrl" />
@if (BTCPayNetworkProvider.GetNetwork<BTCPayNetwork>(walletId.CryptoCode).VaultSupported)
{
<div class="list-group mt-4">
<button type="submit" name="command" value="vault" class="list-group-item list-group-item-action only-for-js" id="SignWithVault">
<div class="image">
<vc:icon symbol="hardware-wallet"/>
</div>
<div class="content d-flex flex-column flex-lg-row align-items-lg-center justify-content-lg-between me-2">
<div>
<h4>Hardware wallet</h4>
<p class="mb-0 text-secondary">Sign using our Vault application</p>
</div>
<small class="d-block text-primary mt-2 mt-lg-0">Recommended</small>
</div>
<vc:icon symbol="caret-right"/>
</button>
<noscript>
<div class="list-group-item disabled">
<div class="image">
<vc:icon symbol="hardware-wallet"/>
</div>
<div class="content d-flex flex-column flex-lg-row align-items-lg-center justify-content-lg-between me-2">
<div><h4>Hardware wallet</h4>
<p class="mb-0">Please enable JavaScript for this option to be available</p>
</div>
</div>
</div>
</noscript>
</div>
}
<div class="list-group mt-4">
<button type="submit" name="command" value="decode" class="list-group-item list-group-item-action" id="SignWithPSBT">
<div class="image">
<vc:icon symbol="wallet-file"/>
</div>
<div class="content">
<h4>
Partially Signed Bitcoin Transaction
<small>
<a href="https://docs.btcpayserver.org/Wallet/#signing-with-a-wallet-supporting-psbt" target="_blank" rel="noreferrer noopener" title="More information...">
<vc:icon symbol="info" />
</a>
</small>
</h4>
<p class="mb-0 text-secondary">Offline signing, without connecting your wallet to the internet</p>
</div>
<vc:icon symbol="caret-right"/>
</button>
</div>
<div class="list-group mt-4">
<button type="submit" name="command" value="seed" class="list-group-item list-group-item-action" id="SignWithSeed">
<div class="image">
<vc:icon symbol="seed"/>
</div>
<div class="content d-flex flex-column flex-lg-row align-items-lg-center justify-content-lg-between me-2">
<div>
<h4>Private key or seed</h4>
<p class="mb-0 text-secondary">Provide the 12 or 24 word recovery seed</p>
</div>
<small class="d-block text-danger mt-2 mt-lg-0" data-bs-toggle="tooltip" data-bs-placement="top" title="You really should not type your seed into a device that is connected to the internet.">Not recommended <vc:icon symbol="info"/></small>
</div>
<vc:icon symbol="caret-right"/>
</button>
</div>
</form>