TransactionReceipt.fromMap constructor

TransactionReceipt.fromMap(
  1. Map<String, dynamic> map
)

Implementation

TransactionReceipt.fromMap(Map<String, dynamic> map)
    : transactionHash = hexToBytes(map['transactionHash'] as String),
      transactionIndex = hexToDartInt(map['transactionIndex'] as String),
      blockHash = hexToBytes(map['blockHash'] as String),
      blockNumber = map['blockNumber'] != null
          ? BlockNum.exact(int.parse(map['blockNumber'] as String))
          : const BlockNum.pending(),
      from = map['from'] != null
          ? EthereumAddress.fromHex(map['from'] as String)
          : null,
      to = map['to'] != null
          ? EthereumAddress.fromHex(map['to'] as String)
          : null,
      cumulativeGasUsed = hexToInt(map['cumulativeGasUsed'] as String),
      gasUsed =
          map['gasUsed'] != null ? hexToInt(map['gasUsed'] as String) : null,
      effectiveGasPrice = map['effectiveGasPrice'] != null
          ? EtherAmount.inWei(
              BigInt.parse(map['effectiveGasPrice'] as String))
          : null,
      contractAddress = map['contractAddress'] != null
          ? EthereumAddress.fromHex(map['contractAddress'] as String)
          : null,
      status = map['status'] != null
          ? (hexToDartInt(map['status'] as String) == 1)
          : null,
      logs = map['logs'] != null
          ? (map['logs'] as List<dynamic>)
              .map((log) => FilterEvent.fromMap(log as Map<String, dynamic>))
              .toList()
          : [];