decodeWithResult method

DecodeAddressResult decodeWithResult(
  1. String addr, [
  2. Map<String, dynamic> kwargs = const {}
])

Implementation

DecodeAddressResult decodeWithResult(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;
}