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.addressValidationFailed(
      details: {"address": addr},
    );
  }
  AddrDecUtils.validateLength(wihtoutPrefix, EthAddrConst.addrLen);
  return AddrKeyValidator.getConfigArg(
        CoinsConf.ethereum.params.addrPrefix,
        "addrPrefix",
      ) +
      _checksumEncode(wihtoutPrefix);
}