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

1  2 
src/js/bitcoinjs-extensions.js
src/js/index.js
tests/spec/tests.js

index 7446bd7ecc5af5d12cb0da5e82d0e494ae06fa3e,1ef2aa4cb65b4d8828a4ef636e7d4b3485fc84cb..e331c241c986c480eba052be6255c31f101d171b
@@@ -1739,17 -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',
    scriptHash: 0xc4,
    wif: 0xef,
  };
+ libs.bitcoin.networks.argoneum = {
+   messagePrefix: 'unused',
+   bip32: {
+     public: 0x0488b21e,
+     private: 0x0488ade4
+   },
+   pubKeyHash: 0x32,
+   scriptHash: 0x61,
+   wif: 0xbf
+ };
diff --combined src/js/index.js
index 841a27f0cde32563266efd1c4718acea4cc23230,f7118185ce93169300e72a55af8b6222b1e39378..0471e8619d2e3d0f749f0414ceb09f524616c051
                  setHdCoin(161);
              },
          },
+         {
+             name: "AGM - Argoneum",
+             onSelect: function() {
+                 network = libs.bitcoin.networks.argoneum;
+                 setHdCoin(421);
+             },
+         },
          {
              name: "ARYA - Aryacoin",
              onSelect: function() {
                  setHdCoin(105);
              },
          },
 +        {
 +            name: "SUGAR - Sugarchain",
 +            onSelect: function() {
 +                network = libs.bitcoin.networks.sugarchain;
 +                setHdCoin(408);
 +            },
 +        },
          {
              name: "SWTC - Jingtum",
              onSelect: function() {
diff --combined tests/spec/tests.js
index d9a1843cd6f380d6c4055143a7f6db12188216d2,1b929158e4a4a39eb66a7eeb5718d9f7e8b50527..e7c81bcad598129c3fefbe158676eb5e106fad30
@@@ -1675,16 -1675,6 +1675,16 @@@ it('Allows selection of Stratis Test', 
      };
      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",
@@@ -2226,6 -2216,16 +2226,16 @@@ it('Allows selection of tRBTC - RSK Tes
      };
      testNetwork(done, params);
  });
+ it('Allows selection of Argoneum', function(done) {
+     var params = {
+         selectText: "AGM - Argoneum",
+         phrase: "abandon abandon ability",
+         firstAddress: "MWgLPvJkaJwH6hrXFs1MimAC4FwC1kYRhe",
+         firstPubKey: "0348e5252045fee1d3b1e5bce25dbc16284d5b6c3bfff9c305d4ffa6078c16f3f8",
+         firstPrivKey: "VJXpuMEFnK8USLyo5tgF7M4cBXU44U8MUor1KRTQ6t9DVno9AAgg",
+     };
+     testNetwork(done, params);
+ });
  
  // BIP39 seed is set from phrase
  it('Sets the bip39 seed from the prhase', function(done) {