toJson method

  1. @override
Map<String, dynamic> toJson()
override

Converts the data to a JSON representation.

Implementation

@override
Map<String, dynamic> toJson() {
  return {
    "timestamp": timestamp,
    "tx_trie_root": BytesUtils.tryToHexString(txTrieRoot),
    "parent_hash": BytesUtils.tryToHexString(parentHash),
    "number": number,
    "witness_id": witnessId,
    "witness_address": BytesUtils.tryToHexString(witnessAddress),
    "version": version,
    "account_state_root": BytesUtils.tryToHexString(accountStateRoot),
  }..removeWhere((key, value) => value == null);
}