X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2Fjs%2Findex.js;h=9dabe9534677e37c56985a6bfc43366f2c289695;hb=cee442b16b80490c3549b667068372fd28395593;hp=c8ab28467195b71d7fd2e36c6015635e6c341094;hpb=e3a9508cc0bcd22cde34036e4d4524e9fa8c731d;p=perso%2FImmae%2FProjets%2FCryptomonnaies%2FBIP39.git diff --git a/src/js/index.js b/src/js/index.js index c8ab284..9dabe95 100644 --- a/src/js/index.js +++ b/src/js/index.js @@ -40,7 +40,6 @@ DOM.indexToggle = $(".index-toggle"); DOM.addressToggle = $(".address-toggle"); DOM.privateKeyToggle = $(".private-key-toggle"); - DOM.myceliumPath = $("#mycelium-path"); var derivationPath = $(".tab-pane.active .path").val(); @@ -136,7 +135,6 @@ function bip44Changed() { setBip44DerivationPath(); - derivationPath = DOM.bip44path.val(); derivationChanged(); } @@ -164,21 +162,6 @@ return; } var numWords = parseInt(DOM.strength.val()); - // Check strength is an integer - if (isNaN(numWords)) { - DOM.strength.val("12"); - numWords = 12; - } - // Check strength is a multiple of 32, if not round it down - if (numWords % 3 != 0) { - numWords = Math.floor(numWords / 3) * 3; - DOM.strength.val(numWords); - } - // Check strength is at least 32 - if (numWords == 0) { - numWords = 3; - DOM.strength.val(numWords); - } var strength = numWords / 3 * 32; var words = mnemonic.generate(strength); DOM.phrase.val(words); @@ -326,7 +309,8 @@ var addressCell = row.find(".address span"); var privkeyCell = row.find(".privkey span"); // Content - indexCell.text(index); + var indexText = derivationPath + "/" + index; + indexCell.text(indexText); addressCell.text(address); privkeyCell.text(privkey); // Visibility @@ -337,7 +321,7 @@ addressCell.addClass("invisible"); } if (!showPrivKey) { - privkeCell.addClass("invisible"); + privkeyCell.addClass("invisible"); } DOM.addresses.append(row); } @@ -363,6 +347,7 @@ path += account + "'/"; path += change; DOM.bip44path.val(path); + derivationPath = DOM.bip44path.val(); } function parseIntNoNaN(val, defaultVal) { @@ -401,7 +386,6 @@ onSelect: function() { network = bitcoin.networks.bitcoin; DOM.bip44coin.val(0); - DOM.myceliumPath.val("m/44'/0'/0'/0"); }, }, { @@ -409,7 +393,6 @@ onSelect: function() { network = bitcoin.networks.testnet; DOM.bip44coin.val(1); - DOM.myceliumPath.val("m/44'/1'/0'/0"); }, }, { @@ -440,6 +423,34 @@ DOM.bip44coin.val(1); }, }, + { + name: "Viacoin", + onSelect: function() { + network = bitcoin.networks.viacoin; + DOM.bip44coin.val(14); + }, + }, + { + name: "Viacoin Testnet", + onSelect: function() { + network = bitcoin.networks.viacointestnet; + DOM.bip44coin.val(1); + }, + }, + { + name: "Jumbucks", + onSelect: function() { + network = bitcoin.networks.jumbucks; + DOM.bip44coin.val(26); + }, + }, + { + name: "CLAM", + onSelect: function() { + network = bitcoin.networks.clam; + DOM.bip44coin.val(23); + }, + }, ] init();