DepositResponse.fromJson constructor

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

Implementation

factory DepositResponse.fromJson(Map<String, dynamic> json) {
  Map<String, dynamic>? instructionsJson =
      json['instructions'] == null ? null : json['instructions'];

  Map<String, DepositInstruction>? instructions;
  if (instructionsJson != null) {
    instructions = {};
    instructionsJson.forEach((key, value) {
      instructions![key] = DepositInstruction.fromJson(value);
    });
  }

  return DepositResponse(
      json['how'],
      json['id'],
      convertInt(json['eta']),
      convertDouble(json['min_amount']),
      convertDouble(json['max_amount']),
      convertDouble(json['fee_fixed']),
      convertDouble(json['fee_percent']),
      json['extra_info'] == null
          ? null
          : ExtraInfo.fromJson(json['extra_info']),
      instructions);
}