mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-03 17:29:23 +00:00
WIP replacement for Map<String, dynamic> transactionObject
This commit is contained in:
parent
b3efbda2e4
commit
b2d2f20b50
1 changed files with 45 additions and 0 deletions
45
lib/models/tx_info.dart
Normal file
45
lib/models/tx_info.dart
Normal file
|
@ -0,0 +1,45 @@
|
|||
import 'package:stackwallet/models/isar/models/blockchain_data/utxo.dart';
|
||||
import 'package:stackwallet/utilities/amount/amount.dart';
|
||||
|
||||
// TODO use something like this instead of Map<String, dynamic> transactionObject
|
||||
|
||||
class TxInfo {
|
||||
final String hex;
|
||||
final List<TxRecipient> recipients;
|
||||
final Amount fee;
|
||||
final int vSize;
|
||||
final List<UTXO>? usedUTXOs;
|
||||
|
||||
TxInfo({
|
||||
required this.hex,
|
||||
required this.recipients,
|
||||
required this.fee,
|
||||
required this.vSize,
|
||||
required this.usedUTXOs,
|
||||
});
|
||||
|
||||
TxInfo copyWith({
|
||||
String? hex,
|
||||
List<TxRecipient>? recipients,
|
||||
Amount? fee,
|
||||
int? vSize,
|
||||
List<UTXO>? usedUTXOs,
|
||||
}) =>
|
||||
TxInfo(
|
||||
hex: hex ?? this.hex,
|
||||
fee: fee ?? this.fee,
|
||||
vSize: vSize ?? this.vSize,
|
||||
usedUTXOs: usedUTXOs ?? this.usedUTXOs,
|
||||
recipients: recipients ?? this.recipients,
|
||||
);
|
||||
}
|
||||
|
||||
class TxRecipient {
|
||||
final String address;
|
||||
final Amount amount;
|
||||
|
||||
TxRecipient({
|
||||
required this.address,
|
||||
required this.amount,
|
||||
});
|
||||
}
|
Loading…
Reference in a new issue