diff options
author | yurykk <yurykk@gmail.com> | 2019-06-27 11:56:47 +0300 |
---|---|---|
committer | yurykk <yurykk@gmail.com> | 2019-06-27 11:56:47 +0300 |
commit | 82e3938afe3e76000b58e6a49e204ffff10fbd5a (patch) | |
tree | 648ccef60bfa96c3196c4726470e8c8bd0ef3146 | |
parent | 06cd4e7608f88a5b43d5e783fd1dc51650e190a1 (diff) | |
download | BIP39-82e3938afe3e76000b58e6a49e204ffff10fbd5a.tar.gz BIP39-82e3938afe3e76000b58e6a49e204ffff10fbd5a.tar.zst BIP39-82e3938afe3e76000b58e6a49e204ffff10fbd5a.zip |
Adding TWINS coin support
-rw-r--r-- | src/js/bitcoinjs-extensions.js | 22 | ||||
-rw-r--r-- | src/js/index.js | 16 | ||||
-rw-r--r-- | tests/spec/tests.js | 14 |
3 files changed, 51 insertions, 1 deletions
diff --git a/src/js/bitcoinjs-extensions.js b/src/js/bitcoinjs-extensions.js index f7e708b..4e05482 100644 --- a/src/js/bitcoinjs-extensions.js +++ b/src/js/bitcoinjs-extensions.js | |||
@@ -1253,6 +1253,28 @@ bitcoinjs.bitcoin.networks.toa = { | |||
1253 | wif: 0xc1, | 1253 | wif: 0xc1, |
1254 | }; | 1254 | }; |
1255 | 1255 | ||
1256 | bitcoinjs.bitcoin.networks.twins = { | ||
1257 | messagePrefix: 'unused', | ||
1258 | bip32: { | ||
1259 | public: 0x022d2533, | ||
1260 | private: 0x0221312b | ||
1261 | }, | ||
1262 | pubKeyHash: 0x49, | ||
1263 | scriptHash: 0x53, | ||
1264 | wif: 0x42 | ||
1265 | }; | ||
1266 | |||
1267 | bitcoinjs.bitcoin.networks.twinstestnet = { | ||
1268 | messagePrefix: 'unused', | ||
1269 | bip32: { | ||
1270 | public: 0x3a8061a0, | ||
1271 | private: 0x3a805837 | ||
1272 | }, | ||
1273 | pubKeyHash: 0x4c, | ||
1274 | scriptHash: 0x89, | ||
1275 | wif: 0xED | ||
1276 | }; | ||
1277 | |||
1256 | bitcoinjs.bitcoin.networks.ultimatesecurecash = { | 1278 | bitcoinjs.bitcoin.networks.ultimatesecurecash = { |
1257 | messagePrefix: '\x18UltimateSecureCash Signed Message:\n', | 1279 | messagePrefix: '\x18UltimateSecureCash Signed Message:\n', |
1258 | bip32: { | 1280 | bip32: { |
diff --git a/src/js/index.js b/src/js/index.js index 56f42d4..8242da4 100644 --- a/src/js/index.js +++ b/src/js/index.js | |||
@@ -990,7 +990,7 @@ | |||
990 | pubkey = eosUtil.bufferToPublic(keyPair.getPublicKeyBuffer()); | 990 | pubkey = eosUtil.bufferToPublic(keyPair.getPublicKeyBuffer()); |
991 | privkey = eosUtil.bufferToPrivate(keyPair.d.toBuffer(32)); | 991 | privkey = eosUtil.bufferToPrivate(keyPair.d.toBuffer(32)); |
992 | } | 992 | } |
993 | 993 | ||
994 | addAddressToList(indexText, address, pubkey, privkey); | 994 | addAddressToList(indexText, address, pubkey, privkey); |
995 | if (isLast) { | 995 | if (isLast) { |
996 | hidePending(); | 996 | hidePending(); |
@@ -2637,6 +2637,20 @@ | |||
2637 | }, | 2637 | }, |
2638 | }, | 2638 | }, |
2639 | { | 2639 | { |
2640 | name: "TWINS - TWINS", | ||
2641 | onSelect: function() { | ||
2642 | network = bitcoinjs.bitcoin.networks.twins; | ||
2643 | setHdCoin(970); | ||
2644 | }, | ||
2645 | }, | ||
2646 | { | ||
2647 | name: "TWINS - TWINS Testnet", | ||
2648 | onSelect: function() { | ||
2649 | network = bitcoinjs.bitcoin.networks.twinstestnet; | ||
2650 | setHdCoin(1); | ||
2651 | }, | ||
2652 | }, | ||
2653 | { | ||
2640 | name: "USC - Ultimatesecurecash", | 2654 | name: "USC - Ultimatesecurecash", |
2641 | onSelect: function() { | 2655 | onSelect: function() { |
2642 | network = bitcoinjs.bitcoin.networks.ultimatesecurecash; | 2656 | network = bitcoinjs.bitcoin.networks.ultimatesecurecash; |
diff --git a/tests/spec/tests.js b/tests/spec/tests.js index 90cdc7a..c92689a 100644 --- a/tests/spec/tests.js +++ b/tests/spec/tests.js | |||
@@ -1242,6 +1242,20 @@ it('Allows selection of Toa', function(done) { | |||
1242 | }; | 1242 | }; |
1243 | testNetwork(done, params); | 1243 | testNetwork(done, params); |
1244 | }); | 1244 | }); |
1245 | it('Allows selection of TWINS', function(done) { | ||
1246 | var params = { | ||
1247 | selectText: "TWINS - TWINS", | ||
1248 | firstAddress: "WPpJnfLLubNmF7HLNxg8d8zH5haxn4wri8", | ||
1249 | }; | ||
1250 | testNetwork(done, params); | ||
1251 | }); | ||
1252 | it('Allows selection of TWINS testnet', function(done) { | ||
1253 | var params = { | ||
1254 | selectText: "TWINS - TWINS Testnet", | ||
1255 | firstAddress: "XpnU1HHdNG5YxvG9Rez4wjmidchxqnZaNa", | ||
1256 | }; | ||
1257 | testNetwork(done, params); | ||
1258 | }); | ||
1245 | it('Allows selection of Ultimatesecurecash', function(done) { | 1259 | it('Allows selection of Ultimatesecurecash', function(done) { |
1246 | var params = { | 1260 | var params = { |
1247 | selectText: "USC - Ultimatesecurecash", | 1261 | selectText: "USC - Ultimatesecurecash", |