diff options
-rw-r--r-- | src/js/index.js | 87 | ||||
-rw-r--r-- | tests/spec/tests.js | 49 |
2 files changed, 128 insertions, 8 deletions
diff --git a/src/js/index.js b/src/js/index.js index bfab5cf..589ba20 100644 --- a/src/js/index.js +++ b/src/js/index.js | |||
@@ -910,7 +910,14 @@ | |||
910 | indexText = indexText + "'"; | 910 | indexText = indexText + "'"; |
911 | } | 911 | } |
912 | // Ethereum values are different | 912 | // Ethereum values are different |
913 | if (networks[DOM.network.val()].name == "ETH - Ethereum") { | 913 | if ((networks[DOM.network.val()].name == "ETH - Ethereum") |
914 | || (networks[DOM.network.val()].name == "ETC - Ethereum Classic") | ||
915 | || (networks[DOM.network.val()].name == "PIRL - Pirl") | ||
916 | || (networks[DOM.network.val()].name == "MIX - MIX") | ||
917 | || (networks[DOM.network.val()].name == "MUSIC - Musicoin") | ||
918 | || (networks[DOM.network.val()].name == "POA - Poa") | ||
919 | || (networks[DOM.network.val()].name == "EXP - Expanse") | ||
920 | || (networks[DOM.network.val()].name == "CLO - Callisto")) { | ||
914 | var privKeyBuffer = keyPair.d.toBuffer(32); | 921 | var privKeyBuffer = keyPair.d.toBuffer(32); |
915 | privkey = privKeyBuffer.toString('hex'); | 922 | privkey = privKeyBuffer.toString('hex'); |
916 | var addressBuffer = ethUtil.privateToAddress(privKeyBuffer); | 923 | var addressBuffer = ethUtil.privateToAddress(privKeyBuffer); |
@@ -1773,6 +1780,14 @@ | |||
1773 | }, | 1780 | }, |
1774 | }, | 1781 | }, |
1775 | { | 1782 | { |
1783 | name: "CLO - Callisto", | ||
1784 | segwitAvailable: false, | ||
1785 | onSelect: function() { | ||
1786 | network = bitcoinjs.bitcoin.networks.bitcoin; | ||
1787 | setHdCoin(820); | ||
1788 | }, | ||
1789 | }, | ||
1790 | { | ||
1776 | name: "CLUB - Clubcoin", | 1791 | name: "CLUB - Clubcoin", |
1777 | onSelect: function() { | 1792 | onSelect: function() { |
1778 | network = bitcoinjs.bitcoin.networks.clubcoin; | 1793 | network = bitcoinjs.bitcoin.networks.clubcoin; |
@@ -1892,6 +1907,14 @@ | |||
1892 | }, | 1907 | }, |
1893 | }, | 1908 | }, |
1894 | { | 1909 | { |
1910 | name: "ETC - Ethereum Classic", | ||
1911 | segwitAvailable: false, | ||
1912 | onSelect: function() { | ||
1913 | network = bitcoinjs.bitcoin.networks.bitcoin; | ||
1914 | setHdCoin(61); | ||
1915 | }, | ||
1916 | }, | ||
1917 | { | ||
1895 | name: "ETH - Ethereum", | 1918 | name: "ETH - Ethereum", |
1896 | onSelect: function() { | 1919 | onSelect: function() { |
1897 | network = bitcoinjs.bitcoin.networks.bitcoin; | 1920 | network = bitcoinjs.bitcoin.networks.bitcoin; |
@@ -1906,6 +1929,14 @@ | |||
1906 | }, | 1929 | }, |
1907 | }, | 1930 | }, |
1908 | { | 1931 | { |
1932 | name: "EXP - Expanse", | ||
1933 | segwitAvailable: false, | ||
1934 | onSelect: function() { | ||
1935 | network = bitcoinjs.bitcoin.networks.bitcoin; | ||
1936 | setHdCoin(40); | ||
1937 | }, | ||
1938 | }, | ||
1939 | { | ||
1909 | name: "FJC - Fujicoin", | 1940 | name: "FJC - Fujicoin", |
1910 | onSelect: function() { | 1941 | onSelect: function() { |
1911 | network = bitcoinjs.bitcoin.networks.fujicoin; | 1942 | network = bitcoinjs.bitcoin.networks.fujicoin; |
@@ -2070,6 +2101,14 @@ | |||
2070 | }, | 2101 | }, |
2071 | }, | 2102 | }, |
2072 | { | 2103 | { |
2104 | name: "MIX - MIX", | ||
2105 | segwitAvailable: false, | ||
2106 | onSelect: function() { | ||
2107 | network = bitcoinjs.bitcoin.networks.bitcoin; | ||
2108 | setHdCoin(76); | ||
2109 | }, | ||
2110 | }, | ||
2111 | { | ||
2073 | name: "MNX - Minexcoin", | 2112 | name: "MNX - Minexcoin", |
2074 | onSelect: function() { | 2113 | onSelect: function() { |
2075 | network = bitcoinjs.bitcoin.networks.minexcoin; | 2114 | network = bitcoinjs.bitcoin.networks.minexcoin; |
@@ -2084,6 +2123,14 @@ | |||
2084 | }, | 2123 | }, |
2085 | }, | 2124 | }, |
2086 | { | 2125 | { |
2126 | name: "MUSIC - Musicoin", | ||
2127 | segwitAvailable: false, | ||
2128 | onSelect: function() { | ||
2129 | network = bitcoinjs.bitcoin.networks.bitcoin; | ||
2130 | setHdCoin(184); | ||
2131 | }, | ||
2132 | }, | ||
2133 | { | ||
2087 | name: "NAV - Navcoin", | 2134 | name: "NAV - Navcoin", |
2088 | onSelect: function() { | 2135 | onSelect: function() { |
2089 | network = bitcoinjs.bitcoin.networks.navcoin; | 2136 | network = bitcoinjs.bitcoin.networks.navcoin; |
@@ -2182,6 +2229,14 @@ | |||
2182 | }, | 2229 | }, |
2183 | }, | 2230 | }, |
2184 | { | 2231 | { |
2232 | name: "PIRL - Pirl", | ||
2233 | segwitAvailable: false, | ||
2234 | onSelect: function() { | ||
2235 | network = bitcoinjs.bitcoin.networks.bitcoin; | ||
2236 | setHdCoin(164); | ||
2237 | }, | ||
2238 | }, | ||
2239 | { | ||
2185 | name: "PIVX - PIVX", | 2240 | name: "PIVX - PIVX", |
2186 | onSelect: function() { | 2241 | onSelect: function() { |
2187 | network = bitcoinjs.bitcoin.networks.pivx; | 2242 | network = bitcoinjs.bitcoin.networks.pivx; |
@@ -2196,6 +2251,14 @@ | |||
2196 | }, | 2251 | }, |
2197 | }, | 2252 | }, |
2198 | { | 2253 | { |
2254 | name: "POA - Poa", | ||
2255 | segwitAvailable: false, | ||
2256 | onSelect: function() { | ||
2257 | network = bitcoinjs.bitcoin.networks.bitcoin; | ||
2258 | setHdCoin(178); | ||
2259 | }, | ||
2260 | }, | ||
2261 | { | ||
2199 | name: "POSW - POSWcoin", | 2262 | name: "POSW - POSWcoin", |
2200 | onSelect: function() { | 2263 | onSelect: function() { |
2201 | network = bitcoinjs.bitcoin.networks.poswcoin; | 2264 | network = bitcoinjs.bitcoin.networks.poswcoin; |
@@ -2427,6 +2490,14 @@ | |||
2427 | }, | 2490 | }, |
2428 | }, | 2491 | }, |
2429 | { | 2492 | { |
2493 | name: "XUEZ - Xuez", | ||
2494 | segwitAvailable: false, | ||
2495 | onSelect: function() { | ||
2496 | network = bitcoinjs.bitcoin.networks.xuez; | ||
2497 | setHdCoin(225); | ||
2498 | }, | ||
2499 | }, | ||
2500 | { | ||
2430 | name: "XWC - Whitecoin", | 2501 | name: "XWC - Whitecoin", |
2431 | onSelect: function() { | 2502 | onSelect: function() { |
2432 | network = bitcoinjs.bitcoin.networks.whitecoin; | 2503 | network = bitcoinjs.bitcoin.networks.whitecoin; |
@@ -2455,13 +2526,6 @@ | |||
2455 | }, | 2526 | }, |
2456 | }, | 2527 | }, |
2457 | { | 2528 | { |
2458 | name: "XUEZ - Xuez", | ||
2459 | onSelect: function() { | ||
2460 | network = bitcoinjs.bitcoin.networks.xuez; | ||
2461 | setHdCoin(225); | ||
2462 | }, | ||
2463 | }, | ||
2464 | { | ||
2465 | name: "ZEN - Zencash", | 2529 | name: "ZEN - Zencash", |
2466 | onSelect: function() { | 2530 | onSelect: function() { |
2467 | network = bitcoinjs.bitcoin.networks.zencash; | 2531 | network = bitcoinjs.bitcoin.networks.zencash; |
@@ -2491,6 +2555,13 @@ | |||
2491 | DOM.bip32path.val("m/0'/0"); | 2555 | DOM.bip32path.val("m/0'/0"); |
2492 | DOM.hardenedAddresses.prop('checked', false); | 2556 | DOM.hardenedAddresses.prop('checked', false); |
2493 | }, | 2557 | }, |
2558 | }, | ||
2559 | { | ||
2560 | name: "Coinomi, Ledger", | ||
2561 | onSelect: function() { | ||
2562 | DOM.bip32path.val("m/44'/"+DOM.bip44coin.val()+"'/0'"); | ||
2563 | DOM.hardenedAddresses.prop('checked', false); | ||
2564 | }, | ||
2494 | } | 2565 | } |
2495 | ] | 2566 | ] |
2496 | 2567 | ||
diff --git a/tests/spec/tests.js b/tests/spec/tests.js index c97c973..ddb909a 100644 --- a/tests/spec/tests.js +++ b/tests/spec/tests.js | |||
@@ -1215,6 +1215,55 @@ it('Allows selection of Energi', function(done) { | |||
1215 | }; | 1215 | }; |
1216 | testNetwork(done, params); | 1216 | testNetwork(done, params); |
1217 | }); | 1217 | }); |
1218 | it('Allows selection of Ethereum Classic', function(done) { | ||
1219 | var params = { | ||
1220 | selectText: "ETC - Ethereum Classic", | ||
1221 | firstAddress: "0x3c05e5556693808367afB62eF3b63e35d6eD249A", | ||
1222 | }; | ||
1223 | testNetwork(done, params); | ||
1224 | }); | ||
1225 | it('Allows selection of Pirl', function(done) { | ||
1226 | var params = { | ||
1227 | selectText: "PIRL - Pirl", | ||
1228 | firstAddress: "0xe77FC0723dA122B5025CA79193c28563eB47e776", | ||
1229 | }; | ||
1230 | testNetwork(done, params); | ||
1231 | }); | ||
1232 | it('Allows selection of MIX', function(done) { | ||
1233 | var params = { | ||
1234 | selectText: "MIX - MIX", | ||
1235 | firstAddress: "0x98BC5e63aeb6A4e82d72850d20710F07E29A29F1", | ||
1236 | }; | ||
1237 | testNetwork(done, params); | ||
1238 | }); | ||
1239 | it('Allows selection of Musicoin', function(done) { | ||
1240 | var params = { | ||
1241 | selectText: "MUSIC - Musicoin", | ||
1242 | firstAddress: "0xDc060e4A0b0313ea83Cf6B3A39B9db2D29004897", | ||
1243 | }; | ||
1244 | testNetwork(done, params); | ||
1245 | }); | ||
1246 | it('Allows selection of Poa', function(done) { | ||
1247 | var params = { | ||
1248 | selectText: "POA - Poa", | ||
1249 | firstAddress: "0x53aF28d754e106210C3d0467Dd581eaf7e3C5e60", | ||
1250 | }; | ||
1251 | testNetwork(done, params); | ||
1252 | }); | ||
1253 | it('Allows selection of Expanse', function(done) { | ||
1254 | var params = { | ||
1255 | selectText: "EXP - Expanse", | ||
1256 | firstAddress: "0xf57FeAbf26582b6E3E666559d3B1Cc6fB2b2c5F6", | ||
1257 | }; | ||
1258 | testNetwork(done, params); | ||
1259 | }); | ||
1260 | it('Allows selection of Callisto', function(done) { | ||
1261 | var params = { | ||
1262 | selectText: "CLO - Callisto", | ||
1263 | firstAddress: "0x4f9364F7420B317266C51Dc8eB979717D4dE3f4E", | ||
1264 | }; | ||
1265 | testNetwork(done, params); | ||
1266 | }); | ||
1218 | 1267 | ||
1219 | 1268 | ||
1220 | // BIP39 seed is set from phrase | 1269 | // BIP39 seed is set from phrase |