Merge pull request #127 from olivergregorius/paperwallet

Paperwallet
This commit is contained in:
OutCast3k 2019-05-24 15:41:54 +01:00 committed by GitHub
commit fc66bc9423
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 1 deletions

View file

@ -339,6 +339,8 @@
</div>
<input type="button" class="btn btn-primary" value="Generate" id="newKeysBtn">
<br><br>
<input type="button" class="btn btn-primary" value="Print Paperwallet" id="newPaperwalletBtn" disabled>
<br>
</div>
@ -384,6 +386,8 @@
</div>
<input type="button" class="btn btn-primary" value="Generate" id="newSegWitKeysBtn">
<br><br>
<input type="button" class="btn btn-primary" value="Print Paperwallet" id="newSegwitPaperwalletBtn" disabled>
<br>
</div>

View file

@ -344,7 +344,19 @@ $(document).ready(function() {
$("#aes256passStatus").removeClass("hidden");
}
$("#newPrivKeyEnc").val(CryptoJS.AES.encrypt(coin.wif, $("#aes256pass").val())+'');
$("#newPaperwalletBtn").prop("disabled", false);
});
$("#newPaperwalletBtn").click(function(){
var paperwallet = window.open();
paperwallet.document.write('<h1>BTC PaperWallet</h1><hr><div style="margin-top: 5px; margin-bottom: 10px"><div><h2 style="margin-top: 0">Address (Share)</h2></div><div style="text-align: center;"><div id="qraddress"></div><p>'+$("#newBitcoinAddress").val()+'</p></div></div><hr><div style="margin-top: 5px; margin-bottom: 10px"><div><h2 style="margin-top: 0">Public Key</h2></div><div style="text-align: center;"><div id="qrpubkey"></div><p>'+$("#newPubKey").val()+'</p></div></div><hr><hr><div style="margin-top: 5px; margin-bottom: 10px"><div><h2 style="margin-top: 0">Private Key (KEEP SECRET!)</h2></div><div style="text-align: center;"><div id="qrprivkey"></div><p>'+$("#newPrivKey").val()+'</p></div></div><hr>');
paperwallet.document.close();
paperwallet.focus();
new QRCode(paperwallet.document.getElementById("qraddress"), {text: $("#newBitcoinAddress").val(), width: 128, height: 128});
new QRCode(paperwallet.document.getElementById("qrpubkey"), {text: $("#newPubKey").val(), width: 128, height: 128});
new QRCode(paperwallet.document.getElementById("qrprivkey"), {text: $("#newPrivKey").val(), width: 128, height: 128});
paperwallet.print();
paperwallet.close();
});
$("#newBrainwallet").click(function(){
@ -390,8 +402,21 @@ $(document).ready(function() {
$("#newSegWitPubKey").val(coin.pubkey);
$("#newSegWitPrivKey").val(coin.wif);
coinjs.compressed = compressed;
$("#newSegwitPaperwalletBtn").prop("disabled", false);
});
$("#newSegwitPaperwalletBtn").click(function(){
var paperwallet = window.open();
paperwallet.document.write('<h1>BTC SegWit PaperWallet</h1><hr><div style="margin-top: 5px; margin-bottom: 10px"><div><h2 style="margin-top: 0">Address (Share)</h2></div><div style="text-align: center;"><div id="qraddress"></div><p>'+$("#newSegWitAddress").val()+'</p></div></div><hr><div style="margin-top: 5px; margin-bottom: 10px"><div><h2 style="margin-top: 0">Public Key</h2></div><div style="text-align: center;"><div id="qrpubkey"></div><p>'+$("#newSegWitPubKey").val()+'</p></div></div><hr><div style="margin-top: 5px; margin-bottom: 10px"><div><h2 style="margin-top: 0">Redeem Script</h2></div><div style="text-align: center;"><div id="qrredeem"></div><p>'+$("#newSegWitRedeemScript").val()+'</p></div></div><hr><hr><div style="margin-top: 5px; margin-bottom: 10px"><div><h2 style="margin-top: 0">Private Key (KEEP SECRET!)</h2></div><div style="text-align: center;"><div id="qrprivkey"></div><p>'+$("#newSegWitPrivKey").val()+'</p></div></div><hr>');
paperwallet.document.close();
paperwallet.focus();
new QRCode(paperwallet.document.getElementById("qraddress"), {text: $("#newSegWitAddress").val(), width: 128, height: 128});
new QRCode(paperwallet.document.getElementById("qrpubkey"), {text: $("#newSegWitPubKey").val(), width: 128, height: 128});
new QRCode(paperwallet.document.getElementById("qrredeem"), {text: $("#newSegWitRedeemScript").val(), width: 128, height: 128});
new QRCode(paperwallet.document.getElementById("qrprivkey"), {text: $("#newSegWitPrivKey").val(), width: 128, height: 128});
paperwallet.print();
paperwallet.close();
});
/* new -> multisig code */