add two networks: Jingtum and MOAC
authorLospring Liu <lospringliu@gmail.com>
Sat, 15 Feb 2020 01:51:52 +0000 (20:51 -0500)
committerLospring Liu <lospringliu@gmail.com>
Sat, 15 Feb 2020 01:51:52 +0000 (20:51 -0500)
src/index.html
src/js/index.js
src/js/jingtum-util.js [new file with mode: 0644]

index d486fa273e1908df20b61ee7584d322bacda66cb..1184a0c69aca0ae82aea0bcd08b053f5de7b72f7 100644 (file)
         <script src="js/bitcoinjs-extensions.js"></script>
         <script src="js/segwit-parameters.js"></script>
         <script src="js/ripple-util.js"></script>
+        <script src="js/jingtum-util.js"></script>
         <script src="js/casinocoin-util.js"></script>
         <script src="js/eos-util.js"></script>
         <script src="js/sjcl-bip39.js"></script>
index 3981e8107ee882ea2c4e28cf0e4469936581872a..c2d34a711ac3c2be0ca06cb79984f35419b6fc23 100644 (file)
                     privkey = convertRipplePriv(privkey);
                     address = convertRippleAdrr(address);
                 }
+                // Jingtum values are different
+                if (networks[DOM.network.val()].name == "SWTC - Jingtum") {
+                    privkey = convertJingtumPriv(privkey);
+                    address = convertJingtumAdrr(address);
+                }
                 // CasinoCoin values are different
                 if (networks[DOM.network.val()].name == "CSC - CasinoCoin") {
                     privkey = convertCasinoCoinPriv(privkey);
                     || (name == "EWT - EnergyWeb")
                     || (name == "PIRL - Pirl")
                     || (name == "MIX - MIX")
+                    || (name == "MOAC - MOAC")
                     || (name == "MUSIC - Musicoin")
                     || (name == "POA - Poa")
                     || (name == "EXP - Expanse")
                 setHdCoin(214);
             },
         },
+        {
+            name: "MOAC - MOAC",
+            segwitAvailable: false,
+            onSelect: function() {
+                network = libs.bitcoin.networks.bitcoin;
+                setHdCoin(314);
+            },
+        },
         {
             name: "MUSIC - Musicoin",
             segwitAvailable: false,
                 setHdCoin(105);
             },
         },
+        {
+            name: "SWTC - Jingtum",
+            onSelect: function() {
+                network = libs.bitcoin.networks.bitcoin;
+                setHdCoin(315);
+            },
+        },
         {
             name: "TSTRAT - Stratis Testnet",
             onSelect: function() {
diff --git a/src/js/jingtum-util.js b/src/js/jingtum-util.js
new file mode 100644 (file)
index 0000000..56dbec6
--- /dev/null
@@ -0,0 +1,10 @@
+function convertJingtumAdrr(address) {
+        return libs.basex('jpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65rkm8oFqi1tuvAxyz').encode(
+           libs.basex('123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz').decode(address)
+        )
+      }
+
+function convertJingtumPriv(priv)   {
+        return libs.basex('123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz').decode(priv).toString("hex").slice(2,66)
+}
+