Transaction.fromJson constructor

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

Create a new Transaction instance by parsing a JSON map.

Implementation

factory Transaction.fromJson(Map<String, dynamic> json) {
  final rawData = TransactionRaw.fromJson(json['raw_data']);
  final signature = (json['signature'] as List)
      .map((s) => BytesUtils.fromHexString(s))
      .toList();

  return Transaction(rawData: rawData, signature: signature);
}