decodeAddr method
Overrides the method to decode an Egld (Elrond) address from the provided string addr
.
addr
: The string representation of the Egld address.
kwargs
: A map of optional keyword arguments.
This method decodes the Egld address by validating and removing the prefix and verifying the Bech32 checksum.
Returns a List
Implementation
@override
List<int> decodeAddr(String addr, [Map<String, dynamic> kwargs = const {}]) {
/// Decode the Bech32 address with the specified Human-Readable Part (HRP)
final addrDecBytes =
Bech32Decoder.decode(CoinsConf.elrond.params.addrHrp!, addr);
/// Validate the length of the decoded address
AddrDecUtils.validateBytesLength(
addrDecBytes,
Ed25519KeysConst.pubKeyByteLen,
);
return List<int>.from(addrDecBytes);
}