diff --git a/packages/espressocash_api/lib/src/dto/durable_transactions.dart b/packages/espressocash_api/lib/src/dto/durable_transactions.dart index d281821aaa..f2d2e922ee 100644 --- a/packages/espressocash_api/lib/src/dto/durable_transactions.dart +++ b/packages/espressocash_api/lib/src/dto/durable_transactions.dart @@ -38,22 +38,11 @@ class SubmitDurableTxResponseDto with _$SubmitDurableTxResponseDto { @freezed class GetDurableFeesResponseDto with _$GetDurableFeesResponseDto { const factory GetDurableFeesResponseDto({ - required int lamportPrice, - required MaxPriorityFee maxPriorityFee, - }) = _GetDurableFeesResponseDto; - - factory GetDurableFeesResponseDto.fromJson(Map json) => - _$GetDurableFeesResponseDtoFromJson(json); -} - -@freezed -class MaxPriorityFee with _$MaxPriorityFee { - const factory MaxPriorityFee({ required int outgoingLink, required int incomingLink, required int cancelLink, - }) = _MaxPriorityFee; + }) = _GetDurableFeesResponseDto; - factory MaxPriorityFee.fromJson(Map json) => - _$MaxPriorityFeeFromJson(json); + factory GetDurableFeesResponseDto.fromJson(Map json) => + _$GetDurableFeesResponseDtoFromJson(json); } diff --git a/packages/espressocash_api/lib/src/dto/durable_transactions.freezed.dart b/packages/espressocash_api/lib/src/dto/durable_transactions.freezed.dart index d69c9f183f..846dc4cb10 100644 --- a/packages/espressocash_api/lib/src/dto/durable_transactions.freezed.dart +++ b/packages/espressocash_api/lib/src/dto/durable_transactions.freezed.dart @@ -493,8 +493,9 @@ GetDurableFeesResponseDto _$GetDurableFeesResponseDtoFromJson( /// @nodoc mixin _$GetDurableFeesResponseDto { - int get lamportPrice => throw _privateConstructorUsedError; - MaxPriorityFee get maxPriorityFee => throw _privateConstructorUsedError; + int get outgoingLink => throw _privateConstructorUsedError; + int get incomingLink => throw _privateConstructorUsedError; + int get cancelLink => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) @@ -508,9 +509,7 @@ abstract class $GetDurableFeesResponseDtoCopyWith<$Res> { $Res Function(GetDurableFeesResponseDto) then) = _$GetDurableFeesResponseDtoCopyWithImpl<$Res, GetDurableFeesResponseDto>; @useResult - $Res call({int lamportPrice, MaxPriorityFee maxPriorityFee}); - - $MaxPriorityFeeCopyWith<$Res> get maxPriorityFee; + $Res call({int outgoingLink, int incomingLink, int cancelLink}); } /// @nodoc @@ -524,180 +523,6 @@ class _$GetDurableFeesResponseDtoCopyWithImpl<$Res, // ignore: unused_field final $Res Function($Val) _then; - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? lamportPrice = null, - Object? maxPriorityFee = null, - }) { - return _then(_value.copyWith( - lamportPrice: null == lamportPrice - ? _value.lamportPrice - : lamportPrice // ignore: cast_nullable_to_non_nullable - as int, - maxPriorityFee: null == maxPriorityFee - ? _value.maxPriorityFee - : maxPriorityFee // ignore: cast_nullable_to_non_nullable - as MaxPriorityFee, - ) as $Val); - } - - @override - @pragma('vm:prefer-inline') - $MaxPriorityFeeCopyWith<$Res> get maxPriorityFee { - return $MaxPriorityFeeCopyWith<$Res>(_value.maxPriorityFee, (value) { - return _then(_value.copyWith(maxPriorityFee: value) as $Val); - }); - } -} - -/// @nodoc -abstract class _$$GetDurableFeesResponseDtoImplCopyWith<$Res> - implements $GetDurableFeesResponseDtoCopyWith<$Res> { - factory _$$GetDurableFeesResponseDtoImplCopyWith( - _$GetDurableFeesResponseDtoImpl value, - $Res Function(_$GetDurableFeesResponseDtoImpl) then) = - __$$GetDurableFeesResponseDtoImplCopyWithImpl<$Res>; - @override - @useResult - $Res call({int lamportPrice, MaxPriorityFee maxPriorityFee}); - - @override - $MaxPriorityFeeCopyWith<$Res> get maxPriorityFee; -} - -/// @nodoc -class __$$GetDurableFeesResponseDtoImplCopyWithImpl<$Res> - extends _$GetDurableFeesResponseDtoCopyWithImpl<$Res, - _$GetDurableFeesResponseDtoImpl> - implements _$$GetDurableFeesResponseDtoImplCopyWith<$Res> { - __$$GetDurableFeesResponseDtoImplCopyWithImpl( - _$GetDurableFeesResponseDtoImpl _value, - $Res Function(_$GetDurableFeesResponseDtoImpl) _then) - : super(_value, _then); - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? lamportPrice = null, - Object? maxPriorityFee = null, - }) { - return _then(_$GetDurableFeesResponseDtoImpl( - lamportPrice: null == lamportPrice - ? _value.lamportPrice - : lamportPrice // ignore: cast_nullable_to_non_nullable - as int, - maxPriorityFee: null == maxPriorityFee - ? _value.maxPriorityFee - : maxPriorityFee // ignore: cast_nullable_to_non_nullable - as MaxPriorityFee, - )); - } -} - -/// @nodoc -@JsonSerializable() -class _$GetDurableFeesResponseDtoImpl implements _GetDurableFeesResponseDto { - const _$GetDurableFeesResponseDtoImpl( - {required this.lamportPrice, required this.maxPriorityFee}); - - factory _$GetDurableFeesResponseDtoImpl.fromJson(Map json) => - _$$GetDurableFeesResponseDtoImplFromJson(json); - - @override - final int lamportPrice; - @override - final MaxPriorityFee maxPriorityFee; - - @override - String toString() { - return 'GetDurableFeesResponseDto(lamportPrice: $lamportPrice, maxPriorityFee: $maxPriorityFee)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$GetDurableFeesResponseDtoImpl && - (identical(other.lamportPrice, lamportPrice) || - other.lamportPrice == lamportPrice) && - (identical(other.maxPriorityFee, maxPriorityFee) || - other.maxPriorityFee == maxPriorityFee)); - } - - @JsonKey(ignore: true) - @override - int get hashCode => Object.hash(runtimeType, lamportPrice, maxPriorityFee); - - @JsonKey(ignore: true) - @override - @pragma('vm:prefer-inline') - _$$GetDurableFeesResponseDtoImplCopyWith<_$GetDurableFeesResponseDtoImpl> - get copyWith => __$$GetDurableFeesResponseDtoImplCopyWithImpl< - _$GetDurableFeesResponseDtoImpl>(this, _$identity); - - @override - Map toJson() { - return _$$GetDurableFeesResponseDtoImplToJson( - this, - ); - } -} - -abstract class _GetDurableFeesResponseDto implements GetDurableFeesResponseDto { - const factory _GetDurableFeesResponseDto( - {required final int lamportPrice, - required final MaxPriorityFee maxPriorityFee}) = - _$GetDurableFeesResponseDtoImpl; - - factory _GetDurableFeesResponseDto.fromJson(Map json) = - _$GetDurableFeesResponseDtoImpl.fromJson; - - @override - int get lamportPrice; - @override - MaxPriorityFee get maxPriorityFee; - @override - @JsonKey(ignore: true) - _$$GetDurableFeesResponseDtoImplCopyWith<_$GetDurableFeesResponseDtoImpl> - get copyWith => throw _privateConstructorUsedError; -} - -MaxPriorityFee _$MaxPriorityFeeFromJson(Map json) { - return _MaxPriorityFee.fromJson(json); -} - -/// @nodoc -mixin _$MaxPriorityFee { - int get outgoingLink => throw _privateConstructorUsedError; - int get incomingLink => throw _privateConstructorUsedError; - int get cancelLink => throw _privateConstructorUsedError; - - Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) - $MaxPriorityFeeCopyWith get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $MaxPriorityFeeCopyWith<$Res> { - factory $MaxPriorityFeeCopyWith( - MaxPriorityFee value, $Res Function(MaxPriorityFee) then) = - _$MaxPriorityFeeCopyWithImpl<$Res, MaxPriorityFee>; - @useResult - $Res call({int outgoingLink, int incomingLink, int cancelLink}); -} - -/// @nodoc -class _$MaxPriorityFeeCopyWithImpl<$Res, $Val extends MaxPriorityFee> - implements $MaxPriorityFeeCopyWith<$Res> { - _$MaxPriorityFeeCopyWithImpl(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({ @@ -723,22 +548,25 @@ class _$MaxPriorityFeeCopyWithImpl<$Res, $Val extends MaxPriorityFee> } /// @nodoc -abstract class _$$MaxPriorityFeeImplCopyWith<$Res> - implements $MaxPriorityFeeCopyWith<$Res> { - factory _$$MaxPriorityFeeImplCopyWith(_$MaxPriorityFeeImpl value, - $Res Function(_$MaxPriorityFeeImpl) then) = - __$$MaxPriorityFeeImplCopyWithImpl<$Res>; +abstract class _$$GetDurableFeesResponseDtoImplCopyWith<$Res> + implements $GetDurableFeesResponseDtoCopyWith<$Res> { + factory _$$GetDurableFeesResponseDtoImplCopyWith( + _$GetDurableFeesResponseDtoImpl value, + $Res Function(_$GetDurableFeesResponseDtoImpl) then) = + __$$GetDurableFeesResponseDtoImplCopyWithImpl<$Res>; @override @useResult $Res call({int outgoingLink, int incomingLink, int cancelLink}); } /// @nodoc -class __$$MaxPriorityFeeImplCopyWithImpl<$Res> - extends _$MaxPriorityFeeCopyWithImpl<$Res, _$MaxPriorityFeeImpl> - implements _$$MaxPriorityFeeImplCopyWith<$Res> { - __$$MaxPriorityFeeImplCopyWithImpl( - _$MaxPriorityFeeImpl _value, $Res Function(_$MaxPriorityFeeImpl) _then) +class __$$GetDurableFeesResponseDtoImplCopyWithImpl<$Res> + extends _$GetDurableFeesResponseDtoCopyWithImpl<$Res, + _$GetDurableFeesResponseDtoImpl> + implements _$$GetDurableFeesResponseDtoImplCopyWith<$Res> { + __$$GetDurableFeesResponseDtoImplCopyWithImpl( + _$GetDurableFeesResponseDtoImpl _value, + $Res Function(_$GetDurableFeesResponseDtoImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -748,7 +576,7 @@ class __$$MaxPriorityFeeImplCopyWithImpl<$Res> Object? incomingLink = null, Object? cancelLink = null, }) { - return _then(_$MaxPriorityFeeImpl( + return _then(_$GetDurableFeesResponseDtoImpl( outgoingLink: null == outgoingLink ? _value.outgoingLink : outgoingLink // ignore: cast_nullable_to_non_nullable @@ -767,14 +595,14 @@ class __$$MaxPriorityFeeImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() -class _$MaxPriorityFeeImpl implements _MaxPriorityFee { - const _$MaxPriorityFeeImpl( +class _$GetDurableFeesResponseDtoImpl implements _GetDurableFeesResponseDto { + const _$GetDurableFeesResponseDtoImpl( {required this.outgoingLink, required this.incomingLink, required this.cancelLink}); - factory _$MaxPriorityFeeImpl.fromJson(Map json) => - _$$MaxPriorityFeeImplFromJson(json); + factory _$GetDurableFeesResponseDtoImpl.fromJson(Map json) => + _$$GetDurableFeesResponseDtoImplFromJson(json); @override final int outgoingLink; @@ -785,14 +613,14 @@ class _$MaxPriorityFeeImpl implements _MaxPriorityFee { @override String toString() { - return 'MaxPriorityFee(outgoingLink: $outgoingLink, incomingLink: $incomingLink, cancelLink: $cancelLink)'; + return 'GetDurableFeesResponseDto(outgoingLink: $outgoingLink, incomingLink: $incomingLink, cancelLink: $cancelLink)'; } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$MaxPriorityFeeImpl && + other is _$GetDurableFeesResponseDtoImpl && (identical(other.outgoingLink, outgoingLink) || other.outgoingLink == outgoingLink) && (identical(other.incomingLink, incomingLink) || @@ -809,26 +637,26 @@ class _$MaxPriorityFeeImpl implements _MaxPriorityFee { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$MaxPriorityFeeImplCopyWith<_$MaxPriorityFeeImpl> get copyWith => - __$$MaxPriorityFeeImplCopyWithImpl<_$MaxPriorityFeeImpl>( - this, _$identity); + _$$GetDurableFeesResponseDtoImplCopyWith<_$GetDurableFeesResponseDtoImpl> + get copyWith => __$$GetDurableFeesResponseDtoImplCopyWithImpl< + _$GetDurableFeesResponseDtoImpl>(this, _$identity); @override Map toJson() { - return _$$MaxPriorityFeeImplToJson( + return _$$GetDurableFeesResponseDtoImplToJson( this, ); } } -abstract class _MaxPriorityFee implements MaxPriorityFee { - const factory _MaxPriorityFee( +abstract class _GetDurableFeesResponseDto implements GetDurableFeesResponseDto { + const factory _GetDurableFeesResponseDto( {required final int outgoingLink, required final int incomingLink, - required final int cancelLink}) = _$MaxPriorityFeeImpl; + required final int cancelLink}) = _$GetDurableFeesResponseDtoImpl; - factory _MaxPriorityFee.fromJson(Map json) = - _$MaxPriorityFeeImpl.fromJson; + factory _GetDurableFeesResponseDto.fromJson(Map json) = + _$GetDurableFeesResponseDtoImpl.fromJson; @override int get outgoingLink; @@ -838,6 +666,6 @@ abstract class _MaxPriorityFee implements MaxPriorityFee { int get cancelLink; @override @JsonKey(ignore: true) - _$$MaxPriorityFeeImplCopyWith<_$MaxPriorityFeeImpl> get copyWith => - throw _privateConstructorUsedError; + _$$GetDurableFeesResponseDtoImplCopyWith<_$GetDurableFeesResponseDtoImpl> + get copyWith => throw _privateConstructorUsedError; } diff --git a/packages/espressocash_api/lib/src/dto/durable_transactions.g.dart b/packages/espressocash_api/lib/src/dto/durable_transactions.g.dart index 2f9708c497..04e596a9e3 100644 --- a/packages/espressocash_api/lib/src/dto/durable_transactions.g.dart +++ b/packages/espressocash_api/lib/src/dto/durable_transactions.g.dart @@ -49,27 +49,13 @@ Map _$$SubmitDurableTxResponseDtoImplToJson( _$GetDurableFeesResponseDtoImpl _$$GetDurableFeesResponseDtoImplFromJson( Map json) => _$GetDurableFeesResponseDtoImpl( - lamportPrice: (json['lamportPrice'] as num).toInt(), - maxPriorityFee: MaxPriorityFee.fromJson( - json['maxPriorityFee'] as Map), - ); - -Map _$$GetDurableFeesResponseDtoImplToJson( - _$GetDurableFeesResponseDtoImpl instance) => - { - 'lamportPrice': instance.lamportPrice, - 'maxPriorityFee': instance.maxPriorityFee, - }; - -_$MaxPriorityFeeImpl _$$MaxPriorityFeeImplFromJson(Map json) => - _$MaxPriorityFeeImpl( outgoingLink: (json['outgoingLink'] as num).toInt(), incomingLink: (json['incomingLink'] as num).toInt(), cancelLink: (json['cancelLink'] as num).toInt(), ); -Map _$$MaxPriorityFeeImplToJson( - _$MaxPriorityFeeImpl instance) => +Map _$$GetDurableFeesResponseDtoImplToJson( + _$GetDurableFeesResponseDtoImpl instance) => { 'outgoingLink': instance.outgoingLink, 'incomingLink': instance.incomingLink,