toJson method

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

Convert the SpendDescription object to a JSON representation.

Implementation

@override
Map<String, dynamic> toJson() {
  return {
    'value_commitment': BytesUtils.tryToHexString(valueCommitment),
    'anchor': BytesUtils.tryToHexString(anchor),
    'nullifier': BytesUtils.tryToHexString(nullifier),
    'rk': BytesUtils.tryToHexString(rk),
    'zkproof': BytesUtils.tryToHexString(zkproof),
    'spend_authority_signature':
        BytesUtils.tryToHexString(spendAuthoritySignature),
  }..removeWhere((key, value) => value == null);
}