UNPKG

multichain-address-validator

Version:

Multichain address validator for Bitcoin and other blockchains.

11 lines (10 loc) 369 B
import { getAddress } from '../helpers.js'; function isValidEOSAddress(address) { const regex = /^[a-z0-9.]+$/g; // Must be numbers, lowercase letters and decimal points only return address.search(regex) !== -1 && address.length === 12; } export default { isValidAddress: function (address) { return isValidEOSAddress(getAddress(address)); } };