diff options
author | Min Khang Aung <minkcrypto@gmail.com> | 2019-07-17 05:02:28 +0900 |
---|---|---|
committer | Min Khang Aung <minkcrypto@gmail.com> | 2019-07-17 05:02:28 +0900 |
commit | 519e9dc728f03eab31c8b050f174119a1dcccd59 (patch) | |
tree | a1b17cb3d509cd27145bf9af2acef5d3b35b9503 | |
parent | c4f4208b95cf6fb85a8d669c0c8dcdb8b12bb2e7 (diff) | |
download | BIP39-519e9dc728f03eab31c8b050f174119a1dcccd59.tar.gz BIP39-519e9dc728f03eab31c8b050f174119a1dcccd59.tar.zst BIP39-519e9dc728f03eab31c8b050f174119a1dcccd59.zip |
Add CPUchain support
-rw-r--r-- | src/js/bitcoinjs-extensions.js | 11 | ||||
-rw-r--r-- | src/js/index.js | 7 | ||||
-rw-r--r-- | src/js/segwit-parameters.js | 26 | ||||
-rw-r--r-- | tests/spec/tests.js | 7 |
4 files changed, 51 insertions, 0 deletions
diff --git a/src/js/bitcoinjs-extensions.js b/src/js/bitcoinjs-extensions.js index 2443829..21a535a 100644 --- a/src/js/bitcoinjs-extensions.js +++ b/src/js/bitcoinjs-extensions.js | |||
@@ -1615,3 +1615,14 @@ bitcoinjs.bitcoin.networks.deeponion = { | |||
1615 | scriptHash: 0x4E, | 1615 | scriptHash: 0x4E, |
1616 | wif: 0x9F, | 1616 | wif: 0x9F, |
1617 | }; | 1617 | }; |
1618 | |||
1619 | bitcoinjs.bitcoin.networks.cpuchain = { | ||
1620 | messagePrefix: 'x18CPUchain Signed Message:\n', | ||
1621 | bip32: { | ||
1622 | public: 0x0488B21E, | ||
1623 | private: 0x0488ADE4, | ||
1624 | }, | ||
1625 | pubKeyHash: 0x1C, | ||
1626 | scriptHash: 0x1E, | ||
1627 | wif: 0x80, | ||
1628 | }; | ||
diff --git a/src/js/index.js b/src/js/index.js index 52b0db5..704d4e0 100644 --- a/src/js/index.js +++ b/src/js/index.js | |||
@@ -1903,6 +1903,13 @@ | |||
1903 | }, | 1903 | }, |
1904 | }, | 1904 | }, |
1905 | { | 1905 | { |
1906 | name: "CPU - CPUchain", | ||
1907 | onSelect: function() { | ||
1908 | network = bitcoinjs.bitcoin.networks.cpuchain; | ||
1909 | setHdCoin(363); | ||
1910 | }, | ||
1911 | }, | ||
1912 | { | ||
1906 | name: "CRAVE - Crave", | 1913 | name: "CRAVE - Crave", |
1907 | onSelect: function() { | 1914 | onSelect: function() { |
1908 | network = bitcoinjs.bitcoin.networks.crave; | 1915 | network = bitcoinjs.bitcoin.networks.crave; |
diff --git a/src/js/segwit-parameters.js b/src/js/segwit-parameters.js index b2c72c2..aab7df0 100644 --- a/src/js/segwit-parameters.js +++ b/src/js/segwit-parameters.js | |||
@@ -236,4 +236,30 @@ bitcoinjs.bitcoin.networks.nix.p2wpkhInP2sh = { | |||
236 | scriptHash: 0x35, | 236 | scriptHash: 0x35, |
237 | wif: 0x80, | 237 | wif: 0x80, |
238 | }; | 238 | }; |
239 | |||
240 | bitcoinjs.bitcoin.networks.cpuchain.p2wpkh = { | ||
241 | baseNetwork: "cpuchain", | ||
242 | messagePrefix: '\x1DCPUchain Signed Message:\n', | ||
243 | bech32: 'cpu', | ||
244 | bip32: { | ||
245 | public: 0x04b24746, | ||
246 | private: 0x04b2430c | ||
247 | }, | ||
248 | pubKeyHash: 0x1c, | ||
249 | scriptHash: 0x1e, | ||
250 | wif: 0x80, | ||
251 | }; | ||
252 | |||
253 | bitcoinjs.bitcoin.networks.cpuchain.p2wpkhInP2sh = { | ||
254 | baseNetwork: "cpuchain", | ||
255 | messagePrefix: '\x1DCPUchain Signed Message:\n', | ||
256 | bech32: 'cpu', | ||
257 | bip32: { | ||
258 | public: 0x049d7cb2, | ||
259 | private: 0x049d7878 | ||
260 | }, | ||
261 | pubKeyHash: 0x1c, | ||
262 | scriptHash: 0x1e, | ||
263 | wif: 0x80, | ||
264 | }; | ||
239 | })(); | 265 | })(); |
diff --git a/tests/spec/tests.js b/tests/spec/tests.js index dd90a66..f307312 100644 --- a/tests/spec/tests.js +++ b/tests/spec/tests.js | |||
@@ -829,6 +829,13 @@ it('Allows selection of Compcoin', function(done) { | |||
829 | }; | 829 | }; |
830 | testNetwork(done, params); | 830 | testNetwork(done, params); |
831 | }); | 831 | }); |
832 | it('Allows selection of CPUchain', function(done) { | ||
833 | var params = { | ||
834 | selectText: "CPU - CPUchain", | ||
835 | firstAddress: "CWWkTPkNRdpTDSfPw7gxUt9cEaC5PSsP3Y", | ||
836 | }; | ||
837 | testNetwork(done, params); | ||
838 | }); | ||
832 | it('Allows selection of Crave', function(done) { | 839 | it('Allows selection of Crave', function(done) { |
833 | var params = { | 840 | var params = { |
834 | selectText: "CRAVE - Crave", | 841 | selectText: "CRAVE - Crave", |