/// <summary>
    /// Initializes the UserWallet given the settings to apply.
    /// </summary>
    /// <param name="playerPrefPasswordDerivation"> The active PlayerPrefPasswordDerivation. </param>
    /// <param name="ethereumPendingTransactionManager"> The active EthereumPendingTransactionManager. </param>
    /// <param name="disposableComponentManager"> The active DisposableComponentManager. </param>
    /// <param name="popupManager"> The PopupManager to assign to the wallet. </param>
    /// <param name="ethereumNetworkManager"> The active EthereumNetworkManager to assign to the wallet. </param>
    /// <param name="dynamicDataCache"> The active DynamicDataCache. </param>
    /// <param name="ledgerWallet"> The active LedgerWallet. </param>
    /// <param name="trezorWallet"> The active TrezorWallet. </param>
    /// <param name="userWalletInfoManager"> The active UserWalletInfoManager. </param>
    public UserWalletManager(
        PlayerPrefPasswordDerivation playerPrefPasswordDerivation,
        EthereumPendingTransactionManager ethereumPendingTransactionManager,
        PopupManager popupManager,
        EthereumNetworkManager ethereumNetworkManager,
        DynamicDataCache dynamicDataCache,
        LedgerWallet ledgerWallet,
        TrezorWallet trezorWallet,
        HopeWalletInfoManager userWalletInfoManager)
    {
        this.ethereumPendingTransactionManager = ethereumPendingTransactionManager;
        this.popupManager = popupManager;

        this.ledgerWallet = ledgerWallet;
        this.trezorWallet = trezorWallet;

        hopeWallet   = new HopeWallet(playerPrefPasswordDerivation, popupManager, ethereumNetworkManager, dynamicDataCache, userWalletInfoManager);
        activeWallet = hopeWallet;

        ledgerWallet.OnWalletLoadSuccessful   += () => OnWalletLoadSuccessful?.Invoke();
        ledgerWallet.OnWalletLoadUnsuccessful += () => OnWalletLoadUnsuccessful?.Invoke();
        trezorWallet.OnWalletLoadSuccessful   += () => OnWalletLoadSuccessful?.Invoke();
        trezorWallet.OnWalletLoadUnsuccessful += () => OnWalletLoadUnsuccessful?.Invoke();
        hopeWallet.OnWalletLoadSuccessful     += () => OnWalletLoadSuccessful?.Invoke();
        hopeWallet.OnWalletLoadUnsuccessful   += () => OnWalletLoadUnsuccessful?.Invoke();
    }
示例#2
0
 /// <summary>
 /// Initializes the TrezorWallet by passing all info to the base HardwareWallet class.
 /// </summary>
 /// <param name="ethereumNetworkManager"> The active EthereumNetworkManager. </param>
 /// <param name="ethereumNetworkSettings"> The settings for the EthereumNetworkManager. </param>
 /// <param name="popupManager"> The active PopupManager. </param>
 /// <param name="uiManager"> The active UIManager. </param>
 public TrezorWallet(
     EthereumNetworkManager ethereumNetworkManager,
     EthereumNetworkManager.Settings ethereumNetworkSettings,
     PopupManager popupManager,
     UIManager uiManager) : base(ethereumNetworkManager, ethereumNetworkSettings, popupManager)
 {
     this.uiManager = uiManager;
 }
示例#3
0
 /// <summary>
 /// Initializes the HardwareWallet instance.
 /// </summary>
 /// <param name="ethereumNetworkManager"> The active EthereumNetworkManager. </param>
 /// <param name="ethereumNetworkSettings"> The settings for the EthereumNetworkManager. </param>
 /// <param name="popupManager"> The active PopupManager. </param>
 protected HardwareWallet(
     EthereumNetworkManager ethereumNetworkManager,
     EthereumNetworkManager.Settings ethereumNetworkSettings,
     PopupManager popupManager)
 {
     this.ethereumNetworkManager  = ethereumNetworkManager;
     this.ethereumNetworkSettings = ethereumNetworkSettings;
     this.popupManager            = popupManager;
 }
    /// <summary>
    /// Initializes the <see cref="WalletTransactionSigner"/> by assigning all references.
    /// </summary>
    /// <param name="playerPrefPassword"> The <see cref="PlayerPrefPasswordDerivation"/> instance to assign to the <see cref="WalletDecryptor"/>. </param>
    /// <param name="dynamicDataCache"> The active <see cref="DynamicDataCache"/> to assign to the <see cref="WalletDecryptor"/>. </param>
    /// <param name="ethereumNetworkManager"> The active <see cref="EthereumNetworkManager"/>. </param>
    /// <param name="passwordEncryptor"> The <see cref="MemoryEncryptor"/> instance used to encrypt the password. </param>
    /// <param name="hopeWalletInfoManager"> The active <see cref="HopeWalletInfoManager"/>. </param>
    public WalletTransactionSigner(
        PlayerPrefPasswordDerivation playerPrefPassword,
        DynamicDataCache dynamicDataCache,
        EthereumNetworkManager ethereumNetworkManager,
        MemoryEncryptor passwordEncryptor,
        HopeWalletInfoManager hopeWalletInfoManager)
    {
        this.ethereumNetworkManager = ethereumNetworkManager;
        this.passwordEncryptor      = passwordEncryptor;
        this.hopeWalletInfoManager  = hopeWalletInfoManager;

        walletDecryptor = new WalletDecryptor(playerPrefPassword, dynamicDataCache);
    }
