2023-07-24 20:23:09 +00:00
|
|
|
import 'dart:core';
|
|
|
|
import 'package:mobx/mobx.dart';
|
|
|
|
import 'package:cw_core/transaction_history.dart';
|
|
|
|
import 'package:cw_nano/nano_transaction_info.dart';
|
|
|
|
|
|
|
|
part 'nano_transaction_history.g.dart';
|
|
|
|
|
|
|
|
class NanoTransactionHistory = NanoTransactionHistoryBase
|
|
|
|
with _$NanoTransactionHistory;
|
|
|
|
|
|
|
|
abstract class NanoTransactionHistoryBase
|
|
|
|
extends TransactionHistoryBase<NanoTransactionInfo> with Store {
|
|
|
|
NanoTransactionHistoryBase() {
|
|
|
|
transactions = ObservableMap<String, NanoTransactionInfo>();
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<void> save() async {}
|
|
|
|
|
|
|
|
@override
|
|
|
|
void addOne(NanoTransactionInfo transaction) =>
|
|
|
|
transactions[transaction.id] = transaction;
|
|
|
|
|
|
|
|
@override
|
2023-07-25 15:21:49 +00:00
|
|
|
void addMany(Map<String, NanoTransactionInfo> transactions) =>
|
2023-07-24 20:23:09 +00:00
|
|
|
this.transactions.addAll(transactions);
|
|
|
|
|
|
|
|
}
|