/// <summary>
    /// Starts to load the tokens which were put in queue earlier.
    /// Also adds the first TradableAsset which would be the EtherAsset.
    /// </summary>
    /// <param name="onTokensLoaded"> Action to call once the tokens have finshed loading. </param>
    public void StartTokenLoad(Action onTokensLoaded)
    {
        var popup = popupManager.GetPopup <LoadingPopup>();

        if (popup != null)
        {
            popup.Text = "Loading wallet";
        }

        Action onLoadFinished = (() => popupManager.CloseAllPopups()) + onTokensLoaded;

        new EtherAsset(asset => UpdateTradableAssets(asset, () => LoadToken(0, onLoadFinished)), tradableAssetImageManager, userWalletManager);
    }
예제 #2
0
    /// <summary>
    /// Sets the wallet num in the data cache and opens the <see cref="UnlockWalletPopup"/>.
    /// </summary>
    private void WalletButtonClicked()
    {
        Button.interactable = false;
        walletNameText.gameObject.AnimateColor(PURE_WHITE, 0.15f);

        dynamicDataCache.SetData("walletnum", ButtonInfo.WalletNum);

        var popup = popupManager.GetPopup <UnlockWalletPopup>();

        popup.SetWalletInfo(fullWalletName);
        popup.OnPopupClose(() =>
        {
            Button.interactable = true;
            walletNameText.gameObject.AnimateColor(UIColors.White, 0.15f);
        });
    }
예제 #3
0
    public void Toggle(bool onClick = false)
    {
        var addTokenPopup = popupManager.GetPopup <AddTokenPopup>();

        if (addTokenPopup.ActivelySelectedButton == this && onClick)
        {
            return;
        }

        if (addTokenPopup.ActivelySelectedButton != null && addTokenPopup.ActivelySelectedButton != this)
        {
            addTokenPopup.ActivelySelectedButton.Toggle();
        }

        Button.interactable = !Button.interactable;
        addTokenPopup.ActivelySelectedButton = Button.interactable ? null : this;
    }
예제 #4
0
    //[ReflectionProtect]
    public void SignTransaction <T>(
        Action <TransactionSignedUnityRequest> onTransactionSigned,
        BigInteger gasLimit,
        BigInteger gasPrice,
        BigInteger value,
        string addressFrom,
        string addressTo,
        string data,
        string path,
        params object[] displayInput) where T : ConfirmTransactionPopupBase <T>
    {
        var promise = (dynamicDataCache.GetData("pass") as ProtectedString)?.CreateDisposableData();

        promise.OnSuccess(disposableData =>
        {
            byte[] encryptedPasswordBytes = GetEncryptedPass(disposableData.ByteValue);
            popupManager.GetPopup <T>(true)
            .SetConfirmationValues(() => walletTransactionSigner.SignTransaction(addressFrom, path, encryptedPasswordBytes, onTransactionSigned),
                                   gasLimit,
                                   gasPrice,
                                   displayInput);
        });
    }
예제 #5
0
 /// <summary>
 /// Sets the button listeners
 /// </summary>
 protected override void OnAwake()
 {
     Button.onClick.AddListener(() => ButtonInfo.ContactsPopup.EnableNewContactButton(this));
     editButton.onClick.AddListener(() => popupManager.GetPopup <AddOrEditContactPopup>(true).SetPopupLayout(false, RealContactName, RealContactAddress, this));
     deleteButton.onClick.AddListener(() => popupManager.GetPopup <GeneralOkCancelPopup>(true).SetSubText("Are you sure you want to delete the " + RealContactName + " contact?").OnOkClicked(DeleteThisContact));
 }
예제 #6
0
 /// <summary>
 /// Opens the ModifyTokensPopup.
 /// </summary>
 private void ButtonClicked()
 {
     popupManager.GetPopup <AddTokenPopup>().OnPopupClose(() => button.interactable = true);
     button.interactable = false;
 }