decodeAddr method

  1. @override
List<int> decodeAddr(
  1. String addr, {
  2. int? workChain,
})
override

Decodes a given blockchain address string.

Implementation

@override
List<int> decodeAddr(String addr, {int? workChain}) {
  final decode = TonAddressUtils.decodeAddress(addr);
  if (workChain != null && workChain != decode.workchain) {
    throw AddressConverterException.addressValidationFailed(
      reason: "Invalid address workchain.",
      network: "Ton",
      details: {"expected": workChain, "workchain": decode.workchain},
    );
  }
  return decode.hash;
}