From b997751791a1f8d1a0f0eb4941bd95b988294e70 Mon Sep 17 00:00:00 2001 From: oliverdorn Date: Sat, 25 Nov 2017 00:53:00 +0100 Subject: [PATCH] Added functionality for printing Paper Wallet --- js/coinbin.js | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/js/coinbin.js b/js/coinbin.js index c07170a..15b77fe 100644 --- a/js/coinbin.js +++ b/js/coinbin.js @@ -309,7 +309,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('

BTC PaperWallet


Address (Share)

'+$("#newBitcoinAddress").val()+'


Public Key

'+$("#newPubKey").val()+'



Private Key (KEEP SECRET!)

'+$("#newPrivKey").val()+'


'); + 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(){ @@ -348,8 +360,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('

BTC SegWit PaperWallet


Address (Share)

'+$("#newSegWitAddress").val()+'


Public Key

'+$("#newSegWitPubKey").val()+'


Redeem Script

'+$("#newSegWitRedeemScript").val()+'



Private Key (KEEP SECRET!)

'+$("#newSegWitPrivKey").val()+'


'); + 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 */