DelegateResourceContract.fromJson constructor

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

Create a new DelegateResourceContract instance by parsing a JSON map.

Implementation

factory DelegateResourceContract.fromJson(Map<String, dynamic> json) {
  return DelegateResourceContract(
      ownerAddress: TronAddress(json["owner_address"]),
      balance: BigintUtils.parse(json["balance"]),
      receiverAddress: TronAddress(json["receiver_address"]),
      lock: json["lock"],
      resource: ResourceCode.fromName(json["resource"]),
      lockPeriod: BigintUtils.tryParse(json["lock_period"]));
}