parseTronAddress<T> static method

T parseTronAddress<T>({
  1. required Object? value,
  2. required String name,
})

Implementation

static T parseTronAddress<T>({required Object? value, required String name}) {
  if (value == null && null is T) return null as T;
  if (value == null) {
    throw TronPluginException("Missing parameter: $name.");
  }
  final String result = parseString(value: value, name: name);
  try {
    return TronAddress(result) as T;
  } catch (e) {
    throw TronPluginException("Invalid String value for parameter: $name.");
  }
}