DepositAsset.fromJson constructor

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

Implementation

factory DepositAsset.fromJson(Map<String, dynamic> json) {
  Map<String, dynamic> fieldsDynamic =
      json['fields'] == null ? null : json['fields'] as Map<String, dynamic>;
  Map<String, AnchorField> assetFields = {};
  if (fieldsDynamic != null) {
    fieldsDynamic.forEach((key, value) {
      assetFields[key] =
          new AnchorField.fromJson(value as Map<String, dynamic>);
    });
  } else {
    assetFields = null;
  }

  return new DepositAsset(
      json['enabled'] as bool,
      json['authentication_required'] as bool,
      convertDouble(json['fee_fixed']),
      convertDouble(json['fee_percent']),
      convertDouble(json['min_amount']),
      convertDouble(json['max_amount']),
      assetFields);
}