56 lines
1.4 KiB
Dart
56 lines
1.4 KiB
Dart
import 'package:pshared/models/currency.dart';
|
|
|
|
|
|
class Wallet {
|
|
final String id;
|
|
final String walletUserID; // ID or number that we show the user
|
|
final String name;
|
|
final double balance;
|
|
final Currency currency;
|
|
final bool isHidden;
|
|
final DateTime calculatedAt;
|
|
final String? depositAddress;
|
|
final String? network;
|
|
final String? tokenSymbol;
|
|
final String? contractAddress;
|
|
|
|
Wallet({
|
|
required this.id,
|
|
required this.walletUserID,
|
|
required this.name,
|
|
required this.balance,
|
|
required this.currency,
|
|
required this.calculatedAt,
|
|
this.isHidden = true,
|
|
this.depositAddress,
|
|
this.network,
|
|
this.tokenSymbol,
|
|
this.contractAddress,
|
|
});
|
|
|
|
Wallet copyWith({
|
|
String? id,
|
|
String? name,
|
|
double? balance,
|
|
Currency? currency,
|
|
String? walletUserID,
|
|
bool? isHidden,
|
|
String? depositAddress,
|
|
String? network,
|
|
String? tokenSymbol,
|
|
String? contractAddress,
|
|
}) => Wallet(
|
|
id: id ?? this.id,
|
|
name: name ?? this.name,
|
|
balance: balance ?? this.balance,
|
|
currency: currency ?? this.currency,
|
|
walletUserID: walletUserID ?? this.walletUserID,
|
|
isHidden: isHidden ?? this.isHidden,
|
|
calculatedAt: calculatedAt,
|
|
depositAddress: depositAddress ?? this.depositAddress,
|
|
network: network ?? this.network,
|
|
tokenSymbol: tokenSymbol ?? this.tokenSymbol,
|
|
contractAddress: contractAddress ?? this.contractAddress,
|
|
);
|
|
}
|