2019-05-11 00:29:29 +09:00
|
|
|
@model WalletPSBTViewModel
|
2020-10-21 14:03:11 +02:00
|
|
|
@addTagHelper *, BundlerMinifier.TagHelpers
|
2019-05-11 00:29:29 +09:00
|
|
|
@{
|
|
|
|
Layout = "../Shared/_NavLayout.cshtml";
|
|
|
|
ViewData["Title"] = "PSBT";
|
|
|
|
ViewData.SetActivePageAndTitle(WalletsNavPages.PSBT);
|
|
|
|
}
|
2019-10-31 15:19:38 +09:00
|
|
|
@if (TempData.HasStatusMessage())
|
2019-06-06 18:47:31 +09:00
|
|
|
{
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-10 text-center">
|
2020-10-21 14:03:11 +02:00
|
|
|
<partial name="_StatusMessage"/>
|
2019-06-06 18:47:31 +09:00
|
|
|
</div>
|
2019-05-12 13:13:52 +09:00
|
|
|
</div>
|
2019-06-06 18:47:31 +09:00
|
|
|
}
|
2019-05-11 00:29:29 +09:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-10">
|
2019-05-12 00:05:30 +09:00
|
|
|
@if (Model.Errors != null && Model.Errors.Count != 0)
|
|
|
|
{
|
|
|
|
<div class="alert alert-danger alert-dismissible" role="alert">
|
2020-10-21 14:03:11 +02:00
|
|
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
|
|
|
<span aria-hidden="true">×</span>
|
|
|
|
</button>
|
2019-05-12 00:05:30 +09:00
|
|
|
@foreach (var error in Model.Errors)
|
|
|
|
{
|
2020-10-21 14:03:11 +02:00
|
|
|
<span>@error</span>
|
|
|
|
<br/>
|
2019-05-12 00:05:30 +09:00
|
|
|
}
|
|
|
|
</div>
|
|
|
|
}
|
2019-05-11 00:29:29 +09:00
|
|
|
@if (!string.IsNullOrEmpty(Model.Decoded))
|
|
|
|
{
|
|
|
|
<h3>Decoded PSBT</h3>
|
2019-05-11 20:26:31 +09:00
|
|
|
<div class="form-group">
|
2020-02-13 14:06:00 +01:00
|
|
|
<form method="post" asp-action="WalletPSBT" asp-route-walletId="@this.Context.GetRouteValue("walletId")">
|
2020-10-21 14:03:11 +02:00
|
|
|
<input type="hidden" asp-for="CryptoCode"/>
|
|
|
|
<input type="hidden" asp-for="NBXSeedAvailable"/>
|
|
|
|
<input type="hidden" asp-for="PSBT"/>
|
|
|
|
<input type="hidden" asp-for="FileName"/>
|
|
|
|
<div class="d-flex">
|
2020-07-14 09:18:40 +02:00
|
|
|
<partial name="WalletSigningMenu" model="@((Model.CryptoCode, Model.NBXSeedAvailable))"/>
|
|
|
|
<div class="ml-2 dropdown">
|
|
|
|
<button class="btn btn-secondary dropdown-toggle" type="button" id="OtherActions" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
|
|
|
Other actions...
|
|
|
|
</button>
|
|
|
|
<div class="dropdown-menu" aria-labelledby="OtherActions">
|
|
|
|
<button name="command" type="submit" class="dropdown-item" value="broadcast">Review</button>
|
|
|
|
<button name="command" type="submit" class="dropdown-item" value="update">Update</button>
|
|
|
|
<button name="command" type="submit" class="dropdown-item" value="combine">Combine</button>
|
2020-07-14 09:23:28 +02:00
|
|
|
<button name="command" type="submit" class="dropdown-item" value="save-psbt">Download</button>
|
2020-10-21 14:03:11 +02:00
|
|
|
<button name="command" type="button" class="dropdown-item only-for-js" data-toggle="modal" data-target="#scan-qr-modal">Show QR</button>
|
2020-07-14 09:18:40 +02:00
|
|
|
</div>
|
2019-05-30 23:16:05 +09:00
|
|
|
</div>
|
2019-05-12 00:05:30 +09:00
|
|
|
</div>
|
|
|
|
</form>
|
2019-05-11 20:26:31 +09:00
|
|
|
</div>
|
2019-05-12 14:51:24 +09:00
|
|
|
<pre><code class="json">@Model.Decoded</code></pre>
|
2019-05-11 00:29:29 +09:00
|
|
|
}
|
2020-08-03 10:12:21 +02:00
|
|
|
<h4 class="mb-3">Decode PSBT</h4>
|
|
|
|
<p>You can decode a PSBT by either pasting its content or by uploading the file.</p>
|
2020-02-13 14:06:00 +01:00
|
|
|
<form class="form-group" method="post" asp-action="WalletPSBT" asp-route-walletId="@this.Context.GetRouteValue("walletId")" enctype="multipart/form-data">
|
2019-05-11 00:29:29 +09:00
|
|
|
<div class="form-group">
|
2020-08-03 10:12:21 +02:00
|
|
|
<label asp-for="PSBT"></label>
|
2019-05-11 00:29:29 +09:00
|
|
|
<textarea class="form-control" rows="5" asp-for="PSBT"></textarea>
|
|
|
|
<span asp-validation-for="PSBT" class="text-danger"></span>
|
2020-10-21 14:03:11 +02:00
|
|
|
|
2019-05-11 00:29:29 +09:00
|
|
|
</div>
|
2019-05-19 23:27:18 +09:00
|
|
|
<div class="form-group">
|
|
|
|
<label asp-for="UploadedPSBTFile"></label>
|
|
|
|
<input type="file" class="form-control-file" asp-for="UploadedPSBTFile">
|
|
|
|
</div>
|
2020-10-21 14:03:11 +02:00
|
|
|
|
|
|
|
<button type="button" id="scanqrcode" class="ml-2 btn btn-secondary only-for-js" data-toggle="modal" data-target="#scanModal" title="Scan with camera">
|
|
|
|
<i class="fa fa-camera"></i>
|
|
|
|
</button>
|
|
|
|
<button type="submit" name="command" value="decode" class="btn btn-primary" id="Decode">Decode</button>
|
2019-05-11 00:29:29 +09:00
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-10-21 14:03:11 +02:00
|
|
|
<partial name="ShowQR"/>
|
|
|
|
<partial name="CameraScanner"/>
|
|
|
|
|
2019-05-11 00:29:29 +09:00
|
|
|
|
|
|
|
@section Scripts {
|
2020-04-18 17:56:05 +02:00
|
|
|
<link rel="stylesheet" href="~/vendor/highlightjs/default.min.css" asp-append-version="true">
|
|
|
|
<script src="~/vendor/highlightjs/highlight.min.js" asp-append-version="true"></script>
|
2020-10-21 14:03:11 +02:00
|
|
|
<bundle name="wwwroot/bundles/camera-bundle.min.js"></bundle>
|
|
|
|
<link href="~/vendor/vue-qrcode-reader/vue-qrcode-reader.css" rel="stylesheet" asp-append-version="true"/>
|
2019-05-11 00:29:29 +09:00
|
|
|
<script>hljs.initHighlightingOnLoad();</script>
|
2020-10-21 14:03:11 +02:00
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
|
|
$(function (){
|
|
|
|
initQRShow("Scan PSBT", @Json.Serialize(Model.PSBTHex), "scan-qr-modal");
|
|
|
|
|
|
|
|
initCameraScanningApp("Scan PSBT", function (data){
|
|
|
|
$("textarea[name=PSBT]").val(data);
|
|
|
|
$("#Decode").click();
|
|
|
|
}, "scanModal")
|
|
|
|
});
|
|
|
|
</script>
|
2019-05-11 00:29:29 +09:00
|
|
|
}
|