decodeAddr method

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

Decode an address using the Bech32 encoding format with the specified human-readable part (HRP).

This method takes an encoded address, along with a map of optional keyword arguments, and decodes it using the Bech32 encoding format. The HRP (human-readable part) is used to determine the address format.

  • addr: The encoded address to decode.
  • kwargs: Optional keyword arguments, with 'hrp' specifying the human-readable part.

Returns a List

Implementation

@override
List<int> decodeAddr(String addr, [Map<String, dynamic> kwargs = const {}]) {
  final String hrp =
      AddrKeyValidator.validateAddressArgs<String>(kwargs, "hrp");
  final List<int> addrDecBytes = Bech32Decoder.decode(hrp, addr);

  AddrDecUtils.validateBytesLength(
      addrDecBytes, QuickCrypto.hash160DigestSize);
  return addrDecBytes;
}