BlockInformation.fromJson constructor
Implementation
factory BlockInformation.fromJson(Map<String, dynamic> json) {
return BlockInformation(
number: BigInt.parse(json['number']),
baseFeePerGas: json.containsKey('baseFeePerGas')
? EtherAmount.fromBigInt(
EtherUnit.wei,
hexToInt(json['baseFeePerGas'] as String),
)
: null,
timestamp: DateTime.fromMillisecondsSinceEpoch(
hexToDartInt(json['timestamp'] as String) * 1000,
isUtc: true,
),
);
}