]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/BIP39.git/blobdiff - src/js/index.js
Add bitcoin regtest params
[perso/Immae/Projets/Cryptomonnaies/BIP39.git] / src / js / index.js
index 3db0a31938fe8c093187c8dbace172093c42ece5..d169ed28dc2ebcd808c2d1ec9edbb0b1455d3280 100644 (file)
         }
         phraseChangeTimeoutEvent = setTimeout(function() {
             phraseChanged();
-            var entropy = mnemonic.toRawEntropyBin(DOM.phrase.val());
+            var entropy = mnemonic.toRawEntropyHex(DOM.phrase.val());
             if (entropy !== null) {
                 DOM.entropyMnemonicLength.val("raw");
                 DOM.entropy.val(entropy);
+                DOM.entropyTypeInputs.filter("[value='hexadecimal']").prop("checked", true);
+                entropyTypeAutoDetect = false;
             }
         }, 400);
     }
                 setHdCoin(0);
             },
         },
+        {
+            name: "BTC - Bitcoin RegTest",
+            onSelect: function() {
+                network = bitcoinjs.bitcoin.networks.regtest;
+                // Using hd coin value 1 based on bip44_coin_type
+                // https://github.com/chaintope/bitcoinrb/blob/f1014406f6b8f9b4edcecedc18df70c80df06f11/lib/bitcoin/chainparams/regtest.yml
+                setHdCoin(1);
+            },
+        },
         {
             name: "BTC - Bitcoin Testnet",
             onSelect: function() {