toChecksumAddress static method

String toChecksumAddress(
  1. String addr
)

Implementation

static String toChecksumAddress(String addr) {
  final String wihtoutPrefix = StringUtils.strip0x(addr);
  if (!StringUtils.isHexBytes(wihtoutPrefix)) {
    throw AddressConverterException("Invalid Ethereum address.",
        details: {"address": addr});
  }
  AddrDecUtils.validateLength(wihtoutPrefix, EthAddrConst.addrLen);
  return CoinsConf.ethereum.params.addrPrefix! +
      _checksumEncode(wihtoutPrefix);
}