toJson method

  1. @override
Map<String, dynamic> toJson({
  1. bool signatures = true,
  2. bool? visible,
  3. bool rawDataHex = false,
  4. bool txID = false,
})
override

Convert the Transaction object to a JSON representation.

Implementation

@override
Map<String, dynamic> toJson({
  bool signatures = true,
  bool? visible,
  bool rawDataHex = false,
  bool txID = false,
}) {
  return {
    'raw_data': rawData.toJson(),
    if (signatures)
      'signature': signature.map((s) => BytesUtils.toHexString(s)).toList(),
    if (txID) 'txID': rawData.txID,
    if (rawDataHex) 'raw_data_hex': rawData.toHex,
    if (visible != null) 'visible': visible
  };
}