public void ShouldCreateAddressFromMnemonic() { string words = "conduct stadium ask orange vast impose depend assume income sail chunk tomorrow life grape dutch"; IHDWallet <AvalancheWallet> wallet = new AvalancheHDWallet(words); var account0wallet0 = wallet.GetAccount(0).GetExternalWallet(0); Console.WriteLine(account0wallet0.PrivateKey.ToHex()); Assert.AreEqual("X-avax1wn9s0qlpeur87pk2ccxajlj68d5wt3tw3tts8z", account0wallet0.Address); }
public void ShouldGenerateFujiWalletFromMnemonic() { IHDWallet <AvalancheWallet> avaxHDWallet = new AvalancheHDWallet("wire sort once settle balcony bright awkward pottery derive noodle absorb combine quick account cluster dash material yard people layer fold royal add learn", ""); var account0 = avaxHDWallet.GetAccount(0); AvalancheWallet wallet0 = account0.GetExternalWallet(0); Assert.AreEqual("6f5139852a78fdb4bd790a46fbb34a98cabb1a946a724917efa94a2a41d82d7d", wallet0.PrivateKey.ToHex()); Assert.AreEqual("X-fuji1as0rhx4ejjfm3vzmhxycs58v4lu4u9h73fdlhe", wallet0.GetAddress(Networks.Fuji, Chain.X)); var account = avaxHDWallet.GetAccount(0); Console.WriteLine("Address list;"); for (var i = 0; i < 10; i++) { AvalancheWallet wallet = account.GetExternalWallet((uint)i); Console.WriteLine($"{wallet.PrivateKey.ToHex()} - {wallet.GetAddress(Networks.Fuji)}"); Console.WriteLine(wallet.Address); } }
public void ShouldCreateHDWallet() { var words = "clever glove portion swing nerve bullet boil rose motion nose rocket tube color account enhance"; var passPhrase = "P@ssw0rd"; IHDWallet <AvalancheWallet> hdWallet = new AvalancheHDWallet(words, passPhrase); var key0 = hdWallet.GetAccount(0).GetExternalWallet(0); Assert.AreEqual("X-avax1zcsk0ptxe72suv3w6pr8r7f7kvt8r48t5f3zdt", key0.Address); }
public void ShouldCreateAccount() { string words = "wire sort once settle balcony bright awkward pottery derive noodle absorb combine quick account cluster dash material yard people layer fold royal add learn"; IHDWallet <AvalancheWallet> wallet = new AvalancheHDWallet(words); var account0wallet0 = wallet.GetAccount(0).GetExternalWallet(0); Assert.AreEqual("6f5139852a78fdb4bd790a46fbb34a98cabb1a946a724917efa94a2a41d82d7d", account0wallet0.PrivateKey.ToHex()); // Account Extended Private Key for m/44'/9000'/0'; var accountExtendedPrivateKey = "xprv9ygCPYxKvwkSoQvKtcsfc4AYx7YBMWqkSZ8u7yAD1Ydz9muWdjNgZN6vdg1QBPZ9rYZdKbhPnmseYmHbJCSqkuxPJUzPHc5i6PQto4gvz6M"; IAccount <AvalancheWallet> accountHDWallet = AvalancheHDWallet.GetAccountFromMasterKey(accountExtendedPrivateKey, 0); // m/44'/9000'/0'/0/0 var depositWallet0 = accountHDWallet.GetExternalWallet(0); Assert.AreEqual("6f5139852a78fdb4bd790a46fbb34a98cabb1a946a724917efa94a2a41d82d7d", depositWallet0.PrivateKey.ToHex()); Assert.AreEqual(account0wallet0.PublicKey, depositWallet0.PublicKey); }