decodeAddr method
Decodes a Tezos (XTZ) blockchain address from its string representation to its byte data.
Implementation
@override
List<int> decodeAddr(String addr, {XtzAddrPrefixes? addressPrefix}) {
/// Validate and retrieve the address prefix from the keyword arguments.
addressPrefix = AddrKeyValidator.getAddrArg<XtzAddrPrefixes>(
addressPrefix,
"addressPrefix",
);
/// Decode the base58 address into bytes.
final addrDecBytes = Base58Decoder.checkDecode(addr);
/// Validate the length of the decoded address and remove the prefix bytes.
AddrDecUtils.validateBytesLength(
addrDecBytes,
addressPrefix.value.length + 20,
);
final blakeBytes = AddrDecUtils.validateAndRemovePrefixBytes(
addrDecBytes,
addressPrefix.value,
);
return blakeBytes;
}