UNPKG

dvf-client-js

Version:

<img src="https://avatars1.githubusercontent.com/u/56512535?s=200&v=4" align="right" />

14 lines (10 loc) 314 B
const DVFError = require('../dvf/DVFError') const isAddress = string => /([0-9abcdefABCDEF]){40}/.test(string) module.exports = (dvf, ethAdress) => { if (!ethAdress) { throw new DVFError('ERR_ETH_ADDRESS_MISSING') } if (!isAddress(ethAdress)) { throw new DVFError('ERR_INVALID_ETH_ADDRESS') } }