]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/BIP39.git/commitdiff
Merge pull request #416 from Argoneum/argoneum
authoriancoleman <1281387+iancoleman@users.noreply.github.com>
Mon, 27 Apr 2020 23:25:55 +0000 (09:25 +1000)
committerGitHub <noreply@github.com>
Mon, 27 Apr 2020 23:25:55 +0000 (09:25 +1000)
Add Argoneum (v1.4.1 or above)

src/index.html
src/js/bitcoinjs-extensions.js
src/js/index.js
src/js/segwit-parameters.js
tests/spec/tests.js

index 1184a0c69aca0ae82aea0bcd08b053f5de7b72f7..ae39c1110f4dee739c4068c468711268720098d1 100644 (file)
@@ -24,7 +24,7 @@
                         <div class="form-group">
                             <div class="col-sm-2"></div>
                             <div class="col-sm-10">
-                                <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>
+                                <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>
                                 <p>
                                     For more info see the
                                     <a href="https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki" target="_blank">BIP39 spec</a>.
index 1ef2aa4cb65b4d8828a4ef636e7d4b3485fc84cb..e331c241c986c480eba052be6255c31f101d171b 100644 (file)
@@ -1739,6 +1739,17 @@ libs.bitcoin.networks.elastos = {
     wif: 0xef // TODO set this correctly, same as BTC for now
 };
 
+libs.bitcoin.networks.sugarchain = {
+    messagePrefix: '\x18Sugarchain Signed Message:\n',
+    bip32: {
+        public: 0x0488B21E,
+        private: 0x0488ADE4,
+    },
+    pubKeyHash: 0x3f,
+    scriptHash: 0x7d,
+    wif: 0x80
+};
+
 // https://github.com/libs.bitcoinjs-lib/blob/3f6f5ef97a1ee1b8337865209282c0095e22b2e7/src/networks.js
 libs.bitcoin.networks.regtest = {
   messagePrefix: '\x18Bitcoin Signed Message:\n',
index f7118185ce93169300e72a55af8b6222b1e39378..0471e8619d2e3d0f749f0414ceb09f524616c051 100644 (file)
                 setHdCoin(105);
             },
         },
+        {
+            name: "SUGAR - Sugarchain",
+            onSelect: function() {
+                network = libs.bitcoin.networks.sugarchain;
+                setHdCoin(408);
+            },
+        },
         {
             name: "SWTC - Jingtum",
             onSelect: function() {
index d5ea419e331dba7bc23e2bd7ec36efe70b5c0454..0c41bf7619e98627decfb361f9de97004387721c 100644 (file)
@@ -683,4 +683,30 @@ libs.bitcoin.networks.deeponion.p2wpkhInP2sh = {
        wif: 0x9f
 };
 
+libs.bitcoin.networks.sugarchain.p2wpkh = {
+       baseNetwork: "sugarchain",
+       messagePrefix: '\x1DSugarchain Signed Message:\n',
+       bech32: 'sugar',
+       bip32: {
+               public: 0x04b24746,
+               private: 0x04b2430c
+       },
+       pubKeyHash: 0x3f,
+       scriptHash: 0x7d,
+       wif: 0x80
+};
+
+libs.bitcoin.networks.sugarchain.p2wpkhInP2sh = {
+       baseNetwork: "sugarchain",
+       messagePrefix: '\x1DSugarchain Signed Message:\n',
+       bech32: 'sugar',
+       bip32: {
+               public: 0x049d7cb2,
+               private: 0x049d7878
+       },
+       pubKeyHash: 0x3f,
+       scriptHash: 0x7d,
+       wif: 0x80
+};
+
 })();
index 1b929158e4a4a39eb66a7eeb5718d9f7e8b50527..e7c81bcad598129c3fefbe158676eb5e106fad30 100644 (file)
@@ -1675,6 +1675,16 @@ it('Allows selection of Stratis Test', function(done) {
     };
     testNetwork(done, params);
 });
+it('Allows selection of Sugarchain', function(done) {
+    var params = {
+        selectText: "SUGAR - Sugarchain",
+        phrase: "abandon abandon ability",
+        firstAddress: "SYnd31fYr39VgKju87Vz1sYBmEeHg5cudk",
+        firstPubKey: "035bc9fa22eff2246ec07bb09c9e32f5f9fee517b4f49a8f117508f8fb41905b25",
+        firstPrivKey: "L2G3axGdZv5EV8osAsBPMese74i4dTHaGvxDh7DsRF5Ky6hKkPDY",
+    };
+    testNetwork(done, params);
+});
 it('Allows selection of Syscoin', function(done) {
     var params = {
         selectText: "SYS - Syscoin",