From: iancoleman <1281387+iancoleman@users.noreply.github.com> Date: Mon, 27 Apr 2020 23:25:55 +0000 (+1000) Subject: Merge pull request #416 from Argoneum/argoneum X-Git-Url: https://git.immae.eu/?p=perso%2FImmae%2FProjets%2FCryptomonnaies%2FBIP39.git;a=commitdiff_plain;h=d359fe64b2f43f59714815d7ec5e1c82de50afd0;hp=46054e445ed10b12f8a373bbb8f6dbcc81db3e1d Merge pull request #416 from Argoneum/argoneum Add Argoneum (v1.4.1 or above) --- 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 @@
-

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).

+

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).

For more info see the BIP39 spec. diff --git a/src/js/bitcoinjs-extensions.js b/src/js/bitcoinjs-extensions.js index 1ef2aa4..e331c24 100644 --- a/src/js/bitcoinjs-extensions.js +++ b/src/js/bitcoinjs-extensions.js @@ -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', diff --git a/src/js/index.js b/src/js/index.js index f711818..0471e86 100644 --- a/src/js/index.js +++ b/src/js/index.js @@ -3098,6 +3098,13 @@ setHdCoin(105); }, }, + { + name: "SUGAR - Sugarchain", + onSelect: function() { + network = libs.bitcoin.networks.sugarchain; + setHdCoin(408); + }, + }, { name: "SWTC - Jingtum", onSelect: function() { diff --git a/src/js/segwit-parameters.js b/src/js/segwit-parameters.js index d5ea419..0c41bf7 100644 --- a/src/js/segwit-parameters.js +++ b/src/js/segwit-parameters.js @@ -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 +}; + })(); diff --git a/tests/spec/tests.js b/tests/spec/tests.js index 1b92915..e7c81bc 100644 --- a/tests/spec/tests.js +++ b/tests/spec/tests.js @@ -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",