toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  return {
    'send_whitelist':
        sendWhitelist.map((e) => e.map((f) => f).toList()).toList(),
    'minting_account': mintingAccount,
    'transaction_window':
        transactionWindow != null ? [transactionWindow?.toJson()] : [],
    'max_message_size_bytes':
        maxMessageSizeBytes != null ? [maxMessageSizeBytes] : [],
    'archive_options':
        archiveOptions != null ? [archiveOptions?.toJson()] : [],
    'initial_values': initialValues
        .map(
          (e) =>
              e.map((f) => f is String ? f : (f as ICPTs).toJson()).toList(),
        )
        .toList(),
  }..removeWhere((key, value) => value == null);
}