Add CPUchain support
authorMin Khang Aung <minkcrypto@gmail.com>
Tue, 16 Jul 2019 20:02:28 +0000 (05:02 +0900)
committerMin Khang Aung <minkcrypto@gmail.com>
Tue, 16 Jul 2019 20:02:28 +0000 (05:02 +0900)
src/js/bitcoinjs-extensions.js
src/js/index.js
src/js/segwit-parameters.js
tests/spec/tests.js

index 24438297fbc9dff88760cad717205d08a507b72d..21a535acc4577bcba28f02562cdb567e39fa5fb5 100644 (file)
@@ -1615,3 +1615,14 @@ bitcoinjs.bitcoin.networks.deeponion = {
     scriptHash: 0x4E,
     wif: 0x9F,
 };
+
+bitcoinjs.bitcoin.networks.cpuchain = {
+    messagePrefix: 'x18CPUchain Signed Message:\n',
+    bip32: {
+      public: 0x0488B21E,
+      private: 0x0488ADE4,
+    },
+    pubKeyHash: 0x1C,
+    scriptHash: 0x1E,
+    wif: 0x80,
+};
index 52b0db5d86f4f8ba3ea49dceaaaae6e5f6cbcc0c..704d4e00514138e0f9b71f44419e2e7f58151329 100644 (file)
                 setHdCoin(71);
             },
         },
+        {
+            name: "CPU - CPUchain",
+            onSelect: function() {
+                network = bitcoinjs.bitcoin.networks.cpuchain;
+                setHdCoin(363);
+            },
+        },
         {
             name: "CRAVE - Crave",
             onSelect: function() {
index b2c72c27af0c3646f3b52644ecbdc96e733ae43c..aab7df031cd8a18c616cbc2bd7861312601b82e1 100644 (file)
@@ -236,4 +236,30 @@ bitcoinjs.bitcoin.networks.nix.p2wpkhInP2sh = {
       scriptHash: 0x35,
       wif: 0x80,
 };
+
+bitcoinjs.bitcoin.networks.cpuchain.p2wpkh = {
+    baseNetwork: "cpuchain",
+    messagePrefix: '\x1DCPUchain Signed Message:\n',
+    bech32: 'cpu',
+    bip32: {
+        public: 0x04b24746,
+        private: 0x04b2430c
+    },
+    pubKeyHash: 0x1c,
+    scriptHash: 0x1e,
+    wif: 0x80,
+};
+
+bitcoinjs.bitcoin.networks.cpuchain.p2wpkhInP2sh = {
+    baseNetwork: "cpuchain",
+    messagePrefix: '\x1DCPUchain Signed Message:\n',
+    bech32: 'cpu',
+    bip32: {
+        public: 0x049d7cb2,
+        private: 0x049d7878
+    },
+    pubKeyHash: 0x1c,
+    scriptHash: 0x1e,
+    wif: 0x80,
+};
 })();
index dd90a667fc57bdbe642f7eb1bcc5174ec89f66c2..f3073129466409578491a840dcbaedcca49605ca 100644 (file)
@@ -829,6 +829,13 @@ it('Allows selection of Compcoin', function(done) {
     };
     testNetwork(done, params);
 });
+it('Allows selection of CPUchain', function(done) {
+    var params = {
+        selectText: "CPU - CPUchain",
+        firstAddress: "CWWkTPkNRdpTDSfPw7gxUt9cEaC5PSsP3Y",
+    };
+    testNetwork(done, params);
+});
 it('Allows selection of Crave', function(done) {
     var params = {
         selectText: "CRAVE - Crave",