toJson method

  1. @override
Map<String, dynamic> toJson()
override

Convert the ShieldedTransferContract object to a JSON representation.

Implementation

@override
Map<String, dynamic> toJson() {
  return {
    "transparent_from_address":
        BytesUtils.tryToHexString(transparentFromAddress),
    "from_amount": fromAmount?.toString(),
    "spend_description":
        spendDescription?.map((desc) => desc.toJson()).toList(),
    "receive_description":
        receiveDescription?.map((desc) => desc.toJson()).toList(),
    "binding_signature": BytesUtils.tryToHexString(bindingSignature),
    "transparent_to_address": BytesUtils.tryToHexString(transparentToAddress),
    "to_amount": toAmount?.toString(),
  }..removeWhere((key, value) => value == null);
}