decodeAddr method
Decodes a Zilliqa blockchain address from a human-readable representation.
Given a Zilliqa address string addr
, this method decodes it using the
specified Human Readable Part (HRP) from the Zilliqa configuration. If the
provided address has an invalid bech32 checksum, it raises an ArgumentException
with a descriptive error message.
Parameters:
addr
: The Zilliqa address string to decode.kwargs
: An optional map of additional arguments. (Not used in this implementation)
Returns:
- A List<int> representing the decoded Zilliqa address in bytes.
Throws:
- An ArgumentException with an error message if the bech32 checksum is invalid.
Implementation
@override
List<int> decodeAddr(String addr, [Map<String, dynamic> kwargs = const {}]) {
/// Decode the Zilliqa address using the specified Human Readable Part (HRP).
final addrDecBytes = Bech32Decoder.decode(
CoinsConf.zilliqa.params.addrHrp!,
addr,
);
return addrDecBytes;
}