toJson method
Implementation
Map<String, dynamic> toJson() {
return {
'accessList': accessList?.map((e) => e.toJson()).toList(),
'authorizationList': authorizationList?.map((e) => e.toJson()).toList(),
'blobVersionedHashes': blobVersionedHashes,
'maxFeePerBlobGas':
maxFeePerBlobGas != null
? '0x${maxFeePerBlobGas!.toRadixString(16)}'
: null,
'blockHash': blockHash,
'blockNumber': '0x${blockNumber.toRadixString(16)}',
'chainId': chainId != null ? '0x${chainId!.toRadixString(16)}' : null,
'from': from,
'gas': '0x${gas.toRadixString(16)}',
'gasPrice': gasPrice != null ? '0x${gasPrice!.toRadixString(16)}' : null,
'hash': hash,
'input': input,
'maxFeePerGas':
maxFeePerGas != null ? '0x${maxFeePerGas!.toRadixString(16)}' : null,
'maxPriorityFeePerGas':
maxPriorityFeePerGas != null
? '0x${maxPriorityFeePerGas!.toRadixString(16)}'
: null,
'nonce': '0x${nonce.toRadixString(16)}',
'r': r,
's': r,
'to': to,
'transactionIndex': '0x${transactionIndex.toRadixString(16)}',
'type': '0x${type.toRadixString(16)}',
'v': '0x${v.toRadixString(16)}',
'value': '0x${value.toRadixString(16)}',
'yParity': yParity != null ? '0x${yParity!.toRadixString(16)}' : null,
'l1BatchNumber':
l1BatchNumber != null
? '0x${l1BatchNumber!.toRadixString(16)}'
: null,
'l1BatchTxIndex':
l1BatchTxIndex != null
? '0x${l1BatchTxIndex!.toRadixString(16)}'
: null,
}.notNullValue;
}