public AccountConfiguration GetAccount(string userName, string passwordHash)
        {
            var accounts = GetAccounts();
            var account  = accounts?.Accounts?.FirstOrDefault(a => a.UserName.ToLower() == userName.ToLower());

            if (account == null)
            {
                return(null);
            }

            ValidateAccount(account, passwordHash);

            account.LastLoginDate = DateTime.Now;
            ConfigurationStorage.Save(accounts);

            DecryptWallets(passwordHash, account.Wallets);
            return(account);
        }
 public void SaveAccounts(AccountCollectionConfiguration accounts)
 {
     ConfigurationStorage.Save(accounts);
 }
 public AccountCollectionConfiguration GetAccounts()
 {
     return(ConfigurationStorage.Get <AccountCollectionConfiguration>() ?? new AccountCollectionConfiguration());
 }