Beispiel #1
0
        internal BitfiWallet.SGADWS.NoxAddressReviewV3 GetAddressIndexes(string SGAMSGTOKEN)
        {
            using (SGADWS walletServ = new SGADWS())
            {
                walletServ.Timeout = 30000;

                try
                {
                    if (string.IsNullOrEmpty(SGAMSGTOKEN))
                    {
                        return(null);
                    }
                    Sclear.MsgCount = Sclear.MsgCount + 1;
                    string msg       = Sclear.MsgCount.ToString();
                    string signature = SignMsg(msg);
                    return(walletServ.GetAddressIndexesV3(signature, msg, Sclear.pubkey, Sclear.PREFUSER, SGAMSGTOKEN));
                }
                catch (WebException)
                {
                    return(null);
                }
                catch (Exception)
                {
                    return(null);
                }
            }
        }
Beispiel #2
0
        internal BitfiWallet.SGADWS.OverviewViewModel GetOverviewModel(string SGAMSGTOKEN)
        {
            using (SGADWS walletServ = new SGADWS())
            {
                walletServ.Timeout = 30000;

                try
                {
                    if (string.IsNullOrEmpty(SGAMSGTOKEN))
                    {
                        return(null);
                    }
                    Sclear.MsgCount = Sclear.MsgCount + 1;
                    string msg = Sclear.MsgCount.ToString();

                    string signature = SignMsg(msg);
                    var    model     = walletServ.GetOverviewModel(signature, msg, Sclear.pubkey, Sclear.PREFUSER, SGAMSGTOKEN);


                    return(model);
                }
                catch (WebException)
                {
                    return(null);
                }
                catch (Exception)
                {
                    return(null);
                }
            }
        }
Beispiel #3
0
        internal string GetSGATokenForSignin(string userPubKey, string Signature, string DisplayCode)
        {
            using (SGADWS walletServ = new SGADWS())
            {
                walletServ.Timeout = 30000;

                try
                {
                    string msg = Guid.NewGuid().ToString();
                    msg = SHashSHA1(msg);
                    string signature    = SignMsg(msg);
                    string MessageToken = walletServ.GetSGATokenForSignIn(signature, msg, Sclear.pubkey, Sclear.PREFUSER, userPubKey, Signature, DisplayCode);

                    return(MessageToken);
                }
                catch (WebException)
                {
                    return(null);
                }
                catch (Exception)
                {
                    return(null);
                }
            }
        }
Beispiel #4
0
        internal string GetSGAToken(string userPubKey, string Signature)
        {
            using (SGADWS walletServ = new SGADWS())
            {
                walletServ.Timeout = 30000;

                try
                {
                    string msg = Guid.NewGuid().ToString();
                    msg = SHashSHA1(msg);
                    string signature    = SignMsg(msg);
                    string MessageToken = walletServ.GetSGAToken(signature, msg, Sclear.pubkey, Sclear.PREFUSER, userPubKey, Signature);
                    //  if (!string.IsNullOrEmpty(MessageToken) && MessageToken.Length > 10) SGAMSGTOKEN = MessageToken;
                    return(MessageToken);
                }
                catch (WebException)
                {
                    return(null);
                }
                catch (Exception)
                {
                    return(null);
                }
            }
        }
Beispiel #5
0
        internal string GetSGAMessage()
        {
            using (SGADWS walletServ = new SGADWS())
            {
                walletServ.Timeout = 30000;

                try
                {
                    string msg = Guid.NewGuid().ToString();
                    msg = SHashSHA1(msg);
                    string signature  = SignMsg(msg);
                    string sgamessage = walletServ.GetSGAMessage(signature, msg, Sclear.pubkey, Sclear.PREFUSER);

                    return(sgamessage);
                }
                catch (WebException)
                {
                    return(null);
                }
                catch (Exception)
                {
                    return(null);
                }
            }
        }
Beispiel #6
0
 internal BitfiWallet.SGADWS.NoxMessagesConfig GetMessagesConfig()
 {
     using (SGADWS walletServ = new SGADWS())
     {
         walletServ.Timeout = 30000;
         try
         {
             var config = walletServ.GetMessageConfig();
             return config;
         }
         catch (WebException)
         {
             return null;
         }
         catch (Exception)
         {
             return null;
         }
     }
 }