decodeAddr method
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:
- Decodes the Bech32-encoded address using the INJ address human-readable part (hrp).
- Validates the length of the decoded address.
- 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;
}