minified file and minor changes

This commit is contained in:
DavidKevork 2017-10-28 01:21:34 +11:00
parent b1e6f73c90
commit 5a6ad4e614
4 changed files with 62 additions and 11866 deletions

File diff suppressed because one or more lines are too long

View file

@ -49,54 +49,59 @@
<meta charset="utf-8">
<script type="text/javascript">
var hash_keccak = function(s) {
return CryptoJS.SHA3(s, { outputLength: 256, asBytes: true });
}
var hash_sha256 = function(s) {
return CryptoJS.SHA256(s, { asBytes: true });
}
var hash_ripemd160 = function(s) {
return CryptoJS.RIPEMD160(s, { asBytes: true });
}
var create_keypair = function() {
var keypair = KEYUTIL.generateKeypair("EC", "secp256k1");
return {prvKey: keypair.prvKeyObj.prvKeyHex, pubKey: keypair.pubKeyObj.pubKeyHex};
}
function wordArrayToByteArray(wordArray) {
var words = wordArray.words;
var sigBytes = wordArray.sigBytes;
var u8 = new Uint8Array(sigBytes);
for (var i = 0; i < sigBytes; i++) {
var byte = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
u8[i]=byte;
}
return u8;
}
var prvKey_to_WIF = function(prvKey, compressed) {
prvKey = compressed ? prvKey+'01' : prvKey;
var baby = CryptoJS.enc.Hex.parse(prvKey);
var version = CryptoJS.enc.Hex.parse('BF');
var child = version.concat(baby);
var teenager = hash_keccak(child);
var checksum = CryptoJS.lib.WordArray.create(teenager.words.slice(0, 4), 4);
var adult = child.concat(checksum);
var bytes = wordArrayToByteArray(adult);
return bs58_encode(bytes);
}
var create_address = function(pubkey) {
var key = CryptoJS.enc.Hex.parse(pubkey);
var baby = hash_sha256(key);
var child = hash_ripemd160(baby);
var version = CryptoJS.enc.Hex.parse('3F');
version.concat(child);
var teenager = version;
var adult = hash_keccak(teenager);
var checksum = CryptoJS.lib.WordArray.create(adult.words.slice(0, 4), 4);
var pensioner = teenager;
pensioner.concat(checksum);
var bytes = wordArrayToByteArray(pensioner);
return bs58_encode(bytes);
};
var hash_keccak = function(s) { return CryptoJS.SHA3(s, { outputLength: 256, asBytes: true }); }
var hash_sha256 = function(s) { return CryptoJS.SHA256(s, { asBytes: true }); }
var hash_ripemd160 = function(s) { return CryptoJS.RIPEMD160(s, { asBytes: true }); }
var create_keypair = function() {
var keypair = KEYUTIL.generateKeypair("EC", "secp256k1");
return {prvKey: keypair.prvKeyObj.prvKeyHex, pubKey: keypair.pubKeyObj.pubKeyHex};
}
function wordArrayToByteArray(wordArray) {
var words = wordArray.words;
var sigBytes = wordArray.sigBytes;
var u8 = new Uint8Array(sigBytes);
for (var i = 0; i < sigBytes; i++) {
var byte = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
u8[i]=byte;
}
return u8;
}
var prvKey_to_WIF = function(prvKey, compressed) {
prvKey = compressed ? prvKey+'01' : prvKey;
var baby = CryptoJS.enc.Hex.parse(prvKey);
var version = CryptoJS.enc.Hex.parse('BF');
var child = version.concat(baby);
var teenager = hash_keccak(child);
var checksum = CryptoJS.lib.WordArray.create(teenager.words.slice(0, 4), 4);
var adult = child.concat(checksum);
var bytes = wordArrayToByteArray(adult);
return bs58_encode(bytes);
}
var create_address = function(pubkey) {
var key = CryptoJS.enc.Hex.parse(pubkey);
var baby = hash_sha256(key);
var child = hash_ripemd160(baby);
var version = CryptoJS.enc.Hex.parse('3F');
version.concat(child);
var teenager = version;
var adult = hash_keccak(teenager);
var checksum = CryptoJS.lib.WordArray.create(adult.words.slice(0, 4), 4);
var pensioner = teenager;
pensioner.concat(checksum);
var bytes = wordArrayToByteArray(pensioner);
return bs58_encode(bytes);
}
function toggleClass(element, className){
if (!element || !className){ return; }
var classString = element.className, nameIndex = classString.indexOf(className);
if (nameIndex == -1) { classString += ' ' + className; }
else { classString = classString.substr(0, nameIndex) + classString.substr(nameIndex+className.length); }
element.className = classString;
}
function toggleSingelArt(hide) {
var SingleArt = document.getElementById('SingleArt');
toggleClass(SingleArt, 'removeImage');
}
</script>
<script type="text/javascript" src="./jsrsasign-latest-all-min.js">
//jsrsasign-latest-all-min.js
@ -219,12 +224,13 @@
<div class="commands">
<div id="singlecommands" class="row">
<span><input type="button" id="newaddress" value="Generate New Address" onclick="ninja.wallets.singlewallet.generateNewAddressAndKey();" /></span>
<span><label id="singlelabelhideart" for="singleart">Hide Art?</label> <input type="checkbox" id="singleart" onchange="toggleSingelArt(this);" /></span>
<span class="print"><input type="button" name="print" value="Print" id="singleprint" onclick="window.print();" /></span>
</div>
</div>
<div class="body">
<div class="SingleWalletBackground">
<img src="./paper_wallet.png" alt="Single Walelt" class="imageSingle">
<img src="./paper_wallet.png" alt="Single Walelt" class="imageSingle" id="SingleArt">
<div id="keyarea" class="keyarea">
<div class="public">
<div class="pubaddress">
@ -285,7 +291,7 @@
<span><input type="button" id="bulkgenerate" value="Generate" onclick="ninja.wallets.bulkwallet.buildCSV(document.getElementById('bulklimit').value * 1, document.getElementById('bulkstartindex').value * 1, document.getElementById('bulkcompressed').checked, document.getElementById('bulkpassphrase').value);" /> </span>
<span class="print"><input type="button" name="print" id="bulkprint" value="Print" onclick="window.print();" /></span>
</div>
<div id="bulkadvancedcommands" class="row extra">
<div id="bulkadvancedcommands" class="row extra" style="display: none;">
<span><label id="bulklabelencrypt" for="bulkencrypt">BIP38 Encrypt?</label> <input type="checkbox" id="bulkencrypt" onchange="ninja.wallets.bulkwallet.toggleEncrypt(this);" /></span>
<span><label id="bulklabelBIPpassphrase" for="bulkpassphrase">Passphrase:</label> <input type="text" id="bulkpassphrase" /></span>
</div>
@ -312,7 +318,7 @@
<li id="bulklabela2li1">Use the Bulk Wallet tab to pre-generate a large number of SmartCash addresses (10,000+). Copy and paste the generated comma separated values (CSV) list to a secure text file on your computer. Backup the file you just created to a secure location.</li>
<li id="bulklabela2li2">Import the SmartCash addresses into a database table on your web server. (Don't put the wallet/private keys on your web server, otherwise you risk hackers stealing your coins. Just the SmartCash addresses as they will be shown to customers.)</li>
<li id="bulklabela2li3">Provide an option on your website's shopping cart for your customer to pay in SmartCash. When the customer chooses to pay in SmartCash you will then display one of the addresses from your database to the customer as his "payment address" and save it with his shopping cart order.</li>
<li id="bulklabela2li4">You now need to be notified when the payment arrives. Google "SmartCash payment notification" and subscribe to at least one SmartCash payment notification service. There are various services that will notify you via Web Services, API, SMS, Email, etc. Once you receive this notification, which could be programmatically automated, you can process the customer's order. To manually check if a payment has arrived you can use Block Explorer. Replace THEADDRESSGOESHERE with the SmartCash address you are checking. It could take between 10 minutes to one hour for the transaction to be confirmed.<br />http://www.blockexplorer.com/address/THEADDRESSGOESHERE<br /><br />Unconfirmed transactions can be viewed at: http://blockchain.info/ <br />You should see the transaction there within 30 seconds.</li>
<li id="bulklabela2li4">You now need to be notified when the payment arrives. Google "SmartCash payment notification" and subscribe to at least one SmartCash payment notification service. There are various services that will notify you via Web Services, API, SMS, Email, etc. Once you receive this notification, which could be programmatically automated, you can process the customer's order. To manually check if a payment has arrived you can use Block Explorer. Replace THEADDRESSGOESHERE with the SmartCash address you are checking. It could take between 5 minutes to 20 minutes for the transaction to be confirmed.<br />https://explorer.smartcash.cc/address/THEADDRESSGOESHERE<br /><br />Unconfirmed transactions can be viewed at: https://explorer.smartcash.cc/ <br />You should see the transaction there within 30 seconds.</li>
<li id="bulklabela2li5">SmartCash will safely pile up on the block chain. Use the original wallet file you generated in step 1 to spend them.</li>
</ol>
</div>

View file

@ -6,7 +6,7 @@ a { position: relative; z-index: 20; }
.right { text-align: right; }
.walletarea { display: none; border: 2px solid #009900; }
hr { margin: 20px 0; border-top: 2px dashed #008000; }
.keyarea { height: 10px; text-align: left; position: relative; padding: 5px; }
.keyarea { height: 110px; text-align: left; position: relative; padding: 5px; }
.keyarea .public { float: left; }
.keyarea .pubaddress { display: inline-block; height: 40px; padding: 0 0 0 10px; float: left; }
.keyarea .privwif { margin: 0; float: right; text-align: right; padding: 0 20px 0 0; position: relative; }
@ -25,6 +25,9 @@ hr { margin: 20px 0; border-top: 2px dashed #008000; }
position: relative;
z-index: -1;
}
.removeImage {
visibility: hidden;
}
.SingleWalletBackground .keyarea {
height: 130px;
position: absolute;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 119 KiB

After

Width:  |  Height:  |  Size: 37 KiB