2023-03-08 17:57:36 +09:00
|
|
|
|
@inject BTCPayServer.Security.ContentSecurityPolicies Csp
|
2021-02-11 11:48:54 +01:00
|
|
|
|
@model WalletSetupViewModel
|
|
|
|
|
@{
|
2023-03-08 17:57:36 +09:00
|
|
|
|
Layout = "_LayoutWalletSetup";
|
|
|
|
|
ViewData.SetActivePage(StoreNavPages.OnchainSettings, "Scan QR code", Context.GetStoreData().Id);
|
|
|
|
|
Csp.UnsafeEval();
|
2021-02-11 11:48:54 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@section Navbar {
|
2022-01-07 12:32:00 +09:00
|
|
|
|
<a asp-controller="UIStores" asp-action="ImportWallet" asp-route-storeId="@Model.StoreId" asp-route-cryptoCode="@Model.CryptoCode" asp-route-method="">
|
2021-02-11 11:48:54 +01:00
|
|
|
|
<vc:icon symbol="back" />
|
|
|
|
|
</a>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
<header class="text-center">
|
|
|
|
|
<h1>@ViewData["Title"]</h1>
|
|
|
|
|
<p class="lead text-secondary mt-3">Scan the extended public key, also called "xpub", shown on your wallet's display.</p>
|
|
|
|
|
</header>
|
|
|
|
|
|
|
|
|
|
@if (!ViewContext.ModelState.IsValid)
|
|
|
|
|
{
|
|
|
|
|
<div asp-validation-summary="All" class="text-danger"></div>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
<div class="my-5">
|
|
|
|
|
<partial name="CameraScanner"/>
|
|
|
|
|
<form id="qr-import-form" method="post">
|
|
|
|
|
<input asp-for="WalletFileContent" type="hidden" />
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<p class="mt-5">
|
|
|
|
|
Generate a QR code of the extended public key in your wallet (see instructions for supported wallets below).
|
|
|
|
|
Allow the browser access to your camera and hold the code to the camera when the scan prompt appears.
|
|
|
|
|
</p>
|
|
|
|
|
|
2021-08-20 14:59:31 +02:00
|
|
|
|
<table class="table table-hover">
|
2021-02-11 11:48:54 +01:00
|
|
|
|
<thead>
|
|
|
|
|
<tr>
|
|
|
|
|
<th>Wallet</th>
|
|
|
|
|
<th>Instructions</th>
|
|
|
|
|
</tr>
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
2021-11-25 10:25:22 +01:00
|
|
|
|
<tr>
|
|
|
|
|
<td>BlueWallet</td>
|
|
|
|
|
<td>Open Wallet Settings ❯ Show Wallet XPUB</td>
|
|
|
|
|
</tr>
|
2021-02-11 11:48:54 +01:00
|
|
|
|
<tr>
|
|
|
|
|
<td class="text-nowrap">Cobo Vault</td>
|
|
|
|
|
<td>Open Wallet Settings ❯ Show/Export XPUB</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
2021-11-25 10:25:22 +01:00
|
|
|
|
<td class="text-nowrap">Keystone Vault</td>
|
|
|
|
|
<td>Open Wallet Settings ❯ Show/Export XPUB</td>
|
2021-02-11 11:48:54 +01:00
|
|
|
|
</tr>
|
2021-10-10 07:54:46 +01:00
|
|
|
|
<tr>
|
|
|
|
|
<td>Passport</td>
|
|
|
|
|
<td>Pair Wallet ❯ BTCPay ❯ QR Code</td>
|
|
|
|
|
</tr>
|
2021-02-11 11:48:54 +01:00
|
|
|
|
<tr>
|
|
|
|
|
<td>Specter DIY</td>
|
2022-08-31 12:27:26 +02:00
|
|
|
|
<td>Master public keys ❯ Select key</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>SeedSigner</td>
|
|
|
|
|
<td>Seeds ❯ Select seed ❯ Export XPUB ❯ BlueWallet</td>
|
2021-02-11 11:48:54 +01:00
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
|
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"/>
|
|
|
|
|
}
|
2021-02-11 11:48:54 +01:00
|
|
|
|
|
2021-05-19 04:39:27 +02:00
|
|
|
|
@section PageFootContent {
|
2022-08-31 12:27:06 +02:00
|
|
|
|
<partial name="_ValidationScriptsPartial"/>
|
2022-10-20 11:17:42 +09:00
|
|
|
|
<script src="~/vendor/vuejs/vue.min.js" asp-append-version="true"></script>
|
|
|
|
|
<script src="~/vendor/vue-qrcode/vue-qrcode.min.js" asp-append-version="true"></script>
|
|
|
|
|
<script src="~/vendor/ur-registry/urlib.min.js" asp-append-version="true"></script>
|
|
|
|
|
<script src="~/vendor/vue-qrcode-reader/VueQrcodeReader.umd.min.js" asp-append-version="true"></script>
|
|
|
|
|
|
2021-05-19 04:39:27 +02:00
|
|
|
|
<script>
|
2021-02-11 11:48:54 +01:00
|
|
|
|
window.coinName = "@Model.Network.DisplayName.ToLowerInvariant()";
|
2021-10-21 15:02:25 +02:00
|
|
|
|
document.addEventListener("DOMContentLoaded", function () {
|
2021-02-11 11:48:54 +01:00
|
|
|
|
initCameraScanningApp("Scan wallet QR", data => {
|
2022-08-31 12:27:06 +02:00
|
|
|
|
let xpub = "";
|
|
|
|
|
if (typeof(data) === "object") {
|
|
|
|
|
if (data.type === "crypto-account") {
|
|
|
|
|
const account = window.URlib.CryptoAccount.fromCBOR(data.cbor);
|
|
|
|
|
const [descriptor] = account.getOutputDescriptors();
|
|
|
|
|
xpub = descriptor.getHDKey().getBip32Key();
|
|
|
|
|
} else {
|
|
|
|
|
console.error('Unexpected UR type', data.type)
|
|
|
|
|
}
|
|
|
|
|
} else if (typeof(data) === 'string') {
|
|
|
|
|
xpub = data;
|
|
|
|
|
}
|
|
|
|
|
// submit
|
|
|
|
|
document.getElementById("WalletFileContent").value = xpub;
|
2021-02-11 11:48:54 +01:00
|
|
|
|
document.getElementById("qr-import-form").submit();
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
}
|