parseAddressBytes static method

List<int> parseAddressBytes({
  1. Object? value,
})

Parses a value into address bytes from a hex string or List<int>.

Implementation

static List<int> parseAddressBytes({Object? value}) {
  try {
    if (value is String) {
      return AptosAddressUtils.addressToBytes(value);
    } else if (value is List) {
      return AptosAddressUtils.praseAddressBytes(value.cast());
    }
  } catch (_) {}
  throw BcsSerializationException(
      "Invalid value for move type 'Address': Expected a List<int> or a hexadecimal string.",
      details: {"value": "$value"});
}