mapPaymentChannelsResult function

PaymentChannelsResult mapPaymentChannelsResult(
  1. String json
)

Implementation

PaymentChannelsResult mapPaymentChannelsResult(String json) {
  final map = jsonDecode(json);
  switch (map[type]) {
    case success:
      return PaymentChannelsSuccess.fromJson(map);
    case error:
      return PaymentChannelsError(message: map[message]);
    default:
      throw Exception(unknownType);
  }
}