decodeAddr method
Decode an Algorand (Algo) blockchain address to its corresponding public key bytes.
Implementation
@override
List<int> decodeAddr(String addr) {
final addrDecBytes = Base32Decoder.decode(addr);
const expectedLength =
Ed25519KeysConst.pubKeyByteLen + AlgoAddrConst.checksumByteLen;
AddrDecUtils.validateBytesLength(addrDecBytes, expectedLength);
final parts = AddrDecUtils.splitPartsByChecksum(
addrDecBytes,
AlgoAddrConst.checksumByteLen,
);
final pubKeyBytes = parts.$1;
final checksumBytes = parts.$2;
AddrDecUtils.validateChecksum(
pubKeyBytes,
checksumBytes,
_AlgoAddrUtils.computeChecksum,
);
return pubKeyBytes;
}