示例#5
0
    /// <summary>
    /// Initializes the UserWallet with the PlayerPrefPassword object.
    /// </summary>
    /// <param name="prefPassword"> The PlayerPrefPassword object used for managing the wallet's encryption password. </param>
    /// <param name="popupManager"> The active PopupManager. </param>
    /// <param name="ethereumNetworkManager"> The active EthereumNetworkManager. </param>
    /// <param name="dynamicDataCache"> The active ProtectedStringDataCache. </param>
    /// <param name="hopeWalletInfoManager"> The active HopeWalletInfoManager. </param>
    public HopeWallet(PlayerPrefPasswordDerivation prefPassword,
                      PopupManager popupManager,
                      EthereumNetworkManager ethereumNetworkManager,
                      DynamicDataCache dynamicDataCache,
                      HopeWalletInfoManager hopeWalletInfoManager)
    {
        this.popupManager     = popupManager;
        this.dynamicDataCache = dynamicDataCache;

        passwordEncryptor       = new MemoryEncryptor(this);
        walletCreator           = new WalletCreator(popupManager, prefPassword, dynamicDataCache, hopeWalletInfoManager);
        walletUnlocker          = new WalletUnlocker(popupManager, prefPassword, dynamicDataCache, hopeWalletInfoManager);
        walletTransactionSigner = new WalletTransactionSigner(prefPassword, dynamicDataCache, ethereumNetworkManager, passwordEncryptor, hopeWalletInfoManager);
    }
示例#6
0
 /// <summary>
 /// Initializes the <see cref="GasUtils"/> by assigning the reference to the active network.
 /// </summary>
 /// <param name="ethereumNetworkManager"> The active <see cref="global::EthereumNetworkManager"/>. </param>
 public GasUtils(EthereumNetworkManager ethereumNetworkManager)
 {
     EthereumNetworkManager = ethereumNetworkManager;
 }
示例#7
0
 /// <summary>
 /// Initializes the <see cref="EthUtils"/> by assigning the reference to the active network.
 /// </summary>
 /// <param name="ethereumNetworkManager"> The active <see cref="global::EthereumNetworkManager"/>. </param>
 /// <param name="ethereumPendingTransactionManager"> The active <see cref="EthereumPendingTransactionManager"/>. </param>
 public EthUtils(EthereumNetworkManager ethereumNetworkManager, EthereumPendingTransactionManager ethereumPendingTransactionManager)
 {
     EthereumNetworkManager            = ethereumNetworkManager;
     EthereumPendingTransactionManager = ethereumPendingTransactionManager;
 }
示例#8
0
 /// <summary>
 /// Initializes the <see cref="TransactionUtils"/> by assigning the reference to the active network.
 /// </summary>
 /// <param name="ethereumNetworkManager"> The active <see cref="global::EthereumNetworkManager"/>. </param>
 public TransactionUtils(EthereumNetworkManager ethereumNetworkManager)
 {
     EthereumNetworkManager = ethereumNetworkManager;
 }
示例#9
0
 /// <summary>
 /// Initializes the LedgerWallet by passing all info to the base HardwareWallet class.
 /// </summary>
 /// <param name="ethereumNetworkManager"> The active EthereumNetworkManager. </param>
 /// <param name="ethereumNetworkSettings"> The settings for the EthereumNetworkManager. </param>
 /// <param name="popupManager"> The active PopupManager. </param>
 public LedgerWallet(
     EthereumNetworkManager ethereumNetworkManager,
     EthereumNetworkManager.Settings ethereumNetworkSettings,
     PopupManager popupManager) : base(ethereumNetworkManager, ethereumNetworkSettings, popupManager)
 {
 }