WitnessUpdateContract.fromJson constructor

WitnessUpdateContract.fromJson(
  1. Map<String, dynamic> json
)

Create a new WitnessUpdateContract instance by parsing a JSON map.

Implementation

factory WitnessUpdateContract.fromJson(Map<String, dynamic> json) {
  final ownerAddress = TronAddress(json['owner_address']);
  final updateUrl = StringUtils.tryEncode(json['update_url']);

  return WitnessUpdateContract(
    ownerAddress: ownerAddress,
    updateUrl: updateUrl,
  );
}