Ejemplo n.º 1
0
        private string[] GetFirstXMR(ExtKey masterKey)
        {
            ExtKey masterKeyA = masterKey.Derive(GetCurrencyIndex("xmr"), hardened: true);
            ExtKey key = masterKeyA.Derive((uint)0);
            byte[] keybytes = key.PrivateKey.ToBytes();
            MoneroWallet.Wallet wallet = MoneroWallet.Wallet.OpenWallet(keybytes);
            string[] moneroadr = { wallet.Address, MoneroWallet.Converters.ByteArrayToHex(wallet.Keys.ViewSecret) };
            Sclear.EraseBytes(keybytes);
            masterKeyA = null;
            key = null;
            wallet.Dispose();

            return moneroadr;
        }
Ejemplo n.º 2
0
        internal List\\ GetReviewIndexes(BitfiWallet.SGADWS.NoxAddressReviewV3 noxAddressReviews, ExtKey masterKey)
        {
            List\\ noxAddresses = new List\\();

            foreach (var adrReview in noxAddressReviews.AdrReview)
            {
                string currencySymbol = adrReview.Blk;
                ExtKey ASmasterKey = masterKey.Derive(GetCurrencyIndex(currencySymbol), hardened: true);


                for (int i = 0; i \                {

                    string address = "";
                    ExtKey key = ASmasterKey.Derive((uint)i);
                    byte[] keybytes = key.PrivateKey.ToBytes();

                    if (GetBLKNetworkAlt(adrReview.Blk) != null)
                    {

                        foreach(var nadr in noxAddressReviews.Addresses)
                        {
                            if (nadr.BlkNet == adrReview.Blk && nadr.HDIndex == i)
                            {
                                BitfiWallet.AltCoinGen altCoinGen = new BitfiWallet.AltCoinGen(GetBLKNetworkAlt(adrReview.Blk));
                                address = altCoinGen.GetNewAddress(keybytes, nadr.DoSegwit);
                                break;
                            }
                        }


                    }
                    if (adrReview.Blk == "apl")
                    {
                        APLGen aPL = new APLGen();
                        address =  aPL.GetAccountID(keybytes);
                    }
                    if (adrReview.Blk == "neo")
                    {
                         var NEOkeypair = new KeyPair(keybytes);
                        address = NEOkeypair.address;
                        NEOkeypair.Dispose();
                    }
                    if (adrReview.Blk == "xmr")
                    {
                        MoneroWallet.Wallet wallet = MoneroWallet.Wallet.OpenWallet(keybytes);
                        address = wallet.Address;
                        wallet.Dispose();

                    }
                    if (adrReview.Blk == "eth")
                    {
                        EthECKey ETHkey = new EthECKey(keybytes, true);
                        address = ETHkey.GetPublicAddress();
                    }
                    if (adrReview.Blk == "xrp")
                    {
                        RipGen ripGen = new RipGen();
                        address = ripGen.GetAddress(keybytes);
                    }
                    Sclear.EraseBytes(keybytes);
                    key = null;

                    noxAddresses.Add(new BitfiWallet.NOXWS.NoxAddresses { BlkNet = currencySymbol, BTCAddress = address}

                    );

                }

            }
            masterKey = null;

            return noxAddresses;
        }