public void LoadNewNotificationList() { transactionsByAddress = new SecurePlayerPrefList <AddressTransactionCount>(PlayerPrefConstants.ASSET_NOTIFICATIONS, (int)networkSettings.networkType + userWalletManager.GetWalletAddress()); foreach (var address in notificationsByAddress.Keys.ToList()) { notificationsByAddress[address] = null; } }
/// <summary> /// Initializes the TokenContractManager by creating all collections and getting the settings. /// </summary> /// <param name="popupManager"> The active PopupManager. </param> /// <param name="tradableAssetImageManager"> The active TradableAssetImageManager. </param> /// <param name="userWalletManager"> The active UserWalletManager. </param> /// <param name="networkSettings"> The current EthereumNetworkManager settings. </param> public TokenContractManager(PopupManager popupManager, TradableAssetImageManager tradableAssetImageManager, UserWalletManager userWalletManager, EthereumNetworkManager.Settings networkSettings) { this.popupManager = popupManager; this.tradableAssetImageManager = tradableAssetImageManager; this.userWalletManager = userWalletManager; tokens = new SecurePlayerPrefList <TokenInfo>(PlayerPrefConstants.SAVED_TOKEN_CONTRACTS, (int)networkSettings.networkType); networkSettings.OnNetworkChanged += network => tokens = new SecurePlayerPrefList <TokenInfo>(PlayerPrefConstants.SAVED_TOKEN_CONTRACTS, (int)network); }
/// <summary> /// Adds contact under the newly created wallet name and address /// </summary> /// <param name="userWalletManager"> The active UserWalletManager </param> /// <param name="userWalletInfoManager"> The active UserWalletInfoManager </param> /// <param name="settings"> The settings for the ContactsManager. </param> /// <param name="networkSettings"> The settings for the EthereumNetworkManager. </param> public ContactsManager( UserWalletManager userWalletManager, HopeWalletInfoManager userWalletInfoManager, EthereumNetworkManager.Settings networkSettings) { UserWalletManager.OnWalletLoadSuccessful += () => { ContactList = new SecurePlayerPrefList <ContactInfo>(PlayerPrefConstants.CONTACT_LIST, (int)networkSettings.networkType); var walletAddress = userWalletManager.GetWalletAddress(); if (!ContactList.Contains(walletAddress.ToLower())) { var info = userWalletInfoManager.GetWalletInfo(walletAddress); if (!string.IsNullOrEmpty(info?.WalletName)) { AddContact(walletAddress.ToLower(), info.WalletName); } } }; }
private void Initialize(TokenContractManager tokenContractManager, PRPS prps, DUBI dubi, EthereumNetworkManager.Settings ethereumNetworkSettings) { addableTokens = new SecurePlayerPrefList <TokenInfo>(PlayerPrefConstants.CACHED_TOKEN_LIST, (int)ethereumNetworkSettings.networkType); InitializeDefaultTokenList(tokenContractManager, prps, dubi, ethereumNetworkSettings); }
/// <summary> /// Initializes the UserWalletInfoManager. /// </summary> public HopeWalletInfoManager() { wallets = new SecurePlayerPrefList <WalletInfo>(PlayerPrefConstants.WALLET_INFO); }