mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-12-03 12:24:19 +01:00
Cw 498 improve wallet accounts (#1152)
* CW-498 Call updateTransactions on account change * CW-498 Code Cleanup * CW-498 Add Wallet Address to trade to match transactions to trades * CW-498 Fix containsAddress to include only addresses of account * Handle nullability for fromWalletAddress --------- Co-authored-by: OmarHatem <omarh.ismail1@gmail.com>
This commit is contained in:
co-authored by
OmarHatem
parent
5bd382f186
commit
e5d99313eb
@@ -27,6 +27,7 @@ class Trade extends HiveObject {
|
||||
this.password,
|
||||
this.providerId,
|
||||
this.providerName,
|
||||
this.fromWalletAddress
|
||||
}) {
|
||||
if (provider != null) providerRaw = provider.raw;
|
||||
|
||||
@@ -101,6 +102,9 @@ class Trade extends HiveObject {
|
||||
@HiveField(16)
|
||||
String? providerName;
|
||||
|
||||
@HiveField(17)
|
||||
String? fromWalletAddress;
|
||||
|
||||
static Trade fromMap(Map<String, Object?> map) {
|
||||
return Trade(
|
||||
id: map['id'] as String,
|
||||
@@ -110,7 +114,9 @@ class Trade extends HiveObject {
|
||||
createdAt:
|
||||
map['date'] != null ? DateTime.fromMillisecondsSinceEpoch(map['date'] as int) : null,
|
||||
amount: map['amount'] as String,
|
||||
walletId: map['wallet_id'] as String);
|
||||
walletId: map['wallet_id'] as String,
|
||||
fromWalletAddress: map['from_wallet_address'] as String?
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
@@ -121,7 +127,8 @@ class Trade extends HiveObject {
|
||||
'output': to.serialize(),
|
||||
'date': createdAt != null ? createdAt!.millisecondsSinceEpoch : null,
|
||||
'amount': amount,
|
||||
'wallet_id': walletId
|
||||
'wallet_id': walletId,
|
||||
'from_wallet_address': fromWalletAddress
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user