@@ -4,17 +4,16 @@ import 'package:equatable/equatable.dart';
44import 'package:mxc_logic/mxc_logic.dart' ;
55import 'package:mxc_logic/src/domain/entities/moonchain/moonchain_transactions_model/decoded_input.dart' ;
66
7-
87import 'fee.dart' ;
98
109class MoonchainTransactionModel extends Equatable {
11-
1210 /// `dart:convert`
1311 ///
1412 /// Parses the string and returns the resulting Json object as [MoonchainTransactionModel] .
1513 factory MoonchainTransactionModel .fromJson (String data) {
1614 return MoonchainTransactionModel .fromMap (
17- json.decode (data) as Map <String , dynamic >,);
15+ json.decode (data) as Map <String , dynamic >,
16+ );
1817 }
1918
2019 factory MoonchainTransactionModel .fromMap (Map <String , dynamic > data) {
@@ -48,7 +47,8 @@ class MoonchainTransactionModel extends Equatable {
4847 tokenTransfers: (data['token_transfers' ] as List <dynamic >? )
4948 ? .map ((dynamic e) => TokenTransfer .fromMap (e as Map <String , dynamic >))
5049 .toList (),
51- txTypes: (data['tx_types' ] as List <dynamic >? )? .cast <String >(),
50+ transactionTypes:
51+ (data['transaction_types' ] as List <dynamic >? )? .cast <String >(),
5252 gasUsed: data['gas_used' ] as String ? ,
5353 createdContract: data['created_contract' ] as dynamic ,
5454 position: data['position' ] as int ? ,
@@ -66,7 +66,7 @@ class MoonchainTransactionModel extends Equatable {
6666 confirmationDuration: (data['confirmation_duration' ] as List <dynamic >? )
6767 ? .map <double >((dynamic item) => double .parse (item.toString ()))
6868 .toList (),
69- txTag : data['tx_tag ' ] as dynamic ,
69+ transactionTag : data['transaction_tag ' ] as dynamic ,
7070 );
7171 }
7272
@@ -90,7 +90,7 @@ class MoonchainTransactionModel extends Equatable {
9090 this .baseFeePerGas,
9191 this .from,
9292 this .tokenTransfers,
93- this .txTypes ,
93+ this .transactionTypes ,
9494 this .gasUsed,
9595 this .createdContract,
9696 this .position,
@@ -104,7 +104,7 @@ class MoonchainTransactionModel extends Equatable {
104104 this .maxPriorityFeePerGas,
105105 this .revertReason,
106106 this .confirmationDuration,
107- this .txTag ,
107+ this .transactionTag ,
108108 });
109109 final DateTime ? timestamp;
110110 final Fee ? fee;
@@ -125,7 +125,7 @@ class MoonchainTransactionModel extends Equatable {
125125 final String ? baseFeePerGas;
126126 final From ? from;
127127 final List <TokenTransfer >? tokenTransfers;
128- final List <String >? txTypes ;
128+ final List <String >? transactionTypes ;
129129 final String ? gasUsed;
130130 final dynamic createdContract;
131131 final int ? position;
@@ -139,7 +139,7 @@ class MoonchainTransactionModel extends Equatable {
139139 final String ? maxPriorityFeePerGas;
140140 final dynamic revertReason;
141141 final List <double >? confirmationDuration;
142- final dynamic txTag ;
142+ final dynamic transactionTag ;
143143
144144 Map <String , dynamic > toMap () => < String , dynamic > {
145145 'timestamp' : timestamp? .toIso8601String (),
@@ -161,7 +161,7 @@ class MoonchainTransactionModel extends Equatable {
161161 'base_fee_per_gas' : baseFeePerGas,
162162 'from' : from? .toMap (),
163163 'token_transfers' : tokenTransfers? .map ((e) => e.toMap ()).toList (),
164- 'tx_types ' : txTypes ,
164+ 'transaction_types ' : transactionTypes ,
165165 'gas_used' : gasUsed,
166166 'created_contract' : createdContract,
167167 'position' : position,
@@ -175,7 +175,7 @@ class MoonchainTransactionModel extends Equatable {
175175 'max_priority_fee_per_gas' : maxPriorityFeePerGas,
176176 'revert_reason' : revertReason,
177177 'confirmation_duration' : confirmationDuration,
178- 'tx_tag ' : txTag ,
178+ 'transaction_tag ' : transactionTag ,
179179 };
180180
181181 /// `dart:convert`
@@ -239,7 +239,7 @@ class MoonchainTransactionModel extends Equatable {
239239 baseFeePerGas: baseFeePerGas ?? this .baseFeePerGas,
240240 from: from ?? this .from,
241241 tokenTransfers: tokenTransfers ?? this .tokenTransfers,
242- txTypes : txTypes ?? this .txTypes ,
242+ transactionTypes : txTypes ?? this .transactionTypes ,
243243 gasUsed: gasUsed ?? this .gasUsed,
244244 createdContract: createdContract ?? this .createdContract,
245245 position: position ?? this .position,
@@ -255,7 +255,7 @@ class MoonchainTransactionModel extends Equatable {
255255 maxPriorityFeePerGas: maxPriorityFeePerGas ?? this .maxPriorityFeePerGas,
256256 revertReason: revertReason ?? this .revertReason,
257257 confirmationDuration: confirmationDuration ?? this .confirmationDuration,
258- txTag : txTag ?? this .txTag ,
258+ transactionTag : txTag ?? this .transactionTag ,
259259 );
260260 }
261261
@@ -293,7 +293,7 @@ class MoonchainTransactionModel extends Equatable {
293293 baseFeePerGas,
294294 from,
295295 tokenTransfers,
296- txTypes ,
296+ transactionTypes ,
297297 gasUsed,
298298 createdContract,
299299 position,
@@ -307,7 +307,7 @@ class MoonchainTransactionModel extends Equatable {
307307 maxPriorityFeePerGas,
308308 revertReason,
309309 confirmationDuration,
310- txTag ,
310+ transactionTag ,
311311 ];
312312 }
313313}
0 commit comments