fromMap static method
Create event from a map during deserialization This is a factory method that should be implemented by concrete event classes
Implementation
static TransactionImportedEvent fromMap(Map<String, dynamic> map) {
return TransactionImportedEvent(
walletId: map['walletId'] as String,
txid: map['txid'] as String,
rawHex: map['rawHex'] as String,
blockHeight: map['blockHeight'] as int,
bumpProof: map['bumpProof'] as String,
totalOutputSats: map['totalOutputSats'] as int,
numInputs: map['numInputs'] as int,
numOutputs: map['numOutputs'] as int,
txVersion: map['txVersion'] as int,
txLockTime: map['txLockTime'] as int,
walletReceivingAddresses: (map['walletReceivingAddresses'] as List<dynamic>).cast<String>(),
walletReceivedSats: map['walletReceivedSats'] as int,
totalInputSats: map['totalInputSats'] as int,
sendingAddresses: (map['sendingAddresses'] as List<dynamic>).cast<String>(),
eventId: map['eventId'] as String?,
timestamp: map['timestamp'] != null
? (map['timestamp'] is String
? DateTime.parse(map['timestamp'] as String)
: map['timestamp'] as DateTime)
: null,
version: map['version'] as int?,
metadata: map['metadata'] as Map<String, dynamic>?,
);
}