diff options
author | iancoleman <1281387+iancoleman@users.noreply.github.com> | 2018-05-15 09:00:29 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-15 09:00:29 +1000 |
commit | 35d9e9fddc6b49b9250777e2901652218a270919 (patch) | |
tree | 3f5bfbf0549f449cc5a2c1ada564f263bc9275df | |
parent | f62138da711d22d9267892cb2a9f63862ee61b5b (diff) | |
parent | 1e2cc748b083c7a172c20ddc574c2aa1c2d8c5f2 (diff) | |
download | BIP39-35d9e9fddc6b49b9250777e2901652218a270919.tar.gz BIP39-35d9e9fddc6b49b9250777e2901652218a270919.tar.zst BIP39-35d9e9fddc6b49b9250777e2901652218a270919.zip |
Merge pull request #215 from Coinomi/coinomi
Add BTCP, BTCZ, ZCL, ZEN
-rw-r--r-- | src/js/bitcoinjs-extensions.js | 55 | ||||
-rw-r--r-- | src/js/index.js | 40 | ||||
-rw-r--r-- | tests/spec/tests.js | 35 |
3 files changed, 130 insertions, 0 deletions
diff --git a/src/js/bitcoinjs-extensions.js b/src/js/bitcoinjs-extensions.js index 9047874..d44ca0d 100644 --- a/src/js/bitcoinjs-extensions.js +++ b/src/js/bitcoinjs-extensions.js | |||
@@ -1210,3 +1210,58 @@ bitcoinjs.bitcoin.networks.xuez = { | |||
1210 | scriptHash: 0x12, | 1210 | scriptHash: 0x12, |
1211 | wif: 0xd4 | 1211 | wif: 0xd4 |
1212 | }; | 1212 | }; |
1213 | |||
1214 | bitcoinjs.bitcoin.networks.bitcoinprivate = { | ||
1215 | messagePrefix: '\x18BitcoinPrivate Signed Message:\n', | ||
1216 | bip32: { | ||
1217 | public: 0x0488B21E, | ||
1218 | private: 0x0488ADE4, | ||
1219 | }, | ||
1220 | pubKeyHash: 0x1325, | ||
1221 | scriptHash: 0x13AF, | ||
1222 | wif: 0x80, | ||
1223 | }; | ||
1224 | |||
1225 | bitcoinjs.bitcoin.networks.bitcoinz = { | ||
1226 | messagePrefix: '\x18BitcoinZ Signed Message:\n', | ||
1227 | bip32: { | ||
1228 | public: 0x0488B21E, | ||
1229 | private: 0x0488ADE4, | ||
1230 | }, | ||
1231 | pubKeyHash: 0x1CB8, | ||
1232 | scriptHash: 0x1CBD, | ||
1233 | wif: 0x80, | ||
1234 | }; | ||
1235 | |||
1236 | bitcoinjs.bitcoin.networks.zclassic = { | ||
1237 | messagePrefix: '\x18Zcash Signed Message:\n', | ||
1238 | bip32: { | ||
1239 | public: 0x0488B21E, | ||
1240 | private: 0x0488ADE4, | ||
1241 | }, | ||
1242 | pubKeyHash: 0x1CB8, | ||
1243 | scriptHash: 0x1CBD, | ||
1244 | wif: 0x80, | ||
1245 | }; | ||
1246 | |||
1247 | bitcoinjs.bitcoin.networks.zencash = { | ||
1248 | messagePrefix: '\x18Zcash Signed Message:\n', | ||
1249 | bip32: { | ||
1250 | public: 0x0488B21E, | ||
1251 | private: 0x0488ADE4, | ||
1252 | }, | ||
1253 | pubKeyHash: 0x2089, | ||
1254 | scriptHash: 0x2096, | ||
1255 | wif: 0x80, | ||
1256 | }; | ||
1257 | |||
1258 | bitcoinjs.bitcoin.networks.energi = { | ||
1259 | messagePrefix: 'DarkCoin Signed Message:\n', | ||
1260 | bip32: { | ||
1261 | public: 0x03B8C856, | ||
1262 | private: 0xD7DC6E9F, | ||
1263 | }, | ||
1264 | pubKeyHash: 0x21, | ||
1265 | scriptHash: 0x35, | ||
1266 | wif: 0x6a, | ||
1267 | }; \ No newline at end of file | ||
diff --git a/src/js/index.js b/src/js/index.js index 9d34563..567a3f7 100644 --- a/src/js/index.js +++ b/src/js/index.js | |||
@@ -1647,6 +1647,22 @@ | |||
1647 | }, | 1647 | }, |
1648 | }, | 1648 | }, |
1649 | { | 1649 | { |
1650 | name: "BTCP - Bitcoin Private", | ||
1651 | segwitAvailable: true, | ||
1652 | onSelect: function() { | ||
1653 | network = bitcoinjs.bitcoin.networks.bitcoinprivate; | ||
1654 | setHdCoin(183); | ||
1655 | }, | ||
1656 | }, | ||
1657 | { | ||
1658 | name: "BTCZ - Bitcoinz", | ||
1659 | segwitAvailable: false, | ||
1660 | onSelect: function() { | ||
1661 | network = bitcoinjs.bitcoin.networks.bitcoinz; | ||
1662 | setHdCoin(177); | ||
1663 | }, | ||
1664 | }, | ||
1665 | { | ||
1650 | name: "BTG - Bitcoin Gold", | 1666 | name: "BTG - Bitcoin Gold", |
1651 | segwitAvailable: true, | 1667 | segwitAvailable: true, |
1652 | onSelect: function() { | 1668 | onSelect: function() { |
@@ -2072,6 +2088,14 @@ | |||
2072 | }, | 2088 | }, |
2073 | }, | 2089 | }, |
2074 | { | 2090 | { |
2091 | name: "NRG - Energi", | ||
2092 | segwitAvailable: false, | ||
2093 | onSelect: function() { | ||
2094 | network = bitcoinjs.bitcoin.networks.energi; | ||
2095 | setHdCoin(204); | ||
2096 | }, | ||
2097 | }, | ||
2098 | { | ||
2075 | name: "NRO - Neurocoin", | 2099 | name: "NRO - Neurocoin", |
2076 | segwitAvailable: false, | 2100 | segwitAvailable: false, |
2077 | onSelect: function() { | 2101 | onSelect: function() { |
@@ -2424,6 +2448,14 @@ | |||
2424 | }, | 2448 | }, |
2425 | }, | 2449 | }, |
2426 | { | 2450 | { |
2451 | name: "ZCL - Zclassic", | ||
2452 | segwitAvailable: false, | ||
2453 | onSelect: function() { | ||
2454 | network = bitcoinjs.bitcoin.networks.zclassic; | ||
2455 | setHdCoin(147); | ||
2456 | }, | ||
2457 | }, | ||
2458 | { | ||
2427 | name: "ZEC - Zcash", | 2459 | name: "ZEC - Zcash", |
2428 | segwitAvailable: false, | 2460 | segwitAvailable: false, |
2429 | onSelect: function() { | 2461 | onSelect: function() { |
@@ -2439,6 +2471,14 @@ | |||
2439 | setHdCoin(225); | 2471 | setHdCoin(225); |
2440 | }, | 2472 | }, |
2441 | }, | 2473 | }, |
2474 | { | ||
2475 | name: "ZEN - Zencash", | ||
2476 | segwitAvailable: false, | ||
2477 | onSelect: function() { | ||
2478 | network = bitcoinjs.bitcoin.networks.zencash; | ||
2479 | setHdCoin(121); | ||
2480 | }, | ||
2481 | }, | ||
2442 | ] | 2482 | ] |
2443 | 2483 | ||
2444 | var clients = [ | 2484 | var clients = [ |
diff --git a/tests/spec/tests.js b/tests/spec/tests.js index adaeb6c..94fc672 100644 --- a/tests/spec/tests.js +++ b/tests/spec/tests.js | |||
@@ -690,6 +690,20 @@ it('Allows selection of Bitcoinplus', function(done) { | |||
690 | }; | 690 | }; |
691 | testNetwork(done, params); | 691 | testNetwork(done, params); |
692 | }); | 692 | }); |
693 | it('Allows selection of Bitcoin Private', function(done) { | ||
694 | var params = { | ||
695 | selectText: "BTCP - Bitcoin Private", | ||
696 | firstAddress: "b1M3PbiXXyN6Hdivdw5rJv5VKpLjPzhm4jM", | ||
697 | }; | ||
698 | testNetwork(done, params); | ||
699 | }); | ||
700 | it('Allows selection of Bitcoinz', function(done) { | ||
701 | var params = { | ||
702 | selectText: "BTCZ - Bitcoinz", | ||
703 | firstAddress: "t1X2YQoxs8cYRo2oaBYgVEwW5QNjCC59NYc", | ||
704 | }; | ||
705 | testNetwork(done, params); | ||
706 | }); | ||
693 | it('Allows selection of Bitcore', function(done) { | 707 | it('Allows selection of Bitcore', function(done) { |
694 | var params = { | 708 | var params = { |
695 | selectText: "BTX - Bitcore", | 709 | selectText: "BTX - Bitcore", |
@@ -1173,6 +1187,27 @@ it('Allows selection of Zcash', function(done) { | |||
1173 | }; | 1187 | }; |
1174 | testNetwork(done, params); | 1188 | testNetwork(done, params); |
1175 | }); | 1189 | }); |
1190 | it('Allows selection of Zclassic', function(done) { | ||
1191 | var params = { | ||
1192 | selectText: "ZCL - Zclassic", | ||
1193 | firstAddress: "t1TBMxTvVJRybUbMLGWq8H4A8F4VUL7czEc", | ||
1194 | }; | ||
1195 | testNetwork(done, params); | ||
1196 | }); | ||
1197 | it('Allows selection of Zencash', function(done) { | ||
1198 | var params = { | ||
1199 | selectText: "ZEN - Zencash", | ||
1200 | firstAddress: "znWh9XASyW2dZq5tck84wFjiwuqVysi7q3p", | ||
1201 | }; | ||
1202 | testNetwork(done, params); | ||
1203 | }); | ||
1204 | it('Allows selection of Energi', function(done) { | ||
1205 | var params = { | ||
1206 | selectText: "NRG - Energi", | ||
1207 | firstAddress: "EejRy4t4nidzhGGzkJUgFP3z4HYBjhTsRt", | ||
1208 | }; | ||
1209 | testNetwork(done, params); | ||
1210 | }); | ||
1176 | 1211 | ||
1177 | 1212 | ||
1178 | // BIP39 seed is set from phrase | 1213 | // BIP39 seed is set from phrase |