VoteAssetContract.fromJson constructor

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

Create a new VoteAssetContract instance by parsing a JSON map.

Implementation

factory VoteAssetContract.fromJson(Map<String, dynamic> json) {
  final ownerAddress = TronAddress(json['owner_address']);
  final voteAddress = (json['vote_address'] as List)
      .map((address) => TronAddress(address))
      .toList();

  return VoteAssetContract(
    ownerAddress: ownerAddress,
    voteAddress: voteAddress,
    support: json['support'],
    count: IntUtils.tryParse(json['count']),
  );
}