]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/BIP39.git/blobdiff - bip39-standalone.html
Merge pull request #4 from robjohnson189/mycelium_testnet_fix
[perso/Immae/Projets/Cryptomonnaies/BIP39.git] / bip39-standalone.html
index b613f0fd31f79ea8e7ea1df4794de77f14b5a4f7..c015856d4477d6b6b0ebc5b6fe3c8bd7ef4996dd 100644 (file)
@@ -6278,6 +6278,17 @@ button.close {
                                 <textarea id="passphrase" class="passphrase form-control"></textarea>
                             </div>
                         </div>
+                        <div class="form-group">
+                            <label for="network-phrase" class="col-sm-2 control-label">Coin</label>
+                            <div class="col-sm-10">
+                                <select id="network-phrase" class="network form-control">
+                                    <option value="bitcoin">Bitcoin</option>
+                                    <option value="bitcoin-testnet">Bitcoin Testnet</option>
+                                    <option value="litecoin">Litecoin</option>
+                                    <option value="dogecoin">Dogecoin</option>
+                                </select>
+                            </div>
+                        </div>
                         <div class="form-group">
                             <label for="root-key" class="col-sm-2 control-label">BIP32 Root Key</label>
                             <div class="col-sm-10">
@@ -6294,12 +6305,51 @@ button.close {
                 <div class="col-md-12">
                     <h2>Derivation Path</h2>
                     <ul class="derivation-type nav nav-tabs" role="tablist">
-                        <li class="active">
-                        <a href="#bip44" role="tab" data-toggle="tab">BIP44</a></li>
-                        <li><a href="#bip32" role="tab" data-toggle="tab">BIP32</a></li>
+                        <li id="hive-tab" class="active">
+                            <a href="#hive" role="tab" data-toggle="tab">Hive Wallet</a>
+                        </li>
+                        <li id="mycelium-tab">
+                            <a href="#mycelium" role="tab" data-toggle="tab">Mycelium Wallet</a>
+                        </li>
+                        <li id="bip44-tab">
+                            <a href="#bip44" role="tab" data-toggle="tab">BIP44</a>
+                        </li>
+                        <li id="bip32-tab">
+                            <a href="#bip32" role="tab" data-toggle="tab">BIP32</a>
+                        </li>
                     </ul>
                     <div class="derivation-type tab-content">
-                        <div id="bip44" class="tab-pane active">
+                        <div id="hive" class="tab-pane active">
+                            <form class="form-horizontal" role="form">
+                                <br>
+                                <div class="col-sm-2"></div>
+                                <div class="col-sm-10">
+                                    <p>For more info see the <a href="https://www.hivewallet.com/" target="_blank">Hive Wallet homepage</a></p>
+                                </div>
+                                <div class="form-group">
+                                    <label for="hive-path" class="col-sm-2 control-label">BIP32 Derivation Path</label>
+                                    <div class="col-sm-10">
+                                        <input id="hive-path" type="text" class="path form-control" value="m/0'/0" readonly="readonly">
+                                    </div>
+                                </div>
+                            </form>
+                        </div>
+                        <div id="mycelium" class="tab-pane">
+                            <form class="form-horizontal" role="form">
+                                <br>
+                                <div class="col-sm-2"></div>
+                                <div class="col-sm-10">
+                                    <p>For more info see the <a href="http://www.mycelium.com/" target="_blank">Mycelium Wallet homepage</a></p>
+                                </div>
+                                <div class="form-group">
+                                    <label for="mycelium-path" class="col-sm-2 control-label">BIP32 Derivation Path</label>
+                                    <div class="col-sm-10">
+                                        <input id="mycelium-path" type="text" class="path form-control" value="m/44'/0'/0'/0" readonly="readonly">
+                                    </div>
+                                </div>
+                            </form>
+                        </div>
+                        <div id="bip44" class="tab-pane">
                             <form class="form-horizontal" role="form">
                                 <br>
                                 <div class="col-sm-2"></div>
@@ -6546,7 +6596,7 @@ button.close {
                 <td class="privkey"><span></span></td>
             </tr>
         </script>
-        <script>
+<script>
 /*!
  * jQuery JavaScript Library v2.1.1
  * http://jquery.com/
@@ -15737,8 +15787,8 @@ if ( typeof noGlobal === strundefined ) {
 return jQuery;
 
 }));
-        </script>
-        <script>
+</script>
+<script>
 /*!
  * Bootstrap v3.2.0 (http://getbootstrap.com)
  * Copyright 2011-2014 Twitter, Inc.
@@ -17853,8 +17903,8 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
   })
 
 }(jQuery);
-        </script>
-        <script>
+</script>
+<script>
 (function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.Bitcoin=e()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
 var assert = _dereq_('assert')
 
@@ -32318,8 +32368,8 @@ module.exports = Wallet
 },{"./address":69,"./hdnode":78,"./networks":81,"./transaction":85,"assert":4,"buffer":8,"secure-random":68}]},{},[79])
 (79)
 });
-        </script>
-        <script>
+</script>
+<script>
 // Select components from sjcl to suit the crypto operations bip39 requires.
 
 //// base.js
@@ -33379,11 +33429,9 @@ sjcl.hash.sha256.prototype = {
     h[7] = h[7]+h7 | 0;
   }
 };
-        </script>
-        <script>
-WORDLISTS = {};
-        </script>
-        <script>
+</script>
+<script>
+WORDLISTS = typeof WORDLISTS == "undefined" ? {} : WORDLISTS;
 WORDLISTS["english"] = [
 "abandon","ability","able","about","above","absent","absorb","abstract","absurd","abuse",
 "access","accident","account","accuse","achieve","acid","acoustic","acquire","across","act",
@@ -33590,8 +33638,8 @@ WORDLISTS["english"] = [
 "wish","witness","wolf","woman","wonder","wood","wool","word","work","world",
 "worry","worth","wrap","wreck","wrestle","wrist","write","wrong","yard","year",
 "yellow","you","young","youth","zebra","zero","zone","zoo"]
-        </script>
-        <script>
+</script>
+<script>
 /*
  * Copyright (c) 2013 Pavol Rusnak
  *
@@ -33801,8 +33849,8 @@ var Mnemonic = function(language) {
     init();
 
 }
-        </script>
-        <script>
+</script>
+<script>
 (function() {
 
     var mnemonic = new Mnemonic("english");
@@ -33818,12 +33866,18 @@ var Mnemonic = function(language) {
     var phraseChangeTimeoutEvent = null;
 
     var DOM = {};
+    DOM.network = $(".network");
+    DOM.phraseNetwork = $("#network-phrase");
     DOM.phrase = $(".phrase");
     DOM.passphrase = $(".passphrase");
     DOM.generate = $(".generate");
     DOM.rootKey = $(".root-key");
     DOM.extendedPrivKey = $(".extended-priv-key");
     DOM.extendedPubKey = $(".extended-pub-key");
+    DOM.bip32tab = $("#bip32-tab");
+    DOM.bip44tab = $("#bip44-tab");
+    DOM.bip32panel = $("#bip32");
+    DOM.bip44panel = $("#bip44");
     DOM.bip32path = $("#bip32-path");
     DOM.bip44path = $("#bip44-path");
     DOM.bip44purpose = $("#bip44 .purpose");
@@ -33839,11 +33893,13 @@ var Mnemonic = function(language) {
     DOM.indexToggle = $(".index-toggle");
     DOM.addressToggle = $(".address-toggle");
     DOM.privateKeyToggle = $(".private-key-toggle");
+    DOM.myceliumPath = $("#mycelium-path");
 
-    var derivationPath = DOM.bip44path.val();
+    var derivationPath = $(".tab-pane.active .path").val();
 
     function init() {
         // Events
+        DOM.network.on("change", networkChanged);
         DOM.phrase.on("input", delayedPhraseChanged);
         DOM.passphrase.on("input", delayedPhraseChanged);
         DOM.generate.on("click", generateClicked);
@@ -33864,6 +33920,31 @@ var Mnemonic = function(language) {
 
     // Event handlers
 
+    function networkChanged(e) {
+        var n = e.target.value;
+        if (n == "bitcoin") {
+            network = Bitcoin.networks.bitcoin;
+            DOM.bip44coin.val(0);
+            DOM.myceliumPath.val("m/44'/0'/0'/0");
+        }
+        else if (n == "bitcoin-testnet") {
+            network = Bitcoin.networks.testnet;
+            DOM.bip44coin.val(1);
+            DOM.myceliumPath.val("m/44'/1'/0'/0");
+        }
+        else if (n == "litecoin") {
+            network = Bitcoin.networks.litecoin;
+            DOM.bip44coin.val(2);
+        }
+        else if (n == "dogecoin") {
+            network = Bitcoin.networks.dogecoin;
+            var UNOFFICIAL_BIP44_COIN = 9999;
+            DOM.bip44coin.val(UNOFFICIAL_BIP44_COIN); // This coin is not in BIP44
+        }
+        setBip44DerivationPath();
+        delayedPhraseChanged();
+    }
+
     function delayedPhraseChanged() {
         hideValidationError();
         showPending();
@@ -34177,6 +34258,6 @@ var Mnemonic = function(language) {
     init();
 
 })();
-        </script>
+</script>
     </body>
 </html>