TransactionInfo.fromJson constructor

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

Creates a TransactionInfo instance from a JSON map.

Implementation

factory TransactionInfo.fromJson(Map<String, dynamic> json) {
  return TransactionInfo(
    accessList: (json["accessList"] as List?)
            ?.map((e) => AccessListEntry.fromJson(e))
            .toList() ??
        <AccessListEntry>[],
    blockHash: json['blockHash'],
    blockNumber: PluginIntUtils.hexToInt(json['blockNumber']),
    chainId: PluginBigintUtils.tryHexToBigint(json['chainId']),
    from: json['from'],
    gas: PluginIntUtils.hexToInt(json['gas']),
    gasPrice: PluginIntUtils.tryHexToInt(json['gasPrice']),
    hash: json['hash'],
    input: json['input'],
    maxFeePerGas: PluginIntUtils.tryHexToInt(json['maxFeePerGas']),
    maxPriorityFeePerGas: PluginIntUtils.tryHexToInt(json['maxFeePerGas']),
    nonce: PluginIntUtils.hexToInt(json['nonce']),
    r: json['r'],
    s: json['s'],
    to: json['to'],
    transactionIndex: PluginIntUtils.hexToInt(json['transactionIndex']),
    type: PluginIntUtils.hexToInt(json['type']),
    v: PluginIntUtils.hexToInt(json['v']),
    value: PluginBigintUtils.hexToBigint(json['value']),
    yParity: PluginIntUtils.tryHexToInt(json['yParity']),
  );
}