diff --git a/CHANGELOG.md b/CHANGELOG.md index 994d789..7953de4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.16.2 + +- fix transfer entry. + ## 0.16.1 - difficulty member type changed in GetInfoResult. diff --git a/lib/src/data_transfer_objects/dtos.dart b/lib/src/data_transfer_objects/dtos.dart index 4c91efb..c0e1b31 100644 --- a/lib/src/data_transfer_objects/dtos.dart +++ b/lib/src/data_transfer_objects/dtos.dart @@ -64,4 +64,5 @@ export 'wallet/split_address/split_address_params.dart'; export 'wallet/split_address/split_address_result.dart'; export 'wallet/transaction_entry/transaction_entry.dart'; export 'wallet/transaction_entry/transaction_entry_type.dart'; -export 'wallet/transaction_entry/transfer_entry.dart'; +export 'wallet/transaction_entry/transfer_in_entry.dart'; +export 'wallet/transaction_entry/transfer_out_entry.dart'; diff --git a/lib/src/data_transfer_objects/wallet/transaction_entry/transaction_entry_type.dart b/lib/src/data_transfer_objects/wallet/transaction_entry/transaction_entry_type.dart index e890183..5e23aaa 100644 --- a/lib/src/data_transfer_objects/wallet/transaction_entry/transaction_entry_type.dart +++ b/lib/src/data_transfer_objects/wallet/transaction_entry/transaction_entry_type.dart @@ -20,11 +20,11 @@ sealed class TransactionEntryType with _$TransactionEntryType { const factory TransactionEntryType.incoming({ @JsonKey(name: 'from') required String from, - @JsonKey(name: 'transfers') required List transfers, + @JsonKey(name: 'transfers') required List transfers, }) = IncomingEntry; const factory TransactionEntryType.outgoing({ - @JsonKey(name: 'transfers') required List transfers, + @JsonKey(name: 'transfers') required List transfers, }) = OutgoingEntry; factory TransactionEntryType.fromJson(Map json) => diff --git a/lib/src/data_transfer_objects/wallet/transaction_entry/transaction_entry_type.freezed.dart b/lib/src/data_transfer_objects/wallet/transaction_entry/transaction_entry_type.freezed.dart index 696ef0c..a1697f8 100644 --- a/lib/src/data_transfer_objects/wallet/transaction_entry/transaction_entry_type.freezed.dart +++ b/lib/src/data_transfer_objects/wallet/transaction_entry/transaction_entry_type.freezed.dart @@ -43,10 +43,10 @@ mixin _$TransactionEntryType { @JsonKey(name: 'amount') int amount) burn, required TResult Function(@JsonKey(name: 'from') String from, - @JsonKey(name: 'transfers') List transfers) + @JsonKey(name: 'transfers') List transfers) incoming, required TResult Function( - @JsonKey(name: 'transfers') List transfers) + @JsonKey(name: 'transfers') List transfers) outgoing, }) => throw _privateConstructorUsedError; @@ -57,10 +57,10 @@ mixin _$TransactionEntryType { @JsonKey(name: 'amount') int amount)? burn, TResult? Function(@JsonKey(name: 'from') String from, - @JsonKey(name: 'transfers') List transfers)? + @JsonKey(name: 'transfers') List transfers)? incoming, TResult? Function( - @JsonKey(name: 'transfers') List transfers)? + @JsonKey(name: 'transfers') List transfers)? outgoing, }) => throw _privateConstructorUsedError; @@ -71,9 +71,10 @@ mixin _$TransactionEntryType { @JsonKey(name: 'amount') int amount)? burn, TResult Function(@JsonKey(name: 'from') String from, - @JsonKey(name: 'transfers') List transfers)? + @JsonKey(name: 'transfers') List transfers)? incoming, - TResult Function(@JsonKey(name: 'transfers') List transfers)? + TResult Function( + @JsonKey(name: 'transfers') List transfers)? outgoing, required TResult orElse(), }) => @@ -204,10 +205,10 @@ class _$CoinbaseEntryImpl implements CoinbaseEntry { @JsonKey(name: 'amount') int amount) burn, required TResult Function(@JsonKey(name: 'from') String from, - @JsonKey(name: 'transfers') List transfers) + @JsonKey(name: 'transfers') List transfers) incoming, required TResult Function( - @JsonKey(name: 'transfers') List transfers) + @JsonKey(name: 'transfers') List transfers) outgoing, }) { return coinbase(reward); @@ -221,10 +222,10 @@ class _$CoinbaseEntryImpl implements CoinbaseEntry { @JsonKey(name: 'amount') int amount)? burn, TResult? Function(@JsonKey(name: 'from') String from, - @JsonKey(name: 'transfers') List transfers)? + @JsonKey(name: 'transfers') List transfers)? incoming, TResult? Function( - @JsonKey(name: 'transfers') List transfers)? + @JsonKey(name: 'transfers') List transfers)? outgoing, }) { return coinbase?.call(reward); @@ -238,9 +239,10 @@ class _$CoinbaseEntryImpl implements CoinbaseEntry { @JsonKey(name: 'amount') int amount)? burn, TResult Function(@JsonKey(name: 'from') String from, - @JsonKey(name: 'transfers') List transfers)? + @JsonKey(name: 'transfers') List transfers)? incoming, - TResult Function(@JsonKey(name: 'transfers') List transfers)? + TResult Function( + @JsonKey(name: 'transfers') List transfers)? outgoing, required TResult orElse(), }) { @@ -402,10 +404,10 @@ class _$BurnEntryImpl implements BurnEntry { @JsonKey(name: 'amount') int amount) burn, required TResult Function(@JsonKey(name: 'from') String from, - @JsonKey(name: 'transfers') List transfers) + @JsonKey(name: 'transfers') List transfers) incoming, required TResult Function( - @JsonKey(name: 'transfers') List transfers) + @JsonKey(name: 'transfers') List transfers) outgoing, }) { return burn(asset, amount); @@ -419,10 +421,10 @@ class _$BurnEntryImpl implements BurnEntry { @JsonKey(name: 'amount') int amount)? burn, TResult? Function(@JsonKey(name: 'from') String from, - @JsonKey(name: 'transfers') List transfers)? + @JsonKey(name: 'transfers') List transfers)? incoming, TResult? Function( - @JsonKey(name: 'transfers') List transfers)? + @JsonKey(name: 'transfers') List transfers)? outgoing, }) { return burn?.call(asset, amount); @@ -436,9 +438,10 @@ class _$BurnEntryImpl implements BurnEntry { @JsonKey(name: 'amount') int amount)? burn, TResult Function(@JsonKey(name: 'from') String from, - @JsonKey(name: 'transfers') List transfers)? + @JsonKey(name: 'transfers') List transfers)? incoming, - TResult Function(@JsonKey(name: 'transfers') List transfers)? + TResult Function( + @JsonKey(name: 'transfers') List transfers)? outgoing, required TResult orElse(), }) { @@ -518,7 +521,7 @@ abstract class _$$IncomingEntryImplCopyWith<$Res> { @useResult $Res call( {@JsonKey(name: 'from') String from, - @JsonKey(name: 'transfers') List transfers}); + @JsonKey(name: 'transfers') List transfers}); } /// @nodoc @@ -543,7 +546,7 @@ class __$$IncomingEntryImplCopyWithImpl<$Res> transfers: null == transfers ? _value._transfers : transfers // ignore: cast_nullable_to_non_nullable - as List, + as List, )); } } @@ -553,7 +556,8 @@ class __$$IncomingEntryImplCopyWithImpl<$Res> class _$IncomingEntryImpl implements IncomingEntry { const _$IncomingEntryImpl( {@JsonKey(name: 'from') required this.from, - @JsonKey(name: 'transfers') required final List transfers, + @JsonKey(name: 'transfers') + required final List transfers, final String? $type}) : _transfers = transfers, $type = $type ?? 'incoming'; @@ -564,10 +568,10 @@ class _$IncomingEntryImpl implements IncomingEntry { @override @JsonKey(name: 'from') final String from; - final List _transfers; + final List _transfers; @override @JsonKey(name: 'transfers') - List get transfers { + List get transfers { if (_transfers is EqualUnmodifiableListView) return _transfers; // ignore: implicit_dynamic_type return EqualUnmodifiableListView(_transfers); @@ -610,10 +614,10 @@ class _$IncomingEntryImpl implements IncomingEntry { @JsonKey(name: 'amount') int amount) burn, required TResult Function(@JsonKey(name: 'from') String from, - @JsonKey(name: 'transfers') List transfers) + @JsonKey(name: 'transfers') List transfers) incoming, required TResult Function( - @JsonKey(name: 'transfers') List transfers) + @JsonKey(name: 'transfers') List transfers) outgoing, }) { return incoming(from, transfers); @@ -627,10 +631,10 @@ class _$IncomingEntryImpl implements IncomingEntry { @JsonKey(name: 'amount') int amount)? burn, TResult? Function(@JsonKey(name: 'from') String from, - @JsonKey(name: 'transfers') List transfers)? + @JsonKey(name: 'transfers') List transfers)? incoming, TResult? Function( - @JsonKey(name: 'transfers') List transfers)? + @JsonKey(name: 'transfers') List transfers)? outgoing, }) { return incoming?.call(from, transfers); @@ -644,9 +648,10 @@ class _$IncomingEntryImpl implements IncomingEntry { @JsonKey(name: 'amount') int amount)? burn, TResult Function(@JsonKey(name: 'from') String from, - @JsonKey(name: 'transfers') List transfers)? + @JsonKey(name: 'transfers') List transfers)? incoming, - TResult Function(@JsonKey(name: 'transfers') List transfers)? + TResult Function( + @JsonKey(name: 'transfers') List transfers)? outgoing, required TResult orElse(), }) { @@ -705,7 +710,7 @@ abstract class IncomingEntry implements TransactionEntryType { const factory IncomingEntry( {@JsonKey(name: 'from') required final String from, @JsonKey(name: 'transfers') - required final List transfers}) = _$IncomingEntryImpl; + required final List transfers}) = _$IncomingEntryImpl; factory IncomingEntry.fromJson(Map json) = _$IncomingEntryImpl.fromJson; @@ -713,7 +718,7 @@ abstract class IncomingEntry implements TransactionEntryType { @JsonKey(name: 'from') String get from; @JsonKey(name: 'transfers') - List get transfers; + List get transfers; @JsonKey(ignore: true) _$$IncomingEntryImplCopyWith<_$IncomingEntryImpl> get copyWith => throw _privateConstructorUsedError; @@ -725,7 +730,7 @@ abstract class _$$OutgoingEntryImplCopyWith<$Res> { _$OutgoingEntryImpl value, $Res Function(_$OutgoingEntryImpl) then) = __$$OutgoingEntryImplCopyWithImpl<$Res>; @useResult - $Res call({@JsonKey(name: 'transfers') List transfers}); + $Res call({@JsonKey(name: 'transfers') List transfers}); } /// @nodoc @@ -745,7 +750,7 @@ class __$$OutgoingEntryImplCopyWithImpl<$Res> transfers: null == transfers ? _value._transfers : transfers // ignore: cast_nullable_to_non_nullable - as List, + as List, )); } } @@ -754,7 +759,8 @@ class __$$OutgoingEntryImplCopyWithImpl<$Res> @JsonSerializable() class _$OutgoingEntryImpl implements OutgoingEntry { const _$OutgoingEntryImpl( - {@JsonKey(name: 'transfers') required final List transfers, + {@JsonKey(name: 'transfers') + required final List transfers, final String? $type}) : _transfers = transfers, $type = $type ?? 'outgoing'; @@ -762,10 +768,10 @@ class _$OutgoingEntryImpl implements OutgoingEntry { factory _$OutgoingEntryImpl.fromJson(Map json) => _$$OutgoingEntryImplFromJson(json); - final List _transfers; + final List _transfers; @override @JsonKey(name: 'transfers') - List get transfers { + List get transfers { if (_transfers is EqualUnmodifiableListView) return _transfers; // ignore: implicit_dynamic_type return EqualUnmodifiableListView(_transfers); @@ -807,10 +813,10 @@ class _$OutgoingEntryImpl implements OutgoingEntry { @JsonKey(name: 'amount') int amount) burn, required TResult Function(@JsonKey(name: 'from') String from, - @JsonKey(name: 'transfers') List transfers) + @JsonKey(name: 'transfers') List transfers) incoming, required TResult Function( - @JsonKey(name: 'transfers') List transfers) + @JsonKey(name: 'transfers') List transfers) outgoing, }) { return outgoing(transfers); @@ -824,10 +830,10 @@ class _$OutgoingEntryImpl implements OutgoingEntry { @JsonKey(name: 'amount') int amount)? burn, TResult? Function(@JsonKey(name: 'from') String from, - @JsonKey(name: 'transfers') List transfers)? + @JsonKey(name: 'transfers') List transfers)? incoming, TResult? Function( - @JsonKey(name: 'transfers') List transfers)? + @JsonKey(name: 'transfers') List transfers)? outgoing, }) { return outgoing?.call(transfers); @@ -841,9 +847,10 @@ class _$OutgoingEntryImpl implements OutgoingEntry { @JsonKey(name: 'amount') int amount)? burn, TResult Function(@JsonKey(name: 'from') String from, - @JsonKey(name: 'transfers') List transfers)? + @JsonKey(name: 'transfers') List transfers)? incoming, - TResult Function(@JsonKey(name: 'transfers') List transfers)? + TResult Function( + @JsonKey(name: 'transfers') List transfers)? outgoing, required TResult orElse(), }) { @@ -901,13 +908,13 @@ class _$OutgoingEntryImpl implements OutgoingEntry { abstract class OutgoingEntry implements TransactionEntryType { const factory OutgoingEntry( {@JsonKey(name: 'transfers') - required final List transfers}) = _$OutgoingEntryImpl; + required final List transfers}) = _$OutgoingEntryImpl; factory OutgoingEntry.fromJson(Map json) = _$OutgoingEntryImpl.fromJson; @JsonKey(name: 'transfers') - List get transfers; + List get transfers; @JsonKey(ignore: true) _$$OutgoingEntryImplCopyWith<_$OutgoingEntryImpl> get copyWith => throw _privateConstructorUsedError; diff --git a/lib/src/data_transfer_objects/wallet/transaction_entry/transaction_entry_type.g.dart b/lib/src/data_transfer_objects/wallet/transaction_entry/transaction_entry_type.g.dart index dfcf019..65be5c4 100644 --- a/lib/src/data_transfer_objects/wallet/transaction_entry/transaction_entry_type.g.dart +++ b/lib/src/data_transfer_objects/wallet/transaction_entry/transaction_entry_type.g.dart @@ -38,7 +38,7 @@ _$IncomingEntryImpl _$$IncomingEntryImplFromJson(Map json) => _$IncomingEntryImpl( from: json['from'] as String, transfers: (json['transfers'] as List) - .map((e) => TransferEntry.fromJson(e as Map)) + .map((e) => TransferInEntry.fromJson(e as Map)) .toList(), $type: json['runtimeType'] as String?, ); @@ -53,7 +53,7 @@ Map _$$IncomingEntryImplToJson(_$IncomingEntryImpl instance) => _$OutgoingEntryImpl _$$OutgoingEntryImplFromJson(Map json) => _$OutgoingEntryImpl( transfers: (json['transfers'] as List) - .map((e) => TransferEntry.fromJson(e as Map)) + .map((e) => TransferOutEntry.fromJson(e as Map)) .toList(), $type: json['runtimeType'] as String?, ); diff --git a/lib/src/data_transfer_objects/wallet/transaction_entry/transfer_entry.dart b/lib/src/data_transfer_objects/wallet/transaction_entry/transfer_entry.dart deleted file mode 100644 index 4828518..0000000 --- a/lib/src/data_transfer_objects/wallet/transaction_entry/transfer_entry.dart +++ /dev/null @@ -1,20 +0,0 @@ -// ignore_for_file: public_member_api_docs, invalid_annotation_target - -import 'package:freezed_annotation/freezed_annotation.dart'; - -part 'transfer_entry.freezed.dart'; - -part 'transfer_entry.g.dart'; - -@freezed -class TransferEntry with _$TransferEntry { - const factory TransferEntry({ - @JsonKey(name: 'amount') required int amount, - @JsonKey(name: 'asset') required String asset, - @JsonKey(name: 'extra_data') required dynamic extraData, - @JsonKey(name: 'key') required String key, - }) = _TransferEntry; - - factory TransferEntry.fromJson(Map json) => - _$TransferEntryFromJson(json); -} diff --git a/lib/src/data_transfer_objects/wallet/transaction_entry/transfer_in_entry.dart b/lib/src/data_transfer_objects/wallet/transaction_entry/transfer_in_entry.dart new file mode 100644 index 0000000..210b132 --- /dev/null +++ b/lib/src/data_transfer_objects/wallet/transaction_entry/transfer_in_entry.dart @@ -0,0 +1,19 @@ +// ignore_for_file: public_member_api_docs, invalid_annotation_target + +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'transfer_in_entry.freezed.dart'; + +part 'transfer_in_entry.g.dart'; + +@freezed +class TransferInEntry with _$TransferInEntry { + const factory TransferInEntry({ + @JsonKey(name: 'amount') required int amount, + @JsonKey(name: 'asset') required String asset, + @JsonKey(name: 'extra_data') required dynamic extraData, + }) = _TransferInEntry; + + factory TransferInEntry.fromJson(Map json) => + _$TransferInEntryFromJson(json); +} diff --git a/lib/src/data_transfer_objects/wallet/transaction_entry/transfer_entry.freezed.dart b/lib/src/data_transfer_objects/wallet/transaction_entry/transfer_in_entry.freezed.dart similarity index 57% rename from lib/src/data_transfer_objects/wallet/transaction_entry/transfer_entry.freezed.dart rename to lib/src/data_transfer_objects/wallet/transaction_entry/transfer_in_entry.freezed.dart index f823e2a..6b91d0c 100644 --- a/lib/src/data_transfer_objects/wallet/transaction_entry/transfer_entry.freezed.dart +++ b/lib/src/data_transfer_objects/wallet/transaction_entry/transfer_in_entry.freezed.dart @@ -3,7 +3,7 @@ // ignore_for_file: type=lint // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark -part of 'transfer_entry.dart'; +part of 'transfer_in_entry.dart'; // ************************************************************************** // FreezedGenerator @@ -14,44 +14,41 @@ T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); -TransferEntry _$TransferEntryFromJson(Map json) { - return _TransferEntry.fromJson(json); +TransferInEntry _$TransferInEntryFromJson(Map json) { + return _TransferInEntry.fromJson(json); } /// @nodoc -mixin _$TransferEntry { +mixin _$TransferInEntry { @JsonKey(name: 'amount') int get amount => throw _privateConstructorUsedError; @JsonKey(name: 'asset') String get asset => throw _privateConstructorUsedError; @JsonKey(name: 'extra_data') dynamic get extraData => throw _privateConstructorUsedError; - @JsonKey(name: 'key') - String get key => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) - $TransferEntryCopyWith get copyWith => + $TransferInEntryCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class $TransferEntryCopyWith<$Res> { - factory $TransferEntryCopyWith( - TransferEntry value, $Res Function(TransferEntry) then) = - _$TransferEntryCopyWithImpl<$Res, TransferEntry>; +abstract class $TransferInEntryCopyWith<$Res> { + factory $TransferInEntryCopyWith( + TransferInEntry value, $Res Function(TransferInEntry) then) = + _$TransferInEntryCopyWithImpl<$Res, TransferInEntry>; @useResult $Res call( {@JsonKey(name: 'amount') int amount, @JsonKey(name: 'asset') String asset, - @JsonKey(name: 'extra_data') dynamic extraData, - @JsonKey(name: 'key') String key}); + @JsonKey(name: 'extra_data') dynamic extraData}); } /// @nodoc -class _$TransferEntryCopyWithImpl<$Res, $Val extends TransferEntry> - implements $TransferEntryCopyWith<$Res> { - _$TransferEntryCopyWithImpl(this._value, this._then); +class _$TransferInEntryCopyWithImpl<$Res, $Val extends TransferInEntry> + implements $TransferInEntryCopyWith<$Res> { + _$TransferInEntryCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; @@ -64,7 +61,6 @@ class _$TransferEntryCopyWithImpl<$Res, $Val extends TransferEntry> Object? amount = null, Object? asset = null, Object? extraData = freezed, - Object? key = null, }) { return _then(_value.copyWith( amount: null == amount @@ -79,35 +75,30 @@ class _$TransferEntryCopyWithImpl<$Res, $Val extends TransferEntry> ? _value.extraData : extraData // ignore: cast_nullable_to_non_nullable as dynamic, - key: null == key - ? _value.key - : key // ignore: cast_nullable_to_non_nullable - as String, ) as $Val); } } /// @nodoc -abstract class _$$TransferEntryImplCopyWith<$Res> - implements $TransferEntryCopyWith<$Res> { - factory _$$TransferEntryImplCopyWith( - _$TransferEntryImpl value, $Res Function(_$TransferEntryImpl) then) = - __$$TransferEntryImplCopyWithImpl<$Res>; +abstract class _$$TransferInEntryImplCopyWith<$Res> + implements $TransferInEntryCopyWith<$Res> { + factory _$$TransferInEntryImplCopyWith(_$TransferInEntryImpl value, + $Res Function(_$TransferInEntryImpl) then) = + __$$TransferInEntryImplCopyWithImpl<$Res>; @override @useResult $Res call( {@JsonKey(name: 'amount') int amount, @JsonKey(name: 'asset') String asset, - @JsonKey(name: 'extra_data') dynamic extraData, - @JsonKey(name: 'key') String key}); + @JsonKey(name: 'extra_data') dynamic extraData}); } /// @nodoc -class __$$TransferEntryImplCopyWithImpl<$Res> - extends _$TransferEntryCopyWithImpl<$Res, _$TransferEntryImpl> - implements _$$TransferEntryImplCopyWith<$Res> { - __$$TransferEntryImplCopyWithImpl( - _$TransferEntryImpl _value, $Res Function(_$TransferEntryImpl) _then) +class __$$TransferInEntryImplCopyWithImpl<$Res> + extends _$TransferInEntryCopyWithImpl<$Res, _$TransferInEntryImpl> + implements _$$TransferInEntryImplCopyWith<$Res> { + __$$TransferInEntryImplCopyWithImpl( + _$TransferInEntryImpl _value, $Res Function(_$TransferInEntryImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -116,9 +107,8 @@ class __$$TransferEntryImplCopyWithImpl<$Res> Object? amount = null, Object? asset = null, Object? extraData = freezed, - Object? key = null, }) { - return _then(_$TransferEntryImpl( + return _then(_$TransferInEntryImpl( amount: null == amount ? _value.amount : amount // ignore: cast_nullable_to_non_nullable @@ -131,25 +121,20 @@ class __$$TransferEntryImplCopyWithImpl<$Res> ? _value.extraData : extraData // ignore: cast_nullable_to_non_nullable as dynamic, - key: null == key - ? _value.key - : key // ignore: cast_nullable_to_non_nullable - as String, )); } } /// @nodoc @JsonSerializable() -class _$TransferEntryImpl implements _TransferEntry { - const _$TransferEntryImpl( +class _$TransferInEntryImpl implements _TransferInEntry { + const _$TransferInEntryImpl( {@JsonKey(name: 'amount') required this.amount, @JsonKey(name: 'asset') required this.asset, - @JsonKey(name: 'extra_data') required this.extraData, - @JsonKey(name: 'key') required this.key}); + @JsonKey(name: 'extra_data') required this.extraData}); - factory _$TransferEntryImpl.fromJson(Map json) => - _$$TransferEntryImplFromJson(json); + factory _$TransferInEntryImpl.fromJson(Map json) => + _$$TransferInEntryImplFromJson(json); @override @JsonKey(name: 'amount') @@ -160,54 +145,51 @@ class _$TransferEntryImpl implements _TransferEntry { @override @JsonKey(name: 'extra_data') final dynamic extraData; - @override - @JsonKey(name: 'key') - final String key; @override String toString() { - return 'TransferEntry(amount: $amount, asset: $asset, extraData: $extraData, key: $key)'; + return 'TransferInEntry(amount: $amount, asset: $asset, extraData: $extraData)'; } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$TransferEntryImpl && + other is _$TransferInEntryImpl && (identical(other.amount, amount) || other.amount == amount) && (identical(other.asset, asset) || other.asset == asset) && - const DeepCollectionEquality().equals(other.extraData, extraData) && - (identical(other.key, key) || other.key == key)); + const DeepCollectionEquality().equals(other.extraData, extraData)); } @JsonKey(ignore: true) @override int get hashCode => Object.hash(runtimeType, amount, asset, - const DeepCollectionEquality().hash(extraData), key); + const DeepCollectionEquality().hash(extraData)); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$TransferEntryImplCopyWith<_$TransferEntryImpl> get copyWith => - __$$TransferEntryImplCopyWithImpl<_$TransferEntryImpl>(this, _$identity); + _$$TransferInEntryImplCopyWith<_$TransferInEntryImpl> get copyWith => + __$$TransferInEntryImplCopyWithImpl<_$TransferInEntryImpl>( + this, _$identity); @override Map toJson() { - return _$$TransferEntryImplToJson( + return _$$TransferInEntryImplToJson( this, ); } } -abstract class _TransferEntry implements TransferEntry { - const factory _TransferEntry( - {@JsonKey(name: 'amount') required final int amount, - @JsonKey(name: 'asset') required final String asset, - @JsonKey(name: 'extra_data') required final dynamic extraData, - @JsonKey(name: 'key') required final String key}) = _$TransferEntryImpl; +abstract class _TransferInEntry implements TransferInEntry { + const factory _TransferInEntry( + {@JsonKey(name: 'amount') required final int amount, + @JsonKey(name: 'asset') required final String asset, + @JsonKey(name: 'extra_data') required final dynamic extraData}) = + _$TransferInEntryImpl; - factory _TransferEntry.fromJson(Map json) = - _$TransferEntryImpl.fromJson; + factory _TransferInEntry.fromJson(Map json) = + _$TransferInEntryImpl.fromJson; @override @JsonKey(name: 'amount') @@ -219,10 +201,7 @@ abstract class _TransferEntry implements TransferEntry { @JsonKey(name: 'extra_data') dynamic get extraData; @override - @JsonKey(name: 'key') - String get key; - @override @JsonKey(ignore: true) - _$$TransferEntryImplCopyWith<_$TransferEntryImpl> get copyWith => + _$$TransferInEntryImplCopyWith<_$TransferInEntryImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/src/data_transfer_objects/wallet/transaction_entry/transfer_entry.g.dart b/lib/src/data_transfer_objects/wallet/transaction_entry/transfer_in_entry.g.dart similarity index 66% rename from lib/src/data_transfer_objects/wallet/transaction_entry/transfer_entry.g.dart rename to lib/src/data_transfer_objects/wallet/transaction_entry/transfer_in_entry.g.dart index 20812e4..248128e 100644 --- a/lib/src/data_transfer_objects/wallet/transaction_entry/transfer_entry.g.dart +++ b/lib/src/data_transfer_objects/wallet/transaction_entry/transfer_in_entry.g.dart @@ -2,24 +2,24 @@ // ignore_for_file: package_api_docs, non_constant_identifier_names -part of 'transfer_entry.dart'; +part of 'transfer_in_entry.dart'; // ************************************************************************** // JsonSerializableGenerator // ************************************************************************** -_$TransferEntryImpl _$$TransferEntryImplFromJson(Map json) => - _$TransferEntryImpl( +_$TransferInEntryImpl _$$TransferInEntryImplFromJson( + Map json) => + _$TransferInEntryImpl( amount: json['amount'] as int, asset: json['asset'] as String, extraData: json['extra_data'], - key: json['key'] as String, ); -Map _$$TransferEntryImplToJson(_$TransferEntryImpl instance) => +Map _$$TransferInEntryImplToJson( + _$TransferInEntryImpl instance) => { 'amount': instance.amount, 'asset': instance.asset, 'extra_data': instance.extraData, - 'key': instance.key, }; diff --git a/lib/src/data_transfer_objects/wallet/transaction_entry/transfer_out_entry.dart b/lib/src/data_transfer_objects/wallet/transaction_entry/transfer_out_entry.dart new file mode 100644 index 0000000..6a48364 --- /dev/null +++ b/lib/src/data_transfer_objects/wallet/transaction_entry/transfer_out_entry.dart @@ -0,0 +1,20 @@ +// ignore_for_file: public_member_api_docs, invalid_annotation_target + +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'transfer_out_entry.freezed.dart'; + +part 'transfer_out_entry.g.dart'; + +@freezed +class TransferOutEntry with _$TransferOutEntry { + const factory TransferOutEntry({ + @JsonKey(name: 'destination') required String destination, + @JsonKey(name: 'amount') required int amount, + @JsonKey(name: 'asset') required String asset, + @JsonKey(name: 'extra_data') required dynamic extraData, + }) = _TransferOutEntry; + + factory TransferOutEntry.fromJson(Map json) => + _$TransferOutEntryFromJson(json); +} diff --git a/lib/src/data_transfer_objects/wallet/transaction_entry/transfer_out_entry.freezed.dart b/lib/src/data_transfer_objects/wallet/transaction_entry/transfer_out_entry.freezed.dart new file mode 100644 index 0000000..c431d5b --- /dev/null +++ b/lib/src/data_transfer_objects/wallet/transaction_entry/transfer_out_entry.freezed.dart @@ -0,0 +1,231 @@ +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'transfer_out_entry.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +T _$identity(T value) => value; + +final _privateConstructorUsedError = UnsupportedError( + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + +TransferOutEntry _$TransferOutEntryFromJson(Map json) { + return _TransferOutEntry.fromJson(json); +} + +/// @nodoc +mixin _$TransferOutEntry { + @JsonKey(name: 'destination') + String get destination => throw _privateConstructorUsedError; + @JsonKey(name: 'amount') + int get amount => throw _privateConstructorUsedError; + @JsonKey(name: 'asset') + String get asset => throw _privateConstructorUsedError; + @JsonKey(name: 'extra_data') + dynamic get extraData => throw _privateConstructorUsedError; + + Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) + $TransferOutEntryCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $TransferOutEntryCopyWith<$Res> { + factory $TransferOutEntryCopyWith( + TransferOutEntry value, $Res Function(TransferOutEntry) then) = + _$TransferOutEntryCopyWithImpl<$Res, TransferOutEntry>; + @useResult + $Res call( + {@JsonKey(name: 'destination') String destination, + @JsonKey(name: 'amount') int amount, + @JsonKey(name: 'asset') String asset, + @JsonKey(name: 'extra_data') dynamic extraData}); +} + +/// @nodoc +class _$TransferOutEntryCopyWithImpl<$Res, $Val extends TransferOutEntry> + implements $TransferOutEntryCopyWith<$Res> { + _$TransferOutEntryCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? destination = null, + Object? amount = null, + Object? asset = null, + Object? extraData = freezed, + }) { + return _then(_value.copyWith( + destination: null == destination + ? _value.destination + : destination // ignore: cast_nullable_to_non_nullable + as String, + amount: null == amount + ? _value.amount + : amount // ignore: cast_nullable_to_non_nullable + as int, + asset: null == asset + ? _value.asset + : asset // ignore: cast_nullable_to_non_nullable + as String, + extraData: freezed == extraData + ? _value.extraData + : extraData // ignore: cast_nullable_to_non_nullable + as dynamic, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$TransferOutEntryImplCopyWith<$Res> + implements $TransferOutEntryCopyWith<$Res> { + factory _$$TransferOutEntryImplCopyWith(_$TransferOutEntryImpl value, + $Res Function(_$TransferOutEntryImpl) then) = + __$$TransferOutEntryImplCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {@JsonKey(name: 'destination') String destination, + @JsonKey(name: 'amount') int amount, + @JsonKey(name: 'asset') String asset, + @JsonKey(name: 'extra_data') dynamic extraData}); +} + +/// @nodoc +class __$$TransferOutEntryImplCopyWithImpl<$Res> + extends _$TransferOutEntryCopyWithImpl<$Res, _$TransferOutEntryImpl> + implements _$$TransferOutEntryImplCopyWith<$Res> { + __$$TransferOutEntryImplCopyWithImpl(_$TransferOutEntryImpl _value, + $Res Function(_$TransferOutEntryImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? destination = null, + Object? amount = null, + Object? asset = null, + Object? extraData = freezed, + }) { + return _then(_$TransferOutEntryImpl( + destination: null == destination + ? _value.destination + : destination // ignore: cast_nullable_to_non_nullable + as String, + amount: null == amount + ? _value.amount + : amount // ignore: cast_nullable_to_non_nullable + as int, + asset: null == asset + ? _value.asset + : asset // ignore: cast_nullable_to_non_nullable + as String, + extraData: freezed == extraData + ? _value.extraData + : extraData // ignore: cast_nullable_to_non_nullable + as dynamic, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$TransferOutEntryImpl implements _TransferOutEntry { + const _$TransferOutEntryImpl( + {@JsonKey(name: 'destination') required this.destination, + @JsonKey(name: 'amount') required this.amount, + @JsonKey(name: 'asset') required this.asset, + @JsonKey(name: 'extra_data') required this.extraData}); + + factory _$TransferOutEntryImpl.fromJson(Map json) => + _$$TransferOutEntryImplFromJson(json); + + @override + @JsonKey(name: 'destination') + final String destination; + @override + @JsonKey(name: 'amount') + final int amount; + @override + @JsonKey(name: 'asset') + final String asset; + @override + @JsonKey(name: 'extra_data') + final dynamic extraData; + + @override + String toString() { + return 'TransferOutEntry(destination: $destination, amount: $amount, asset: $asset, extraData: $extraData)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$TransferOutEntryImpl && + (identical(other.destination, destination) || + other.destination == destination) && + (identical(other.amount, amount) || other.amount == amount) && + (identical(other.asset, asset) || other.asset == asset) && + const DeepCollectionEquality().equals(other.extraData, extraData)); + } + + @JsonKey(ignore: true) + @override + int get hashCode => Object.hash(runtimeType, destination, amount, asset, + const DeepCollectionEquality().hash(extraData)); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$TransferOutEntryImplCopyWith<_$TransferOutEntryImpl> get copyWith => + __$$TransferOutEntryImplCopyWithImpl<_$TransferOutEntryImpl>( + this, _$identity); + + @override + Map toJson() { + return _$$TransferOutEntryImplToJson( + this, + ); + } +} + +abstract class _TransferOutEntry implements TransferOutEntry { + const factory _TransferOutEntry( + {@JsonKey(name: 'destination') required final String destination, + @JsonKey(name: 'amount') required final int amount, + @JsonKey(name: 'asset') required final String asset, + @JsonKey(name: 'extra_data') required final dynamic extraData}) = + _$TransferOutEntryImpl; + + factory _TransferOutEntry.fromJson(Map json) = + _$TransferOutEntryImpl.fromJson; + + @override + @JsonKey(name: 'destination') + String get destination; + @override + @JsonKey(name: 'amount') + int get amount; + @override + @JsonKey(name: 'asset') + String get asset; + @override + @JsonKey(name: 'extra_data') + dynamic get extraData; + @override + @JsonKey(ignore: true) + _$$TransferOutEntryImplCopyWith<_$TransferOutEntryImpl> get copyWith => + throw _privateConstructorUsedError; +} diff --git a/lib/src/data_transfer_objects/wallet/transaction_entry/transfer_out_entry.g.dart b/lib/src/data_transfer_objects/wallet/transaction_entry/transfer_out_entry.g.dart new file mode 100644 index 0000000..b4c87a7 --- /dev/null +++ b/lib/src/data_transfer_objects/wallet/transaction_entry/transfer_out_entry.g.dart @@ -0,0 +1,27 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +// ignore_for_file: package_api_docs, non_constant_identifier_names + +part of 'transfer_out_entry.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_$TransferOutEntryImpl _$$TransferOutEntryImplFromJson( + Map json) => + _$TransferOutEntryImpl( + destination: json['destination'] as String, + amount: json['amount'] as int, + asset: json['asset'] as String, + extraData: json['extra_data'], + ); + +Map _$$TransferOutEntryImplToJson( + _$TransferOutEntryImpl instance) => + { + 'destination': instance.destination, + 'amount': instance.amount, + 'asset': instance.asset, + 'extra_data': instance.extraData, + }; diff --git a/pubspec.yaml b/pubspec.yaml index a76bf84..333cfa8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: xelis_dart_sdk description: Software Development Kit in Dart to build Apps for the Xelis Blockchain. -version: 0.16.1 +version: 0.16.2 repository: https://github.com/xelis-project/xelis-dart-jdk environment: @@ -17,7 +17,7 @@ dependencies: web_socket_client: ^0.1.1 dev_dependencies: - build_runner: ^2.4.8 + build_runner: ^2.4.9 freezed: ^2.4.7 json_serializable: ^6.7.1 lints: ^3.0.0