TransactionReceipt.fromJson constructor

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

Implementation

factory TransactionReceipt.fromJson(Map<String, dynamic> json) {
  return TransactionReceipt(
    transactionHash: json['transactionHash'] as String,
    transactionIndex: int.parse(
      (json['transactionIndex'] as String).substring(2),
      radix: 16,
    ),
    blockHash: json['blockHash'] as String,
    blockNumber:
        BigInt.parse((json['blockNumber'] as String).substring(2), radix: 16),
    from: json['from'] as String,
    to: json['to'] as String?,
    cumulativeGasUsed: BigInt.parse(
      (json['cumulativeGasUsed'] as String).substring(2),
      radix: 16,
    ),
    gasUsed:
        BigInt.parse((json['gasUsed'] as String).substring(2), radix: 16),
    contractAddress: json['contractAddress'] as String?,
    logs: (json['logs'] as List)
        .map((l) => Log.fromJson(l as Map<String, dynamic>))
        .toList(),
    status: int.parse((json['status'] as String).substring(2), radix: 16),
    effectiveGasPrice: json['effectiveGasPrice'] != null
        ? BigInt.parse(
            (json['effectiveGasPrice'] as String).substring(2),
            radix: 16,
          )
        : null,
  );
}