NwcNotification.fromMap constructor

NwcNotification.fromMap(
  1. Map<String, dynamic> map
)

Implementation

factory NwcNotification.fromMap(Map<String, dynamic> map) {
  return NwcNotification(
    type: map['type'] as String,
    invoice: map['invoice'] as String,
    description: map['description'] as String?,
    descriptionHash: map['description_hash'] as String?,
    preimage: map['preimage'] as String,
    paymentHash: map['payment_hash'] as String,
    amount: map['amount'] as int,
    feesPaid: map['fees_paid'] as int,
    createdAt: map['created_at'] as int,
    expiresAt: map['expires_at'] as int?,
    settledAt: map['settled_at'] as int,
    metadata: map.containsKey('metadata') && map['metadata'] != null
        ? Map<String, dynamic>.from(map['metadata'])
        : null,
  );
}