decodeAddr method
Decodes an Ethereum address from its string representation.
Implementation
@override
List<int> decodeAddr(String addr, {bool skipChecksum = false}) {
final String addrNoPrefix = AddrDecUtils.validateAndRemovePrefix(
addr,
AddrKeyValidator.getConfigArg(
CoinsConf.ethereum.params.addrPrefix,
"addrPrefix",
),
);
AddrDecUtils.validateLength(addrNoPrefix, EthAddrConst.addrLen);
if (!skipChecksum &&
addrNoPrefix != EthAddrUtils._checksumEncode(addrNoPrefix)) {
throw AddressConverterException.addressKeyValidationFailed(
reason: "Invalid checksum encoding",
);
}
return BytesUtils.fromHexString(addrNoPrefix);
}