View on GitHub
File Changes
    }
  };

                      
+
  async isValidAddress(address: string): Promise<boolean> {
+
    Logger.debug('AdaApi::isValidAdaAddress called', {
+
      parameters: { address },
+
    });
+
    /* try {
+
      const response: Address = await getAddress(this.config, { address });
+
      Logger.debug('AdaApi::isValidAdaAddress success', { response });
+
      return true;
+
    } catch (error) {
+
      Logger.error('AdaApi::isValidAdaAddress error', { error });
+
      return false;
+
    } */
+
    return true;
+
  }
+

                      
  isValidMnemonic = (mnemonic: string): boolean =>
    isValidMnemonic(mnemonic, WALLET_RECOVERY_PHRASE_WORD_COUNT);

                      
    address: string,
    amount: number
  ) => Promise<BigNumber>,
+
  addressValidator: Function,
  openDialogAction: Function,
  isDialogOpen: Function,
  onExternalLinkClick?: Function,
          validators: [
            async ({ field, form }) => {
              const { value } = field;
+

                      
              if (value === '') {
                this._resetTransactionFee();
                return [
              const amountField = form.$('amount');
              const amountValue = amountField.value;
              const isAmountValid = amountField.isValid;
-
              const transactionFee = await this._calculateTransactionFee(
-
                value,
-
                amountValue
-
              );
-
              const { isValidAddress } = transactionFee;
-
              if (!isAmountValid || !isValidAddress) {
+
              const isValidAddress = await this.props.addressValidator(value);
+

                      
+
              if (isValidAddress && isAmountValid) {
                this._resetTransactionFee();
+
              } else {
+
                await this._calculateTransactionFee(value, amountValue);
              }
              return [
                isValidAddress,
          transactionFeeError: null,
        });
      }
-
      return {
-
        isValidAddress: true,
-
        hasError: false,
-
        amount: fee,
-
      };
    } catch (error) {
+
      // @API TODO - address is not correct on fee check
      if (error.message === 'NotValidAddress') {
-
        return {
-
          isValidAddress: false,
-
          hasError: true,
-
          amount: null,
-
        };
+
        return;
      }
      const errorHasLink = !!error.values.linkLabel;
      const transactionFeeError = errorHasLink ? (
        });
      }
    }
-
    return {
-
      isValidAddress: true,
-
      hasError: true,
-
      fee: null,
-
    };
  }
}
    const { intl } = this.context;
    const { uiDialogs, wallets, transactions, app } = this.props.stores;
    const { actions } = this.props;
+
    const { isValidAddress } = wallets;
    const { calculateTransactionFee, validateAmount } = transactions;
    const activeWallet = wallets.active;

                      
            amount,
          })
        }
+
        addressValidator={isValidAddress}
        isDialogOpen={uiDialogs.isOpen}
        openDialogAction={actions.dialogs.open.trigger}
        isRestoreActive={isRestoreActive}
    });
  };

                      
+
  isValidAddress = (address: string) => this.api.ada.isValidAddress(address);
+

                      
  isValidMnemonic = (mnemonic: string) =>
    this.api.ada.isValidMnemonic(mnemonic);