ShieldedTransferContract.fromJson constructor

ShieldedTransferContract.fromJson(
  1. Map<String, dynamic> json
)

Create a new ShieldedTransferContract instance by parsing a JSON map.

Implementation

factory ShieldedTransferContract.fromJson(Map<String, dynamic> json) {
  return ShieldedTransferContract(
    transparentFromAddress:
        BytesUtils.tryFromHexString(json["transparent_from_address"]),
    fromAmount: BigintUtils.tryParse(json["from_amount"]),
    spendDescription: (json["spend_description"] as List?)
        ?.map((desc) => SpendDescription.fromJson(desc))
        .toList(),
    receiveDescription: (json["receive_description"] as List?)
        ?.map((desc) => ReceiveDescription.fromJson(desc))
        .toList(),
    bindingSignature: BytesUtils.tryFromHexString(json["binding_signature"]),
    transparentToAddress:
        BytesUtils.tryFromHexString(json["transparent_to_address"]),
    toAmount: BigintUtils.tryParse(json["to_amount"]),
  );
}