]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/BIP39.git/commitdiff
Merge pull request #339 from NewCapital/master
authoriancoleman <1281387+iancoleman@users.noreply.github.com>
Thu, 4 Jul 2019 01:40:32 +0000 (11:40 +1000)
committerGitHub <noreply@github.com>
Thu, 4 Jul 2019 01:40:32 +0000 (11:40 +1000)
Adding support for TWINS and FIX coins

src/js/bitcoinjs-extensions.js
src/js/index.js
tests/spec/tests.js

index f7e708bf327691ef45240a4f2e401efadfaba659..bd3e50024f33d2aa59fbc2e0b6bd4ebd88ce8899 100644 (file)
@@ -327,6 +327,28 @@ bitcoinjs.bitcoin.networks.pivxtestnet = {
   wif: 0xef
 };
 
+bitcoinjs.bitcoin.networks.fix = {
+  messagePrefix: 'unused',
+  bip32: {
+    public: 0x022d2533,
+    private: 0x0221312b
+  },
+  pubKeyHash: 0x23,
+  scriptHash: 0x5F,
+  wif: 0x3C
+};
+
+bitcoinjs.bitcoin.networks.fixtestnet = {
+  messagePrefix: 'unused',
+  bip32: {
+    public: 0x3a8061a0,
+    private: 0x3a805837
+  },
+  pubKeyHash: 0x4c,
+  scriptHash: 0x89,
+  wif: 0xED
+};
+
 bitcoinjs.bitcoin.networks.fujicoin = {
   messagePrefix: '\x19FujiCoin Signed Message:\n',
   bip32: {
@@ -1253,6 +1275,28 @@ bitcoinjs.bitcoin.networks.toa = {
   wif: 0xc1,
 };
 
+bitcoinjs.bitcoin.networks.twins = {
+  messagePrefix: 'unused',
+  bip32: {
+    public: 0x022d2533,
+    private: 0x0221312b
+  },
+  pubKeyHash: 0x49,
+  scriptHash: 0x53,
+  wif: 0x42
+};
+
+bitcoinjs.bitcoin.networks.twinstestnet = {
+  messagePrefix: 'unused',
+  bip32: {
+    public: 0x3a8061a0,
+    private: 0x3a805837
+  },
+  pubKeyHash: 0x4c,
+  scriptHash: 0x89,
+  wif: 0xED
+};
+
 bitcoinjs.bitcoin.networks.ultimatesecurecash = {
   messagePrefix: '\x18UltimateSecureCash Signed Message:\n',
   bip32: {
index 599e8d11ad44197fff0adba2b3a840daf822a51b..8e6b10682df59f3d9b5163b2f38c8a8c8753ecca 100644 (file)
                     pubkey = eosUtil.bufferToPublic(keyPair.getPublicKeyBuffer());
                     privkey = eosUtil.bufferToPrivate(keyPair.d.toBuffer(32));
                 }
-                
+
                 addAddressToList(indexText, address, pubkey, privkey);
                 if (isLast) {
                     hidePending();
                 setHdCoin(40);
             },
         },
+        {
+            name: "FIX - FIX",
+            onSelect: function() {
+                network = bitcoinjs.bitcoin.networks.fix;
+                setHdCoin(336);
+            },
+        },
+        {
+            name: "FIX - FIX Testnet",
+            onSelect: function() {
+                network = bitcoinjs.bitcoin.networks.fixtestnet;
+                setHdCoin(1);
+            },
+        },
         {
             name: "FJC - Fujicoin",
             onSelect: function() {
                 setHdCoin(159);
             },
         },
+        {
+            name: "TWINS - TWINS",
+            onSelect: function() {
+                network = bitcoinjs.bitcoin.networks.twins;
+                setHdCoin(970);
+            },
+        },
+        {
+            name: "TWINS - TWINS Testnet",
+            onSelect: function() {
+                network = bitcoinjs.bitcoin.networks.twinstestnet;
+                setHdCoin(1);
+            },
+        },
         {
             name: "USC - Ultimatesecurecash",
             onSelect: function() {
index 90cdc7afd84a66031ab15ee33ed6112475a62d20..6e56ce0a5a219bf5ecbccd212c78d86e9c94c0ce 100644 (file)
@@ -640,6 +640,20 @@ it('Allows selection of maza', function(done) {
     };
     testNetwork(done, params);
 });
+it('Allows selection of FIX', function(done) {
+    var params = {
+        selectText: "FIX - FIX",
+        firstAddress: "FS5MEU8fs5dUvsaSCSusV8RQtC8j2h3JEh",
+    };
+    testNetwork(done, params);
+});
+it('Allows selection of FIX testnet', function(done) {
+    var params = {
+        selectText: "FIX - FIX Testnet",
+        firstAddress: "XpnU1HHdNG5YxvG9Rez4wjmidchxqnZaNa",
+    };
+    testNetwork(done, params);
+});
 it('Allows selection of fujicoin', function(done) {
     var params = {
         selectText: "FJC - Fujicoin",
@@ -1242,6 +1256,20 @@ it('Allows selection of Toa', function(done) {
     };
     testNetwork(done, params);
 });
+it('Allows selection of TWINS', function(done) {
+    var params = {
+        selectText: "TWINS - TWINS",
+        firstAddress: "WPpJnfLLubNmF7HLNxg8d8zH5haxn4wri8",
+    };
+    testNetwork(done, params);
+});
+it('Allows selection of TWINS testnet', function(done) {
+    var params = {
+        selectText: "TWINS - TWINS Testnet",
+        firstAddress: "XpnU1HHdNG5YxvG9Rez4wjmidchxqnZaNa",
+    };
+    testNetwork(done, params);
+});
 it('Allows selection of Ultimatesecurecash', function(done) {
     var params = {
         selectText: "USC - Ultimatesecurecash",