Exemplo n.º 1
0
        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);
            }
        }
Exemplo n.º 2
0
        public void ShouldGenerateWalletFromPrivateKey()
        {
            var avalancheWallet = new AvalancheWallet("6f5139852a78fdb4bd790a46fbb34a98cabb1a946a724917efa94a2a41d82d7d");

            Assert.AreEqual("X-fuji1as0rhx4ejjfm3vzmhxycs58v4lu4u9h73fdlhe", avalancheWallet.GetAddress(Networks.Fuji));
        }
Exemplo n.º 3
0
        public void ShouldGenerateWalletForMainnet()
        {
            var avalancheWallet = new AvalancheWallet("6f5139852a78fdb4bd790a46fbb34a98cabb1a946a724917efa94a2a41d82d7d");

            Assert.AreEqual("X-avax1as0rhx4ejjfm3vzmhxycs58v4lu4u9h7amfqmx", avalancheWallet.GetAddress(Networks.Mainnet, Chain.X));
        }
        public void ShouldCreateAddressFromPrivateKey()
        {
            var wallet = new AvalancheWallet("c878c962bdebe816addda5dd12aff7f54f5bf1173c32e91dcb4441980ecd3123");

            Assert.AreEqual("X-avax1wn9s0qlpeur87pk2ccxajlj68d5wt3tw3tts8z", wallet.Address);
        }