aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--changelog.md2
-rw-r--r--src/index.html2
-rw-r--r--src/js/bitcoinjs-extensions.js33
-rw-r--r--src/js/index.js21
-rw-r--r--src/js/segwit-parameters.js52
-rw-r--r--tests/spec/tests.js30
6 files changed, 139 insertions, 1 deletions
diff --git a/changelog.md b/changelog.md
index dc9842d..ab03e2a 100644
--- a/changelog.md
+++ b/changelog.md
@@ -1,3 +1,5 @@
1* Add Argoneum
2
1# 0.4.2 3# 0.4.2
2 4
3* Fix ethereum private key format 5* Fix ethereum private key format
diff --git a/src/index.html b/src/index.html
index 1184a0c..ae39c11 100644
--- a/src/index.html
+++ b/src/index.html
@@ -24,7 +24,7 @@
24 <div class="form-group"> 24 <div class="form-group">
25 <div class="col-sm-2"></div> 25 <div class="col-sm-2"></div>
26 <div class="col-sm-10"> 26 <div class="col-sm-10">
27 <p>You can enter an existing BIP39 mnemonic, or generate a new random one. Typing your own twelve words will probably not work how you expect, since the words require a particular structure (the last word is a checksum).</p> 27 <p>You can enter an existing BIP39 mnemonic, or generate a new random one. Typing your own twelve words will probably not work how you expect, since the words require a particular structure (the last word contains a checksum).</p>
28 <p> 28 <p>
29 For more info see the 29 For more info see the
30 <a href="https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki" target="_blank">BIP39 spec</a>. 30 <a href="https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki" target="_blank">BIP39 spec</a>.
diff --git a/src/js/bitcoinjs-extensions.js b/src/js/bitcoinjs-extensions.js
index 17475b1..2792e13 100644
--- a/src/js/bitcoinjs-extensions.js
+++ b/src/js/bitcoinjs-extensions.js
@@ -1739,6 +1739,28 @@ libs.bitcoin.networks.elastos = {
1739 wif: 0xef // TODO set this correctly, same as BTC for now 1739 wif: 0xef // TODO set this correctly, same as BTC for now
1740}; 1740};
1741 1741
1742libs.bitcoin.networks.sugarchain = {
1743 messagePrefix: '\x18Sugarchain Signed Message:\n',
1744 bip32: {
1745 public: 0x0488B21E,
1746 private: 0x0488ADE4,
1747 },
1748 pubKeyHash: 0x3f,
1749 scriptHash: 0x7d,
1750 wif: 0x80
1751};
1752
1753libs.bitcoin.networks.sugarchaintestnet = {
1754 messagePrefix: '\x18Sugarchain Signed Message:\n',
1755 bip32: {
1756 public: 0x045f1cf6,
1757 private: 0x045f18bc,
1758 },
1759 pubKeyHash: 0x42,
1760 scriptHash: 0x80,
1761 wif: 0xef
1762};
1763
1742// https://github.com/libs.bitcoinjs-lib/blob/3f6f5ef97a1ee1b8337865209282c0095e22b2e7/src/networks.js 1764// https://github.com/libs.bitcoinjs-lib/blob/3f6f5ef97a1ee1b8337865209282c0095e22b2e7/src/networks.js
1743libs.bitcoin.networks.regtest = { 1765libs.bitcoin.networks.regtest = {
1744 messagePrefix: '\x18Bitcoin Signed Message:\n', 1766 messagePrefix: '\x18Bitcoin Signed Message:\n',
@@ -1751,3 +1773,14 @@ libs.bitcoin.networks.regtest = {
1751 scriptHash: 0xc4, 1773 scriptHash: 0xc4,
1752 wif: 0xef, 1774 wif: 0xef,
1753}; 1775};
1776
1777libs.bitcoin.networks.argoneum = {
1778 messagePrefix: 'unused',
1779 bip32: {
1780 public: 0x0488b21e,
1781 private: 0x0488ade4
1782 },
1783 pubKeyHash: 0x32,
1784 scriptHash: 0x61,
1785 wif: 0xbf
1786};
diff --git a/src/js/index.js b/src/js/index.js
index eb914a8..32825b2 100644
--- a/src/js/index.js
+++ b/src/js/index.js
@@ -2036,6 +2036,13 @@
2036 }, 2036 },
2037 }, 2037 },
2038 { 2038 {
2039 name: "AGM - Argoneum",
2040 onSelect: function() {
2041 network = libs.bitcoin.networks.argoneum;
2042 setHdCoin(421);
2043 },
2044 },
2045 {
2039 name: "ARYA - Aryacoin", 2046 name: "ARYA - Aryacoin",
2040 onSelect: function() { 2047 onSelect: function() {
2041 network = libs.bitcoin.networks.aryacoin; 2048 network = libs.bitcoin.networks.aryacoin;
@@ -3103,6 +3110,20 @@
3103 }, 3110 },
3104 }, 3111 },
3105 { 3112 {
3113 name: "SUGAR - Sugarchain",
3114 onSelect: function() {
3115 network = libs.bitcoin.networks.sugarchain;
3116 setHdCoin(408);
3117 },
3118 },
3119 {
3120 name: "TUGAR - Sugarchain Testnet",
3121 onSelect: function() {
3122 network = libs.bitcoin.networks.sugarchaintestnet;
3123 setHdCoin(408);
3124 },
3125 },
3126 {
3106 name: "SWTC - Jingtum", 3127 name: "SWTC - Jingtum",
3107 onSelect: function() { 3128 onSelect: function() {
3108 network = libs.bitcoin.networks.bitcoin; 3129 network = libs.bitcoin.networks.bitcoin;
diff --git a/src/js/segwit-parameters.js b/src/js/segwit-parameters.js
index d5ea419..ea6f86e 100644
--- a/src/js/segwit-parameters.js
+++ b/src/js/segwit-parameters.js
@@ -683,4 +683,56 @@ libs.bitcoin.networks.deeponion.p2wpkhInP2sh = {
683 wif: 0x9f 683 wif: 0x9f
684}; 684};
685 685
686libs.bitcoin.networks.sugarchain.p2wpkh = {
687 baseNetwork: "sugarchain",
688 messagePrefix: '\x1DSugarchain Signed Message:\n',
689 bech32: 'sugar',
690 bip32: {
691 public: 0x04b24746,
692 private: 0x04b2430c
693 },
694 pubKeyHash: 0x3f,
695 scriptHash: 0x7d,
696 wif: 0x80
697};
698
699libs.bitcoin.networks.sugarchain.p2wpkhInP2sh = {
700 baseNetwork: "sugarchain",
701 messagePrefix: '\x1DSugarchain Signed Message:\n',
702 bech32: 'sugar',
703 bip32: {
704 public: 0x049d7cb2,
705 private: 0x049d7878
706 },
707 pubKeyHash: 0x3f,
708 scriptHash: 0x7d,
709 wif: 0x80
710};
711
712libs.bitcoin.networks.sugarchaintestnet.p2wpkh = {
713 baseNetwork: "sugarchaintestnet",
714 messagePrefix: '\x18Sugarchain Signed Message:\n',
715 bech32: 'tugar',
716 bip32: {
717 public: 0x045f1cf6,
718 private: 0x045f18bc
719 },
720 pubKeyHash: 0x42,
721 scriptHash: 0x80,
722 wif: 0xef
723};
724
725libs.bitcoin.networks.sugarchaintestnet.p2wpkhInP2sh = {
726 baseNetwork: "sugarchaintestnet",
727 messagePrefix: '\x18Sugarchain Signed Message:\n',
728 bech32: 'tugar',
729 bip32: {
730 public: 0x044a5262,
731 private: 0x044a4e28
732 },
733 pubKeyHash: 0x42,
734 scriptHash: 0x80,
735 wif: 0xef
736};
737
686})(); 738})();
diff --git a/tests/spec/tests.js b/tests/spec/tests.js
index 31fa043..15a52b3 100644
--- a/tests/spec/tests.js
+++ b/tests/spec/tests.js
@@ -1675,6 +1675,26 @@ it('Allows selection of Stratis Test', function(done) {
1675 }; 1675 };
1676 testNetwork(done, params); 1676 testNetwork(done, params);
1677}); 1677});
1678it('Allows selection of Sugarchain', function(done) {
1679 var params = {
1680 selectText: "SUGAR - Sugarchain",
1681 phrase: "abandon abandon ability",
1682 firstAddress: "SYnd31fYr39VgKju87Vz1sYBmEeHg5cudk",
1683 firstPubKey: "035bc9fa22eff2246ec07bb09c9e32f5f9fee517b4f49a8f117508f8fb41905b25",
1684 firstPrivKey: "L2G3axGdZv5EV8osAsBPMese74i4dTHaGvxDh7DsRF5Ky6hKkPDY",
1685 };
1686 testNetwork(done, params);
1687});
1688it('Allows selection of Sugarchain Testnet', function(done) {
1689 var params = {
1690 selectText: "TUGAR - Sugarchain Testnet",
1691 phrase: "abandon abandon ability",
1692 firstAddress: "TkoRzLZQyaY88dAACNVwUFMYekR7pv6CbY",
1693 firstPubKey: "035bc9fa22eff2246ec07bb09c9e32f5f9fee517b4f49a8f117508f8fb41905b25",
1694 firstPrivKey: "cSd33sGUzymVeaH8ZGzWiyNhjJ1UHuPGLy6goXgNvMjLDqioARWW",
1695 };
1696 testNetwork(done, params);
1697});
1678it('Allows selection of Syscoin', function(done) { 1698it('Allows selection of Syscoin', function(done) {
1679 var params = { 1699 var params = {
1680 selectText: "SYS - Syscoin", 1700 selectText: "SYS - Syscoin",
@@ -2216,6 +2236,16 @@ it('Allows selection of tRBTC - RSK Testnet', function(done) {
2216 }; 2236 };
2217 testNetwork(done, params); 2237 testNetwork(done, params);
2218}); 2238});
2239it('Allows selection of Argoneum', function(done) {
2240 var params = {
2241 selectText: "AGM - Argoneum",
2242 phrase: "abandon abandon ability",
2243 firstAddress: "MWgLPvJkaJwH6hrXFs1MimAC4FwC1kYRhe",
2244 firstPubKey: "0348e5252045fee1d3b1e5bce25dbc16284d5b6c3bfff9c305d4ffa6078c16f3f8",
2245 firstPrivKey: "VJXpuMEFnK8USLyo5tgF7M4cBXU44U8MUor1KRTQ6t9DVno9AAgg",
2246 };
2247 testNetwork(done, params);
2248});
2219 2249
2220// BIP39 seed is set from phrase 2250// BIP39 seed is set from phrase
2221it('Sets the bip39 seed from the prhase', function(done) { 2251it('Sets the bip39 seed from the prhase', function(done) {