예제 #1
0
    public void Construct(
        CurrencyManager currencyManager,
        UserWalletManager userWalletManager,
        TradableAssetManager tradableAssetManager,
        TradableAssetPriceManager tradableAssetPriceManager,
        EthereumTransactionButtonManager ethereumTransactionButtonManager,
        EtherBalanceObserver etherBalanceObserver,
        GasPriceObserver gasPriceObserver,
        UpdateManager updateManager,
        DynamicDataCache dynamicDataCache,
        PeriodicUpdateManager periodicUpdateManager,
        ContactsManager contactsManager,
        ButtonClickObserver buttonClickObserver,
        RestrictedAddressManager restrictedAddressManager)
    {
        this.ethereumTransactionButtonManager = ethereumTransactionButtonManager;
        this.userWalletManager   = userWalletManager;
        this.dynamicDataCache    = dynamicDataCache;
        this.buttonClickObserver = buttonClickObserver;

        Asset   = new AssetManager(tradableAssetManager, etherBalanceObserver, updateManager, assetSymbol, assetBalance, assetImage);
        Gas     = new GasManager(tradableAssetManager, tradableAssetPriceManager, currencyManager, gasPriceObserver, periodicUpdateManager, advancedModeToggle, transactionSpeedSlider, gasLimitField, gasPriceField, transactionFee);
        Address = new AddressManager(addressField, contactName, contactsManager, restrictedAddressManager);
        Amount  = new AmountManager(currencyManager, tradableAssetPriceManager, maxToggle, maxText, amountField, currencyText, oppositeCurrencyAmountText, currencyButton, assetSymbol.text);

        Gas.SetupDependencies(Amount);
        Amount.SetupDependencies(Gas, Asset);

        simpleModeSelectableFields.Add(addressField.InputFieldBase);
        simpleModeSelectableFields.Add(amountField.InputFieldBase);

        advancedModeSelectableFields.AddRange(simpleModeSelectableFields);
        advancedModeSelectableFields.Add(gasLimitField.InputFieldBase);
        advancedModeSelectableFields.Add(gasPriceField.InputFieldBase);
    }
        /// <summary>
        /// Initializes the <see cref="AddressManager"/> by assigning the send address input field.
        /// </summary>
        /// <param name="addressField"> The input field for the address. </param>
        /// <param name="contactName"> The contactName text component. </param>
        /// <param name="contactsManager"> The active ContactsManager. </param>
        public AddressManager(
            HopeInputField addressField,
            TMP_Text contactName,
            ContactsManager contactsManager,
            RestrictedAddressManager restrictedAddressManager)
        {
            this.addressField             = addressField;
            this.contactName              = contactName;
            this.contactsManager          = contactsManager;
            this.restrictedAddressManager = restrictedAddressManager;

            addressField.OnInputUpdated += _ => CheckAddress();
        }
예제 #3
0
 public void Construct(RestrictedAddressManager restrictedAddressManager)
 {
     this.restrictedAddressManager = restrictedAddressManager;
 }