aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/send_/send-content/send-to-row/send-to-row.utils.js
blob: 52bfde009b6099909f7374f962410865e273d63e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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
}