TransactionBody.fromJson constructor

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

Implementation

factory TransactionBody.fromJson(Map<String, dynamic> json) {
  return TransactionBody(
      inputs: json["inputs"] == null
          ? null
          : TransactionInputs.fromJson(json["inputs"]),
      outputs: json["outputs"] != null
          ? TransactionOutputs.fromJson(json["outputs"])
          : null,
      fee: BigintUtils.parse(json['fee']),
      ttl: BigintUtils.tryParse(json['ttl']),
      certificates: json["certificates"] == null
          ? null
          : Certificates.fromJson(json["certificates"]),
      withdrawals: json['withdrawals'] == null
          ? null
          : Withdrawals.fromJson(json['withdrawals']),
      update: json['update'] == null ? null : Update.fromJson(json['update']),
      auxiliaryDataHash: json['auxiliary_data_hash'] == null
          ? null
          : AuxiliaryDataHash.fromHex(json['auxiliary_data_hash']),
      validityStartInterval:
          BigintUtils.tryParse(json['validity_start_interval']),
      mint: json['mint'] == null ? null : Mint.fromJson(json['mint']),
      scriptDataHash: json['script_data_hash'] == null
          ? null
          : ScriptDataHash.fromHex(json['script_data_hash']),
      collateral: json["collateral"] == null
          ? null
          : TransactionInputs.fromJson(json["collateral"]),
      requiredSigners: json["required_signers"] == null
          ? null
          : RequiredSigners.fromJson(json["required_signers"]),
      network: json['network_id'] == null
          ? null
          : ADANetwork.fromTag(json['network_id']),
      collateralReturn: json['collateral_return'] == null
          ? null
          : TransactionOutput.fromJson(json['collateral_return']),
      referenceInputs: json['reference_inputs'] == null
          ? null
          : TransactionInputs.fromJson(json['reference_inputs']),
      totalCollateral: BigintUtils.tryParse(json['total_collateral']),
      votingProcedures: json["voting_procedures"] == null
          ? null
          : VotingProcedures.fromJson(json["voting_procedures"]),
      votingProposals: json["voting_proposals"] == null
          ? null
          : VotingProposals.fromJson(json["voting_proposals"]),
      currentTreasuryValue:
          BigintUtils.tryParse(json["current_treasury_value"]),
      donation: BigintUtils.tryParse(json["donation"]),
      serializationConfig: TransactionBodySerializationConfig.fromJson(
          json["serialization_config"] ?? {}));
}