X-Git-Url: https://git.immae.eu/?p=perso%2FImmae%2FProjets%2FCryptomonnaies%2FBIP39.git;a=blobdiff_plain;f=src%2Fjs%2Findex.js;h=3a5a0ef3fecc7f4d804bc84bc118832c28f20527;hp=01027b58571cc399ff9fc9f3f8bd1b5bac7636a7;hb=e40acc3ab0e78ca3a9b63d0b1c9e16f804da104e;hpb=4d9c184a8416d6b8451bbfa5e856fe11103ed2e3 diff --git a/src/js/index.js b/src/js/index.js index 01027b5..3a5a0ef 100644 --- a/src/js/index.js +++ b/src/js/index.js @@ -175,6 +175,10 @@ function delayedPhraseChanged() { hideValidationError(); + seed = null; + bip32RootKey = null; + bip32ExtendedKey = null; + clearAddressesList(); showPending(); if (phraseChangeTimeoutEvent != null) { clearTimeout(phraseChangeTimeoutEvent); @@ -184,7 +188,6 @@ function phraseChanged() { showPending(); - hideValidationError(); setMnemonicLanguage(); // Get the mnemonic phrase var phrase = DOM.phrase.val(); @@ -197,7 +200,6 @@ var passphrase = DOM.passphrase.val(); calcBip32RootKeyFromSeed(phrase, passphrase); calcForDerivationPath(); - hidePending(); } function delayedEntropyChanged() { @@ -273,10 +275,9 @@ } function calcForDerivationPath() { - showPending(); clearDerivedKeys(); clearAddressesList(); - hideValidationError(); + showPending(); // Don't show bip49 if it's selected but network doesn't support it if (bip49TabSelected() && !networkHasBip49()) { return; @@ -296,7 +297,6 @@ displayBip49Info(); } displayBip32Info(); - hidePending(); } function generateClicked() { @@ -603,17 +603,19 @@ for (var i=0; i"); option.attr("value", i); option.text(network.name); + if (network.name == "BTC - Bitcoin") { + option.prop("selected", true); + } DOM.phraseNetwork.append(option); } } @@ -1163,6 +1171,14 @@ } var networks = [ + { + name: "BCH - Bitcoin Cash", + bip49available: false, + onSelect: function() { + network = bitcoinjs.bitcoin.networks.bitcoin; + setHdCoin(145); + }, + }, { name: "BTC - Bitcoin", bip49available: true, @@ -1251,6 +1267,15 @@ setHdCoin(2); }, }, + { + name: "MAZA - Maza", + bip49available: false, + onSelect: function() { + network = bitcoinjs.bitcoin.networks.maza; + setHdCoin(13); + }, + }, + { name: "NMC - Namecoin", bip49available: false, @@ -1259,6 +1284,22 @@ setHdCoin(7); }, }, + { + name: "PIVX - PIVX", + bip49available: false, + onSelect: function() { + network = bitcoinjs.bitcoin.networks.pivx; + setHdCoin(119); + }, + }, + { + name: "PIVX - PIVX Testnet", + bip49available: false, + onSelect: function() { + network = bitcoinjs.bitcoin.networks.pivxtestnet; + setHdCoin(1); + }, + }, { name: "PPC - Peercoin", bip49available: false, @@ -1316,19 +1357,19 @@ }, }, { - name: "XRP - Ripple", + name: "XMY - Myriadcoin", bip49available: false, onSelect: function() { - network = bitcoinjs.bitcoin.networks.bitcoin; - setHdCoin(144); + network = bitcoinjs.bitcoin.networks.myriadcoin; + setHdCoin(90); }, }, { - name: "XMY - Myriadcoin", + name: "XRP - Ripple", bip49available: false, onSelect: function() { - network = bitcoinjs.bitcoin.networks.myriadcoin; - setHdCoin(90); + network = bitcoinjs.bitcoin.networks.bitcoin; + setHdCoin(144); }, } ]