decodeAddr method

  1. @override
List<int> decodeAddr(
  1. String addr, [
  2. Map<String, dynamic> kwargs = const {}
])
override

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:

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;
}