How to use the multicoin-address-validator.validate function in multicoin-address-validator

To help you get started, we’ve selected a few multicoin-address-validator examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github MyEtherWallet / MyEtherWallet / src / layouts / InterfaceLayout / containers / SwapContainer / components / SwapAddressSelector / SwapAddressSelector.vue View on Github external
let checkAddress = addr.address ? addr.address : addr;
        checkAddress = await this.checkForEns(checkAddress);
        if (EthereumTokens[this.currency]) {
          this.validAddress = WAValidator.validate(checkAddress, 'ETH');
          this.validityResult(this.validAddress);
        } else {
          try {
            this.validAddress = WAValidator.validate(
              checkAddress,
              this.currency
            );
            this.validityResult(this.validAddress);
          } catch (e) {
            if (canValidate(this.currency)) {
              try {
                this.validAddress = MAValidator.validate(
                  checkAddress,
                  this.currency
                );
                this.validityResult(this.validAddress);
              } catch (e) {
                errorLogger(e);
                this.validityResult('INVALID');
                this.validAddress = false;
              }
            } else {
              this.validityResult('MAYBE_VALID');
              this.validAddress = true;
              this.unableToValidate = true;
            }
          }
        }
github MyEtherWallet / MyEtherWallet / src / partners / partners.js View on Github external
static checkAddress(address, currency) {
    let validAddress = false;
    try {
      validAddress = WAValidator.validate(address, currency);
    } catch (e) {
      try {
        validAddress = MAValidator.validate(address, currency);
      } catch (e) {
        validAddress = false;
      }
    }
    return validAddress;
  }
}
github MyEtherWallet / MyEtherWallet / src / directives / AddrResolver.js View on Github external
_this.isValidAddress = false;
                  _this.hexAddress = '';
                  vnode.elm.parentNode.parentNode.appendChild(errorPar);
                }
              });
          }
        }
      } else if (e !== '') {
        const isValid = WAValidator.validate(e, parentCurrency);
        if (isValid) {
          _this.isValidAddress = isValid;
          _this.hexAddress =
            parentCurrency === 'ETH' ? toChecksumAddress(e) : e;
        } else {
          if (canValidate(parentCurrency)) {
            const isValid = MAValidator.validate(e, parentCurrency);
            if (isValid) {
              _this.isValidAddress = isValid;
              _this.hexAddress = e;
            } else {
              _this.isValidAddress = false;
              _this.hexAddress = '';
              removeElements();

              if (e.length > 0) {
                if (
                  parentCurrency === 'ETH' &&
                  (e.length !== 42 || !utils.isHexStrict(e))
                ) {
                  errorPar.innerText = _this.$t(
                    'ens.ens-resolver.invalid-eth-addr'
                  );

multicoin-address-validator

Multicoin address validator for Bitcoin and other Altcoins.

MIT
Latest version published 2 months ago

Package Health Score

78 / 100
Full package analysis

Popular multicoin-address-validator functions