]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/BIP39.git/blobdiff - src/js/index.js
Merge pull request #466 from RitoProject/ritocoin
[perso/Immae/Projets/Cryptomonnaies/BIP39.git] / src / js / index.js
index f7835fa9f92e208ddccfb7e31d8deb077cd3dc25..713b5e847c1a5da4046d89fccd790ca03e58c425 100644 (file)
                          address = libs.bchaddrSlp.toSlpAddress(address);
                      }
                  }
+
+                // ZooBC address format may vary
+                if (networks[DOM.network.val()].name == "ZBC - ZooBlockchain") {  
+                    
+                    var purpose = parseIntNoNaN(DOM.bip44purpose.val(), 44);
+                    var coin = parseIntNoNaN(DOM.bip44coin.val(), 0);
+                    var path = "m/";
+                        path += purpose + "'/";
+                        path += coin + "'/" + index + "'";
+                    var result = libs.zoobcUtil.getKeypair(path, seed);
+    
+                    let publicKey = result.pubKey.slice(1, 33);
+                    let privateKey = result.key;
+    
+                    privkey = privateKey.toString('hex');
+                    pubkey = publicKey.toString('hex');
+    
+                    indexText = path;
+                    address = libs.zoobcUtil.getZBCAddress(publicKey, 'ZBC');
+                }
+
                 // Segwit addresses are different
                 if (isSegwit) {
                     if (!segwitAvailable) {
                 setHdCoin(136);
             },
         },
+        {
+            name: "ZBC - ZooBlockchain",
+            onSelect: function () {
+            network = libs.bitcoin.networks.zoobc;
+            setHdCoin(883);
+            },
+        },
         {
             name: "ZCL - Zclassic",
             onSelect: function() {