btcpayserver/BTCPayServer/Views/Stores/AddDerivationScheme.cshtml

223 lines
10 KiB
Text
Raw Normal View History

Put Ledger Wallet pairing in a popup, prepare code for Trezor pairing (#836) * Allowing for POS to be displayed at website root * Switching to asp attributes for form post action * Applying default formatting rules on HTML * The destination pays mining fees => Subtract fees from amount * small cleanup (#851) * Part2: Openiddict: Init OpenIddict & Database Migration & Auth Policies (#567) * Part 1: OpenIddict - Minor Changes & Config prep * Part 1: OpenIddict - Minor Changes & Config prep * Part2: Openiddict: Init OpenIddict & Database Migration & Auth Policies * pr changes * pr changes * fix merge * pr fixes * remove config for openid -- no need for it for now * fix compile * fix compile #2 * remove extra ns using * Update Startup.cs * compile * adjust settings a bit * remove duplicate * remove external login provider placeholder html * remove unused directives * regenerate db snapshot model * Remove dynamic policy * Provide Pretty descriptions for payment methods from their handlers (#852) * small cleanup * Provide Pretty descriptions for payment methods from their handlers * remove PrettyMethod() * integration with trezor * rough load xpub from trezor * update deriv scheme trezor * move ledger import to dialog * add import from hw wallet dropdown * Support temporary links for local file system provider (#848) * wip * Support temporary links for local file system provider * pass base url to file services * fix test * do not crash on errors with local filesystem * remove console * fix paranthesis * work on trezor.net integration * pushed non compiling sign wallet code * comment out wallet code * abstract ledger ws in add deriv * Auto stash before merge of "trezor" and "btcpayserver/master" * final add changes * cleanup * improve connectivity and fix e2e tests * fix selenium * add experimental warning for trezor * move import button to right and convert to text link * switch to defer and async scripts in add deriv scheme * make defer not async * more elaborate import trezor dialog * Fix small issues * hide trezor for now
2019-05-25 02:45:36 +00:00
@model DerivationSchemeViewModel
@{
Layout = "../Shared/_NavLayout.cshtml";
2018-08-22 13:56:55 +02:00
ViewData.SetActivePageAndTitle(StoreNavPages.Index, $"{Model.CryptoCode} Derivation scheme");
}
@section HeadScripts {
<style type="text/css">
.hw-fields {
display: none;
}
</style>
}
<partial name="_StatusMessage" />
2020-07-22 15:28:31 +02:00
@if (!ViewContext.ModelState.IsValid)
{
<div class="row">
<div class="col-md-6">
<div asp-validation-summary="All" class="text-danger"></div>
</div>
</div>
2020-07-22 15:28:31 +02:00
}
<div class="modal fade" id="btcpayservervault" tabindex="-1" role="dialog" aria-labelledby="btcpayservervault" aria-hidden="true"></div>
<partial name="VaultElements" />
<div class="row">
2018-02-13 03:27:36 +09:00
<div class="col-md-8">
<div id="WebsocketPath" style="display:none;">@Url.Action("VaultBridgeConnection", "Vault", new { cryptoCode = Model.CryptoCode })</div>
@if (!Model.Confirmation)
{
<partial name="AddDerivationSchemes_HardwareWalletDialogs" model="@Model" />
}
else
{
<template id="btcpayservervault_template">
<div class="modal-dialog" role="document">
<form class="modal-content" method="post" enctype="multipart/form-data">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Address verification</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<p>Confirm on the device that you see address <b id="displayedAddress"></b></p>
<div class="form-group">
<div id="vaultPlaceholder"></div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button id="vault-confirm" class="btn btn-primary" style="display:none;"></button>
</div>
</form>
</div>
</template>
}
<form method="post" asp-action="AddDerivationScheme"
asp-route-cryptoCode="@Model.CryptoCode"
asp-route-storeId="@this.Context.GetRouteValue("storeId")">
<input id="Config" asp-for="Config" type="hidden" />
@if (!Model.Confirmation)
{
<input id="CryptoCurrency" asp-for="CryptoCode" type="hidden" />
<input id="DerivationSchemeFormat" asp-for="DerivationSchemeFormat" type="hidden" />
<input id="AccountKey" asp-for="AccountKey" type="hidden" />
2018-03-18 14:15:23 +09:00
<div class="form-group">
<h5>Derivation scheme</h5>
<p>
The derivation scheme represents the destination of the funds received by your invoice.
It is generated by your wallet software.
</p>
2018-03-18 14:15:23 +09:00
</div>
<div class="form-group">
<label asp-for="DerivationScheme"></label>
<textarea asp-for="DerivationScheme" class="form-control store-derivation-scheme text-monospace py-2" rows="2"></textarea>
2018-03-18 14:15:23 +09:00
<span asp-validation-for="DerivationScheme" class="text-danger"></span>
Put Ledger Wallet pairing in a popup, prepare code for Trezor pairing (#836) * Allowing for POS to be displayed at website root * Switching to asp attributes for form post action * Applying default formatting rules on HTML * The destination pays mining fees => Subtract fees from amount * small cleanup (#851) * Part2: Openiddict: Init OpenIddict & Database Migration & Auth Policies (#567) * Part 1: OpenIddict - Minor Changes & Config prep * Part 1: OpenIddict - Minor Changes & Config prep * Part2: Openiddict: Init OpenIddict & Database Migration & Auth Policies * pr changes * pr changes * fix merge * pr fixes * remove config for openid -- no need for it for now * fix compile * fix compile #2 * remove extra ns using * Update Startup.cs * compile * adjust settings a bit * remove duplicate * remove external login provider placeholder html * remove unused directives * regenerate db snapshot model * Remove dynamic policy * Provide Pretty descriptions for payment methods from their handlers (#852) * small cleanup * Provide Pretty descriptions for payment methods from their handlers * remove PrettyMethod() * integration with trezor * rough load xpub from trezor * update deriv scheme trezor * move ledger import to dialog * add import from hw wallet dropdown * Support temporary links for local file system provider (#848) * wip * Support temporary links for local file system provider * pass base url to file services * fix test * do not crash on errors with local filesystem * remove console * fix paranthesis * work on trezor.net integration * pushed non compiling sign wallet code * comment out wallet code * abstract ledger ws in add deriv * Auto stash before merge of "trezor" and "btcpayserver/master" * final add changes * cleanup * improve connectivity and fix e2e tests * fix selenium * add experimental warning for trezor * move import button to right and convert to text link * switch to defer and async scripts in add deriv scheme * make defer not async * more elaborate import trezor dialog * Fix small issues * hide trezor for now
2019-05-25 02:45:36 +00:00
<div class="dropdown mt-2 text-right">
<div class="btn-group">
2019-12-05 18:56:40 +01:00
<button class="btn btn-link dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" id="import-from-btn">
Import from...
</button>
<div class="dropdown-menu dropdown-menu-right">
@if (Model.CryptoCode == "BTC")
{
2020-05-25 07:41:30 +09:00
<button class="dropdown-item check-for-vault" type="button">... a hardware wallet</button>
}
<button class="dropdown-item" type="button" data-toggle="modal" data-target="#electrumimport">... a wallet file (Electrum, Wasabi, Cobo Vault, ColdCard)</button>
@if (Model.CanUseHotWallet)
{
<button class="dropdown-item" data-toggle="modal" data-target="#nbxplorergeneratewallet" type="button" id="nbxplorergeneratewalletbtn">... a new/existing seed.</button>
2020-05-25 07:41:30 +09:00
}
</div>
</div>
Put Ledger Wallet pairing in a popup, prepare code for Trezor pairing (#836) * Allowing for POS to be displayed at website root * Switching to asp attributes for form post action * Applying default formatting rules on HTML * The destination pays mining fees => Subtract fees from amount * small cleanup (#851) * Part2: Openiddict: Init OpenIddict & Database Migration & Auth Policies (#567) * Part 1: OpenIddict - Minor Changes & Config prep * Part 1: OpenIddict - Minor Changes & Config prep * Part2: Openiddict: Init OpenIddict & Database Migration & Auth Policies * pr changes * pr changes * fix merge * pr fixes * remove config for openid -- no need for it for now * fix compile * fix compile #2 * remove extra ns using * Update Startup.cs * compile * adjust settings a bit * remove duplicate * remove external login provider placeholder html * remove unused directives * regenerate db snapshot model * Remove dynamic policy * Provide Pretty descriptions for payment methods from their handlers (#852) * small cleanup * Provide Pretty descriptions for payment methods from their handlers * remove PrettyMethod() * integration with trezor * rough load xpub from trezor * update deriv scheme trezor * move ledger import to dialog * add import from hw wallet dropdown * Support temporary links for local file system provider (#848) * wip * Support temporary links for local file system provider * pass base url to file services * fix test * do not crash on errors with local filesystem * remove console * fix paranthesis * work on trezor.net integration * pushed non compiling sign wallet code * comment out wallet code * abstract ledger ws in add deriv * Auto stash before merge of "trezor" and "btcpayserver/master" * final add changes * cleanup * improve connectivity and fix e2e tests * fix selenium * add experimental warning for trezor * move import button to right and convert to text link * switch to defer and async scripts in add deriv scheme * make defer not async * more elaborate import trezor dialog * Fix small issues * hide trezor for now
2019-05-25 02:45:36 +00:00
</div>
2018-03-18 14:15:23 +09:00
</div>
<table class="table table-sm table-responsive-md">
<thead>
<tr>
<th>Address type</th>
<th>Example</th>
</tr>
</thead>
<tbody>
<tr>
<td>P2WPKH</td>
<td>xpub...</td>
</tr>
<tr>
<td>P2SH-P2WPKH</td>
<td>xpub...-[p2sh]</td>
</tr>
<tr>
<td>P2PKH</td>
<td>xpub...-[legacy]</td>
</tr>
<tr>
<td>Multi-sig P2WSH</td>
<td>2-of-xpub1...-xpub2...</td>
</tr>
<tr>
<td>Multi-sig P2SH-P2WSH</td>
<td>2-of-xpub1...-xpub2...-[p2sh]</td>
</tr>
<tr>
<td>Multi-sig P2SH</td>
<td>2-of-xpub1...-xpub2...-[legacy]</td>
</tr>
</tbody>
</table>
<div class="form-group hw-fields">
<h5>Additional pairing information</h5>
</div>
<div class="form-group hw-fields">
<label asp-for="Source"></label>
<input asp-for="Source" class="form-control" readonly />
</div>
<div class="form-group hw-fields">
<label asp-for="RootFingerprint"></label>
<input asp-for="RootFingerprint" class="form-control" readonly />
</div>
<div class="form-group hw-fields">
<label asp-for="KeyPath"></label>
<input asp-for="KeyPath" class="form-control" readonly />
</div>
<div class="form-group">
<div class="form-check">
<input asp-for="Enabled" type="checkbox" class="form-check-input" />
<label asp-for="Enabled" class="form-check-label"></label>
</div>
2018-07-27 13:37:16 +02:00
</div>
2019-05-12 02:13:26 -06:00
<button name="command" type="submit" class="btn btn-primary" value="save" id="Continue">Continue</button>
2020-04-28 17:55:53 +02:00
}
else
{
2018-03-18 14:15:23 +09:00
<div class="form-group">
<h5>Confirm the addresses (@Model.CryptoCode)</h5>
<span>Please check that your @Model.CryptoCode wallet is generating the same addresses as below.</span>
2018-03-18 14:15:23 +09:00
</div>
<input asp-for="Confirmation" type="hidden" />
<input type="hidden" asp-for="DerivationScheme" />
<input type="hidden" asp-for="Enabled" />
2018-03-18 14:15:23 +09:00
<div class="form-group">
<table class="table table-sm table-responsive-md">
2018-04-05 23:20:12 -05:00
<thead>
2018-03-18 14:15:23 +09:00
<tr>
<th>Key path</th>
<th>Address</th>
@if (Model.Source == "Vault")
{
<th>Actions</th>
}
2018-03-18 14:15:23 +09:00
</tr>
</thead>
<tbody>
@foreach (var sample in Model.AddressSamples)
{
<tr>
<td>@sample.KeyPath</td>
<td>@sample.Address</td>
@if (Model.Source == "Vault")
{
<td><a class="showaddress" href="#" onclick='showAddress(@Safe.Json(sample.RootedKeyPath.ToString()), @Safe.Json(sample.Address)); return false;'>Show on device</a></td>
}
</tr>
}
2018-03-18 14:15:23 +09:00
</tbody>
</table>
</div>
2018-03-24 20:40:26 +09:00
<div class="form-group">
<h5>Wrong addresses?</h5>
<span>Help us to find the correct settings by telling us the first address of your wallet</span>
</div>
<div class="form-group">
<label asp-for="HintAddress"></label>
<input asp-for="HintAddress" class="form-control" />
2018-03-24 20:40:26 +09:00
<span asp-validation-for="HintAddress" class="text-danger"></span>
</div>
2019-05-12 02:13:26 -06:00
<button name="command" type="submit" class="btn btn-primary" value="save" id="Confirm">Confirm</button>
}
</form>
</div>
</div>
@section Scripts {
@await Html.PartialAsync("_ValidationScriptsPartial")
<script src="~/js/StoreAddDerivationScheme.js" type="text/javascript" defer="defer" asp-append-version="true"></script>
<script src="~/js/vaultbridge.js" type="text/javascript" defer="defer" asp-append-version="true"></script>
<script src="~/js/vaultbridge.ui.js" type="text/javascript" defer="defer" asp-append-version="true"></script>
Put Ledger Wallet pairing in a popup, prepare code for Trezor pairing (#836) * Allowing for POS to be displayed at website root * Switching to asp attributes for form post action * Applying default formatting rules on HTML * The destination pays mining fees => Subtract fees from amount * small cleanup (#851) * Part2: Openiddict: Init OpenIddict & Database Migration & Auth Policies (#567) * Part 1: OpenIddict - Minor Changes & Config prep * Part 1: OpenIddict - Minor Changes & Config prep * Part2: Openiddict: Init OpenIddict & Database Migration & Auth Policies * pr changes * pr changes * fix merge * pr fixes * remove config for openid -- no need for it for now * fix compile * fix compile #2 * remove extra ns using * Update Startup.cs * compile * adjust settings a bit * remove duplicate * remove external login provider placeholder html * remove unused directives * regenerate db snapshot model * Remove dynamic policy * Provide Pretty descriptions for payment methods from their handlers (#852) * small cleanup * Provide Pretty descriptions for payment methods from their handlers * remove PrettyMethod() * integration with trezor * rough load xpub from trezor * update deriv scheme trezor * move ledger import to dialog * add import from hw wallet dropdown * Support temporary links for local file system provider (#848) * wip * Support temporary links for local file system provider * pass base url to file services * fix test * do not crash on errors with local filesystem * remove console * fix paranthesis * work on trezor.net integration * pushed non compiling sign wallet code * comment out wallet code * abstract ledger ws in add deriv * Auto stash before merge of "trezor" and "btcpayserver/master" * final add changes * cleanup * improve connectivity and fix e2e tests * fix selenium * add experimental warning for trezor * move import button to right and convert to text link * switch to defer and async scripts in add deriv scheme * make defer not async * more elaborate import trezor dialog * Fix small issues * hide trezor for now
2019-05-25 02:45:36 +00:00
<script>
window.coinName = "@Model.Network.DisplayName.ToLowerInvariant()";
</script>
}