toEstimate method

Map<String, dynamic> toEstimate()

Converts the transaction details into a map for estimating gas.

Implementation

Map<String, dynamic> toEstimate() {
  return {
    if (from != null) "from": from?.address,
    if (to != null) "to": to?.address,
    "value": "0x${value.toRadixString(16)}",
    if (data.isNotEmpty) "data": BytesUtils.toHexString(data, prefix: "0x"),
    if (accessList?.isNotEmpty ?? false)
      "accessList": accessList?.map((e) => e.toJson()).toList()
  };
}