aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/util.js
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2018-06-14 21:55:55 +0800
committerDan <danjm.com@gmail.com>2018-06-15 02:13:14 +0800
commitbb855707efbcb754f5e4ee4e124f69308bca037d (patch)
tree56b4c0e9f98f8efd8e8e6cd20d726bd4acc72e2e /ui/app/util.js
parent5995b6d68dccb8d45a14b0665664717b21be5b8b (diff)
downloadtangerine-wallet-browser-bb855707efbcb754f5e4ee4e124f69308bca037d.tar
tangerine-wallet-browser-bb855707efbcb754f5e4ee4e124f69308bca037d.tar.gz
tangerine-wallet-browser-bb855707efbcb754f5e4ee4e124f69308bca037d.tar.bz2
tangerine-wallet-browser-bb855707efbcb754f5e4ee4e124f69308bca037d.tar.lz
tangerine-wallet-browser-bb855707efbcb754f5e4ee4e124f69308bca037d.tar.xz
tangerine-wallet-browser-bb855707efbcb754f5e4ee4e124f69308bca037d.tar.zst
tangerine-wallet-browser-bb855707efbcb754f5e4ee4e124f69308bca037d.zip
ENS input in send form shows distinct errors for invalid addresses and non-existent addresses.
Diffstat (limited to 'ui/app/util.js')
-rw-r--r--ui/app/util.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/ui/app/util.js b/ui/app/util.js
index 1ccd17ba7..8c85c5926 100644
--- a/ui/app/util.js
+++ b/ui/app/util.js
@@ -36,6 +36,7 @@ module.exports = {
miniAddressSummary: miniAddressSummary,
isAllOneCase: isAllOneCase,
isValidAddress: isValidAddress,
+ isValidENSAddress,
numericBalance: numericBalance,
parseBalance: parseBalance,
formatBalance: formatBalance,
@@ -87,6 +88,10 @@ function isValidAddress (address) {
return (isAllOneCase(prefixed) && ethUtil.isValidAddress(prefixed)) || ethUtil.isValidChecksumAddress(prefixed)
}
+function isValidENSAddress (address) {
+ return address.match(/^.{7,}\.(eth|test)$/)
+}
+
function isInvalidChecksumAddress (address) {
var prefixed = ethUtil.addHexPrefix(address)
if (address === '0x0000000000000000000000000000000000000000') return false