diff options
-rw-r--r-- | src/js/index.js | 88 | ||||
-rw-r--r-- | tests/spec/tests.js | 49 |
2 files changed, 128 insertions, 9 deletions
diff --git a/src/js/index.js b/src/js/index.js index 567a3f7..7d04a05 100644 --- a/src/js/index.js +++ b/src/js/index.js | |||
@@ -836,7 +836,14 @@ | |||
836 | indexText = indexText + "'"; | 836 | indexText = indexText + "'"; |
837 | } | 837 | } |
838 | // Ethereum values are different | 838 | // Ethereum values are different |
839 | if (networks[DOM.network.val()].name == "ETH - Ethereum") { | 839 | if ((networks[DOM.network.val()].name == "ETH - Ethereum") |
840 | || (networks[DOM.network.val()].name == "ETC - Ethereum Classic") | ||
841 | || (networks[DOM.network.val()].name == "PIRL - Pirl") | ||
842 | || (networks[DOM.network.val()].name == "MIX - MIX") | ||
843 | || (networks[DOM.network.val()].name == "MUSIC - Musicoin") | ||
844 | || (networks[DOM.network.val()].name == "POA - Poa") | ||
845 | || (networks[DOM.network.val()].name == "EXP - Expanse") | ||
846 | || (networks[DOM.network.val()].name == "CLO - Callisto")) { | ||
840 | var privKeyBuffer = keyPair.d.toBuffer(32); | 847 | var privKeyBuffer = keyPair.d.toBuffer(32); |
841 | privkey = privKeyBuffer.toString('hex'); | 848 | privkey = privKeyBuffer.toString('hex'); |
842 | var addressBuffer = ethUtil.privateToAddress(privKeyBuffer); | 849 | var addressBuffer = ethUtil.privateToAddress(privKeyBuffer); |
@@ -1703,6 +1710,14 @@ | |||
1703 | }, | 1710 | }, |
1704 | }, | 1711 | }, |
1705 | { | 1712 | { |
1713 | name: "CLO - Callisto", | ||
1714 | segwitAvailable: false, | ||
1715 | onSelect: function() { | ||
1716 | network = bitcoinjs.bitcoin.networks.bitcoin; | ||
1717 | setHdCoin(820); | ||
1718 | }, | ||
1719 | }, | ||
1720 | { | ||
1706 | name: "CLUB - Clubcoin", | 1721 | name: "CLUB - Clubcoin", |
1707 | segwitAvailable: false, | 1722 | segwitAvailable: false, |
1708 | onSelect: function() { | 1723 | onSelect: function() { |
@@ -1839,6 +1854,14 @@ | |||
1839 | }, | 1854 | }, |
1840 | }, | 1855 | }, |
1841 | { | 1856 | { |
1857 | name: "ETC - Ethereum Classic", | ||
1858 | segwitAvailable: false, | ||
1859 | onSelect: function() { | ||
1860 | network = bitcoinjs.bitcoin.networks.bitcoin; | ||
1861 | setHdCoin(61); | ||
1862 | }, | ||
1863 | }, | ||
1864 | { | ||
1842 | name: "ETH - Ethereum", | 1865 | name: "ETH - Ethereum", |
1843 | segwitAvailable: false, | 1866 | segwitAvailable: false, |
1844 | onSelect: function() { | 1867 | onSelect: function() { |
@@ -1855,6 +1878,14 @@ | |||
1855 | }, | 1878 | }, |
1856 | }, | 1879 | }, |
1857 | { | 1880 | { |
1881 | name: "EXP - Expanse", | ||
1882 | segwitAvailable: false, | ||
1883 | onSelect: function() { | ||
1884 | network = bitcoinjs.bitcoin.networks.bitcoin; | ||
1885 | setHdCoin(40); | ||
1886 | }, | ||
1887 | }, | ||
1888 | { | ||
1858 | name: "FJC - Fujicoin", | 1889 | name: "FJC - Fujicoin", |
1859 | segwitAvailable: true, | 1890 | segwitAvailable: true, |
1860 | onSelect: function() { | 1891 | onSelect: function() { |
@@ -2032,6 +2063,14 @@ | |||
2032 | }, | 2063 | }, |
2033 | }, | 2064 | }, |
2034 | { | 2065 | { |
2066 | name: "MIX - MIX", | ||
2067 | segwitAvailable: false, | ||
2068 | onSelect: function() { | ||
2069 | network = bitcoinjs.bitcoin.networks.bitcoin; | ||
2070 | setHdCoin(76); | ||
2071 | }, | ||
2072 | }, | ||
2073 | { | ||
2035 | name: "MNX - Minexcoin", | 2074 | name: "MNX - Minexcoin", |
2036 | segwitAvailable: true, | 2075 | segwitAvailable: true, |
2037 | onSelect: function() { | 2076 | onSelect: function() { |
@@ -2048,6 +2087,14 @@ | |||
2048 | }, | 2087 | }, |
2049 | }, | 2088 | }, |
2050 | { | 2089 | { |
2090 | name: "MUSIC - Musicoin", | ||
2091 | segwitAvailable: false, | ||
2092 | onSelect: function() { | ||
2093 | network = bitcoinjs.bitcoin.networks.bitcoin; | ||
2094 | setHdCoin(184); | ||
2095 | }, | ||
2096 | }, | ||
2097 | { | ||
2051 | name: "NAV - Navcoin", | 2098 | name: "NAV - Navcoin", |
2052 | segwitAvailable: true, | 2099 | segwitAvailable: true, |
2053 | onSelect: function() { | 2100 | onSelect: function() { |
@@ -2160,6 +2207,14 @@ | |||
2160 | }, | 2207 | }, |
2161 | }, | 2208 | }, |
2162 | { | 2209 | { |
2210 | name: "PIRL - Pirl", | ||
2211 | segwitAvailable: false, | ||
2212 | onSelect: function() { | ||
2213 | network = bitcoinjs.bitcoin.networks.bitcoin; | ||
2214 | setHdCoin(164); | ||
2215 | }, | ||
2216 | }, | ||
2217 | { | ||
2163 | name: "PIVX - PIVX", | 2218 | name: "PIVX - PIVX", |
2164 | segwitAvailable: false, | 2219 | segwitAvailable: false, |
2165 | onSelect: function() { | 2220 | onSelect: function() { |
@@ -2176,6 +2231,14 @@ | |||
2176 | }, | 2231 | }, |
2177 | }, | 2232 | }, |
2178 | { | 2233 | { |
2234 | name: "POA - Poa", | ||
2235 | segwitAvailable: false, | ||
2236 | onSelect: function() { | ||
2237 | network = bitcoinjs.bitcoin.networks.bitcoin; | ||
2238 | setHdCoin(178); | ||
2239 | }, | ||
2240 | }, | ||
2241 | { | ||
2179 | name: "POSW - POSWcoin", | 2242 | name: "POSW - POSWcoin", |
2180 | segwitAvailable: false, | 2243 | segwitAvailable: false, |
2181 | onSelect: function() { | 2244 | onSelect: function() { |
@@ -2432,6 +2495,14 @@ | |||
2432 | }, | 2495 | }, |
2433 | }, | 2496 | }, |
2434 | { | 2497 | { |
2498 | name: "XUEZ - Xuez", | ||
2499 | segwitAvailable: false, | ||
2500 | onSelect: function() { | ||
2501 | network = bitcoinjs.bitcoin.networks.xuez; | ||
2502 | setHdCoin(225); | ||
2503 | }, | ||
2504 | }, | ||
2505 | { | ||
2435 | name: "XWC - Whitecoin", | 2506 | name: "XWC - Whitecoin", |
2436 | segwitAvailable: false, | 2507 | segwitAvailable: false, |
2437 | onSelect: function() { | 2508 | onSelect: function() { |
@@ -2464,14 +2535,6 @@ | |||
2464 | }, | 2535 | }, |
2465 | }, | 2536 | }, |
2466 | { | 2537 | { |
2467 | name: "XUEZ - Xuez", | ||
2468 | segwitAvailable: false, | ||
2469 | onSelect: function() { | ||
2470 | network = bitcoinjs.bitcoin.networks.xuez; | ||
2471 | setHdCoin(225); | ||
2472 | }, | ||
2473 | }, | ||
2474 | { | ||
2475 | name: "ZEN - Zencash", | 2538 | name: "ZEN - Zencash", |
2476 | segwitAvailable: false, | 2539 | segwitAvailable: false, |
2477 | onSelect: function() { | 2540 | onSelect: function() { |
@@ -2502,6 +2565,13 @@ | |||
2502 | DOM.bip32path.val("m/0'/0"); | 2565 | DOM.bip32path.val("m/0'/0"); |
2503 | DOM.hardenedAddresses.prop('checked', false); | 2566 | DOM.hardenedAddresses.prop('checked', false); |
2504 | }, | 2567 | }, |
2568 | }, | ||
2569 | { | ||
2570 | name: "Coinomi, Ledger", | ||
2571 | onSelect: function() { | ||
2572 | DOM.bip32path.val("m/44'/"+DOM.bip44coin.val()+"'/0'"); | ||
2573 | DOM.hardenedAddresses.prop('checked', false); | ||
2574 | }, | ||
2505 | } | 2575 | } |
2506 | ] | 2576 | ] |
2507 | 2577 | ||
diff --git a/tests/spec/tests.js b/tests/spec/tests.js index 94fc672..250a720 100644 --- a/tests/spec/tests.js +++ b/tests/spec/tests.js | |||
@@ -1208,6 +1208,55 @@ it('Allows selection of Energi', function(done) { | |||
1208 | }; | 1208 | }; |
1209 | testNetwork(done, params); | 1209 | testNetwork(done, params); |
1210 | }); | 1210 | }); |
1211 | it('Allows selection of Ethereum Classic', function(done) { | ||
1212 | var params = { | ||
1213 | selectText: "ETC - Ethereum Classic", | ||
1214 | firstAddress: "0x3c05e5556693808367afB62eF3b63e35d6eD249A", | ||
1215 | }; | ||
1216 | testNetwork(done, params); | ||
1217 | }); | ||
1218 | it('Allows selection of Pirl', function(done) { | ||
1219 | var params = { | ||
1220 | selectText: "PIRL - Pirl", | ||
1221 | firstAddress: "0xe77FC0723dA122B5025CA79193c28563eB47e776", | ||
1222 | }; | ||
1223 | testNetwork(done, params); | ||
1224 | }); | ||
1225 | it('Allows selection of MIX', function(done) { | ||
1226 | var params = { | ||
1227 | selectText: "MIX - MIX", | ||
1228 | firstAddress: "0x98BC5e63aeb6A4e82d72850d20710F07E29A29F1", | ||
1229 | }; | ||
1230 | testNetwork(done, params); | ||
1231 | }); | ||
1232 | it('Allows selection of Musicoin', function(done) { | ||
1233 | var params = { | ||
1234 | selectText: "MUSIC - Musicoin", | ||
1235 | firstAddress: "0xDc060e4A0b0313ea83Cf6B3A39B9db2D29004897", | ||
1236 | }; | ||
1237 | testNetwork(done, params); | ||
1238 | }); | ||
1239 | it('Allows selection of Poa', function(done) { | ||
1240 | var params = { | ||
1241 | selectText: "POA - Poa", | ||
1242 | firstAddress: "0x53aF28d754e106210C3d0467Dd581eaf7e3C5e60", | ||
1243 | }; | ||
1244 | testNetwork(done, params); | ||
1245 | }); | ||
1246 | it('Allows selection of Expanse', function(done) { | ||
1247 | var params = { | ||
1248 | selectText: "EXP - Expanse", | ||
1249 | firstAddress: "0xf57FeAbf26582b6E3E666559d3B1Cc6fB2b2c5F6", | ||
1250 | }; | ||
1251 | testNetwork(done, params); | ||
1252 | }); | ||
1253 | it('Allows selection of Callisto', function(done) { | ||
1254 | var params = { | ||
1255 | selectText: "CLO - Callisto", | ||
1256 | firstAddress: "0x4f9364F7420B317266C51Dc8eB979717D4dE3f4E", | ||
1257 | }; | ||
1258 | testNetwork(done, params); | ||
1259 | }); | ||
1211 | 1260 | ||
1212 | 1261 | ||
1213 | // BIP39 seed is set from phrase | 1262 | // BIP39 seed is set from phrase |