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 TransactionRecordedEvent fromMap(Map<String, dynamic> map) {
return TransactionRecordedEvent(
walletId: map['walletId'] as String,
txid: map['txid'] as String,
rawHex: map['rawHex'] as String,
totalInputSats: map['totalInputSats'] as int,
totalOutputSats: map['totalOutputSats'] as int,
fee: map['fee'] as int,
numInputs: map['numInputs'] as int,
numOutputs: map['numOutputs'] as int,
txVersion: map['txVersion'] as int,
txLockTime: map['txLockTime'] as int,
spentUtxoKeys: List<String>.from(map['spentUtxoKeys'] as List),
recipientAddresses: List<String>.from(map['recipientAddresses'] as List),
paymentAmount: map['paymentAmount'] as String,
changeAddress: map['changeAddress'] as String?,
changeAmount: map['changeAmount'] as 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>?,
);
}