TransactionReceipt.fromJson constructor

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

Creates a TransactionReceipt instance from a JSON map.

Implementation

factory TransactionReceipt.fromJson(Map<String, dynamic> json) {
  final List<LogEntry> logs =
      (json["logs"] as List?)?.map((e) => LogEntry.fromJson(e)).toList() ??
          <LogEntry>[];
  return TransactionReceipt(
    logs: logs,
    blockHash: json['blockHash'],
    blockNumber: PluginIntUtils.tryHexToInt(json['blockNumber']),
    contractAddress: json['contractAddress'],
    cumulativeGasUsed: PluginIntUtils.tryHexToInt(json['cumulativeGasUsed']),
    effectiveGasPrice: PluginIntUtils.tryHexToInt(json['effectiveGasPrice']),
    from: json['from'],
    gasUsed: PluginIntUtils.tryHexToInt(json['gasUsed']),
    logsBloom: json['logsBloom'],
    status: PluginBooleanUtils.tryHexToBool(json['status']),
    to: json['to'],
    transactionHash: json['transactionHash'],
    transactionIndex: PluginIntUtils.tryHexToInt(json['transactionIndex']),
    type: PluginIntUtils.hexToInt(json['type']),
  );
}