2023-12-02 09:42:00 +00:00
|
|
|
import 'package:cw_zano/api/model/destination.dart';
|
|
|
|
|
|
|
|
class TransferParams {
|
|
|
|
final List<Destination> destinations;
|
|
|
|
final int fee;
|
|
|
|
final int mixin;
|
|
|
|
final String paymentId;
|
|
|
|
final String comment;
|
|
|
|
final bool pushPayer;
|
|
|
|
final bool hideReceiver;
|
|
|
|
|
|
|
|
TransferParams({
|
|
|
|
required this.destinations,
|
|
|
|
required this.fee,
|
|
|
|
required this.mixin,
|
|
|
|
required this.paymentId,
|
|
|
|
required this.comment,
|
|
|
|
required this.pushPayer,
|
|
|
|
required this.hideReceiver,
|
|
|
|
});
|
|
|
|
|
|
|
|
Map<String, dynamic> toJson() => {
|
2024-03-10 02:51:30 +00:00
|
|
|
'destinations': destinations,
|
|
|
|
'fee': fee,
|
|
|
|
'mixin': mixin,
|
|
|
|
'payment_id': paymentId,
|
|
|
|
'comment': comment,
|
|
|
|
'push_payer': pushPayer,
|
|
|
|
'hide_receiver': hideReceiver,
|
2023-12-02 09:42:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
factory TransferParams.fromJson(Map<String, dynamic> json) => TransferParams(
|
2024-03-08 10:50:34 +00:00
|
|
|
destinations: (json['destinations'] as List<dynamic>?)?.map((e) => Destination.fromJson(e as Map<String, dynamic>)).toList() ?? [],
|
|
|
|
fee: json['fee'] as int? ?? 0,
|
|
|
|
mixin: json['mixin'] as int? ?? 0,
|
|
|
|
paymentId: json['payment_id'] as String? ?? '',
|
|
|
|
comment: json['comment'] as String? ?? '',
|
2024-03-10 02:51:30 +00:00
|
|
|
pushPayer: json['push_payer'] as bool? ?? false,
|
|
|
|
hideReceiver: json['hide_receiver'] as bool? ?? false,
|
2023-12-02 09:42:00 +00:00
|
|
|
);
|
|
|
|
}
|