decodeAddr method

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

Overrides the base class method to decode an INJ (Injective Protocol) address.

This method decodes an INJ address from the provided input string. It expects an optional map of keyword arguments for custom INJ address parameters. The method performs the following steps:

  1. Decodes the Bech32-encoded address using the INJ address human-readable part (hrp).
  2. Validates the length of the decoded address.
  3. Returns the decoded address as a List

Parameters:

  • addr: The INJ address to be decoded as a string.
  • kwargs: Optional keyword arguments for custom INJ address parameters (not used in this implementation).

Returns: A List

Implementation

@override
List<int> decodeAddr(String addr, [Map<String, dynamic> kwargs = const {}]) {
  /// Decode the Bech32-encoded address using the INJ address human-readable part (hrp).
  final addrDecBytes = Bech32Decoder.decode(
    CoinsConf.injective.params.addrHrp!,
    addr,
  );

  /// Validate the length of the decoded address.
  AddrDecUtils.validateBytesLength(
    addrDecBytes,
    EthAddrConst.addrLen ~/ 2,
  );
  return addrDecBytes;
}