diff options
author | Dan <danjm.com@gmail.com> | 2018-04-07 06:29:51 +0800 |
---|---|---|
committer | Dan <danjm.com@gmail.com> | 2018-04-07 06:29:51 +0800 |
commit | 284dd85a99f538b77fd477f4952117d1792f64a5 (patch) | |
tree | 419bc3a56f01d818a98a6bb3ff21cec8434be093 /ui/app/components/send_/send-content/send-to-row/send-to-row.utils.js | |
parent | 77486a23654a7709091f99bc7ef76d894a46113a (diff) | |
download | tangerine-wallet-browser-284dd85a99f538b77fd477f4952117d1792f64a5.tar.gz tangerine-wallet-browser-284dd85a99f538b77fd477f4952117d1792f64a5.tar.zst tangerine-wallet-browser-284dd85a99f538b77fd477f4952117d1792f64a5.zip |
first commit
Diffstat (limited to 'ui/app/components/send_/send-content/send-to-row/send-to-row.utils.js')
-rw-r--r-- | ui/app/components/send_/send-content/send-to-row/send-to-row.utils.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/ui/app/components/send_/send-content/send-to-row/send-to-row.utils.js b/ui/app/components/send_/send-content/send-to-row/send-to-row.utils.js new file mode 100644 index 000000000..52bfde009 --- /dev/null +++ b/ui/app/components/send_/send-content/send-to-row/send-to-row.utils.js @@ -0,0 +1,17 @@ +const { isValidAddress } = require('../../../../util') + +function getToErrorObject (to) { + let toError = null + + if (!to) { + toError = 'required' + } else if (!isValidAddress(to)) { + toError = 'invalidAddressRecipient' + } + + return { to: toError } +} + +module.exports = { + getToErrorObject +} |