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
addr
: The blockchain address string to be decoded.kwargs
: Optional keyword arguments that can be used for configuration.
Returns a List
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: {"excepted": workChain, "workchain": decode.workchain});
}
return decode.hash;
}