2022-08-26 08:11:35 +00:00
|
|
|
import 'package:decimal/decimal.dart';
|
2022-11-30 21:15:06 +00:00
|
|
|
import 'package:flutter/foundation.dart';
|
2023-04-28 20:29:10 +00:00
|
|
|
import 'package:stackwallet/models/exchange/response_objects/estimate.dart';
|
2022-10-03 00:54:35 +00:00
|
|
|
import 'package:stackwallet/models/exchange/response_objects/trade.dart';
|
2023-02-08 22:46:30 +00:00
|
|
|
import 'package:stackwallet/utilities/enums/exchange_rate_type_enum.dart';
|
2022-08-26 08:11:35 +00:00
|
|
|
|
2022-11-30 21:15:06 +00:00
|
|
|
class IncompleteExchangeModel extends ChangeNotifier {
|
2022-08-26 08:11:35 +00:00
|
|
|
final String sendTicker;
|
|
|
|
final String receiveTicker;
|
|
|
|
|
|
|
|
final String rateInfo;
|
|
|
|
|
|
|
|
final Decimal sendAmount;
|
|
|
|
final Decimal receiveAmount;
|
|
|
|
|
|
|
|
final ExchangeRateType rateType;
|
|
|
|
|
2022-10-04 00:55:12 +00:00
|
|
|
final bool reversed;
|
2023-02-09 13:31:31 +00:00
|
|
|
final bool walletInitiated;
|
2022-10-04 00:55:12 +00:00
|
|
|
|
2022-11-30 21:15:06 +00:00
|
|
|
String? _recipientAddress;
|
2022-08-26 08:11:35 +00:00
|
|
|
|
2022-11-30 21:15:06 +00:00
|
|
|
String? get recipientAddress => _recipientAddress;
|
2022-08-26 08:11:35 +00:00
|
|
|
|
2022-11-30 21:15:06 +00:00
|
|
|
set recipientAddress(String? recipientAddress) {
|
|
|
|
if (_recipientAddress != recipientAddress) {
|
|
|
|
_recipientAddress = recipientAddress;
|
|
|
|
notifyListeners();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
String? _refundAddress;
|
|
|
|
|
|
|
|
String? get refundAddress => _refundAddress;
|
|
|
|
|
|
|
|
set refundAddress(String? refundAddress) {
|
|
|
|
if (_refundAddress != refundAddress) {
|
|
|
|
_refundAddress = refundAddress;
|
|
|
|
notifyListeners();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-04-28 20:29:10 +00:00
|
|
|
Estimate? _estimate;
|
2022-11-30 21:15:06 +00:00
|
|
|
|
2023-04-28 20:29:10 +00:00
|
|
|
Estimate? get estimate => _estimate;
|
2022-11-30 21:15:06 +00:00
|
|
|
|
2023-04-28 20:29:10 +00:00
|
|
|
set estimate(Estimate? estimate) {
|
|
|
|
if (_estimate != estimate) {
|
|
|
|
_estimate = estimate;
|
2022-11-30 21:15:06 +00:00
|
|
|
notifyListeners();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Trade? _trade;
|
|
|
|
|
|
|
|
Trade? get trade => _trade;
|
|
|
|
|
|
|
|
set trade(Trade? trade) {
|
|
|
|
if (_trade != trade) {
|
|
|
|
_trade = trade;
|
|
|
|
notifyListeners();
|
|
|
|
}
|
|
|
|
}
|
2022-08-26 08:11:35 +00:00
|
|
|
|
|
|
|
IncompleteExchangeModel({
|
|
|
|
required this.sendTicker,
|
|
|
|
required this.receiveTicker,
|
|
|
|
required this.rateInfo,
|
|
|
|
required this.sendAmount,
|
|
|
|
required this.receiveAmount,
|
|
|
|
required this.rateType,
|
2022-10-04 00:55:12 +00:00
|
|
|
required this.reversed,
|
2023-02-09 13:31:31 +00:00
|
|
|
required this.walletInitiated,
|
2023-04-28 20:29:10 +00:00
|
|
|
Estimate? estimate,
|
|
|
|
}) : _estimate = estimate;
|
2022-08-26 08:11:35 +00:00
|
|
|
}
|