decodeAddr method
Decodes a given blockchain address string.
This method takes an address string and optional keyword arguments (kwargs) and decodes it into a List representing the decoded address.
addr
: The blockchain address string to be decoded.kwargs
: Optional keyword arguments that can be used for configuration.
Returns a List containing the decoded blockchain address.
Implementation
@override
List<int> decodeAddr(String addr, [Map<String, dynamic> kwargs = const {}]) {
final int? workChain =
AddrKeyValidator.nullOrValidateAddressArgs(kwargs, "workchain");
final decode = TonAddressUtils.decodeAddress(addr);
if (workChain != null && workChain != decode.workchain) {
throw AddressConverterException("Invalid address workchain.",
details: {"expected": workChain, "workchain": decode.workchain});
}
return decode.hash;
}