import { toChecksumAddress } from 'ethereumjs-util' ; param addressString returns export function parseAddress ( addressString ) { const buf = Buffer . from ( addressString . replace ( /^0x/ , '' ) , 'hex' ) ; if ( ! buf . slice ( 0 , 12 ) . equals ( Buffer . alloc ( 12 , 0 ) ) ) { return undefined ; } const address = '0x' + buf . toString ( 'hex' , 12 , 32 ) ; return toChecksumAddress ( address ) ; }