diff --git a/.gitignore b/.gitignore index 483f9f6..3543743 100644 --- a/.gitignore +++ b/.gitignore @@ -19,4 +19,5 @@ pubspec.lock coverage/html/ doc/ playground/ +test/ TODO.txt \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c55384..c5917ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,18 @@ +## 0.18.0 + +Daemon API upgrade : + +- new getMempoolCache RPC method. +- new isAccountRegistered RPC method. +- new getAccountRegistrationTopoheight RPC method. +- fix some dtos. + +Wallet API upgrade : + +- new hasBalance RPC method. +- new estimateFees RPC method. +- fix some dtos. + ## 0.17.0 Daemon API upgrade : diff --git a/README.md b/README.md index 5974c48..a962fd1 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,9 @@ JSON-RPC Clients to interact with daemon and wallet API. - isTxExecutedInBlock - getDevFeeThresholds - getSizeOnDisk +- getMempoolCache +- isAccountRegistered +- getAccountRegistrationTopoheight #### Wallet @@ -59,6 +62,7 @@ JSON-RPC Clients to interact with daemon and wallet API. - splitAddress - rescan - getBalance +- hasBalance - getTrackedAssets - getAssetPrecision - getTransaction @@ -66,6 +70,7 @@ JSON-RPC Clients to interact with daemon and wallet API. - listTransactions - isOnline - signData +- estimateFees ### Websocket Events diff --git a/lib/src/data_transfer_objects/asset/asset.dart b/lib/src/data_transfer_objects/asset/asset_data.dart similarity index 52% rename from lib/src/data_transfer_objects/asset/asset.dart rename to lib/src/data_transfer_objects/asset/asset_data.dart index 8907556..6039d25 100644 --- a/lib/src/data_transfer_objects/asset/asset.dart +++ b/lib/src/data_transfer_objects/asset/asset_data.dart @@ -2,20 +2,20 @@ import 'package:freezed_annotation/freezed_annotation.dart'; -part 'asset.freezed.dart'; +part 'asset_data.freezed.dart'; -part 'asset.g.dart'; +part 'asset_data.g.dart'; /// @nodoc @freezed -class Asset with _$Asset { +class AssetData with _$AssetData { /// @nodoc - const factory Asset({ - @JsonKey(name: 'asset') required String asset, + const factory AssetData({ @JsonKey(name: 'topoheight') required int topoheight, @JsonKey(name: 'decimals') required int decimals, - }) = _Asset; + }) = _AssetData; /// @nodoc - factory Asset.fromJson(Map json) => _$AssetFromJson(json); + factory AssetData.fromJson(Map json) => + _$AssetDataFromJson(json); } diff --git a/lib/src/data_transfer_objects/asset/asset.freezed.dart b/lib/src/data_transfer_objects/asset/asset_data.freezed.dart similarity index 56% rename from lib/src/data_transfer_objects/asset/asset.freezed.dart rename to lib/src/data_transfer_objects/asset/asset_data.freezed.dart index c68b12b..c3a609d 100644 --- a/lib/src/data_transfer_objects/asset/asset.freezed.dart +++ b/lib/src/data_transfer_objects/asset/asset_data.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 'asset.dart'; +part of 'asset_data.dart'; // ************************************************************************** // FreezedGenerator @@ -14,14 +14,12 @@ 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'); -Asset _$AssetFromJson(Map json) { - return _Asset.fromJson(json); +AssetData _$AssetDataFromJson(Map json) { + return _AssetData.fromJson(json); } /// @nodoc -mixin _$Asset { - @JsonKey(name: 'asset') - String get asset => throw _privateConstructorUsedError; +mixin _$AssetData { @JsonKey(name: 'topoheight') int get topoheight => throw _privateConstructorUsedError; @JsonKey(name: 'decimals') @@ -29,24 +27,24 @@ mixin _$Asset { Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) - $AssetCopyWith get copyWith => throw _privateConstructorUsedError; + $AssetDataCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc -abstract class $AssetCopyWith<$Res> { - factory $AssetCopyWith(Asset value, $Res Function(Asset) then) = - _$AssetCopyWithImpl<$Res, Asset>; +abstract class $AssetDataCopyWith<$Res> { + factory $AssetDataCopyWith(AssetData value, $Res Function(AssetData) then) = + _$AssetDataCopyWithImpl<$Res, AssetData>; @useResult $Res call( - {@JsonKey(name: 'asset') String asset, - @JsonKey(name: 'topoheight') int topoheight, + {@JsonKey(name: 'topoheight') int topoheight, @JsonKey(name: 'decimals') int decimals}); } /// @nodoc -class _$AssetCopyWithImpl<$Res, $Val extends Asset> - implements $AssetCopyWith<$Res> { - _$AssetCopyWithImpl(this._value, this._then); +class _$AssetDataCopyWithImpl<$Res, $Val extends AssetData> + implements $AssetDataCopyWith<$Res> { + _$AssetDataCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; @@ -56,15 +54,10 @@ class _$AssetCopyWithImpl<$Res, $Val extends Asset> @pragma('vm:prefer-inline') @override $Res call({ - Object? asset = null, Object? topoheight = null, Object? decimals = null, }) { return _then(_value.copyWith( - asset: null == asset - ? _value.asset - : asset // ignore: cast_nullable_to_non_nullable - as String, topoheight: null == topoheight ? _value.topoheight : topoheight // ignore: cast_nullable_to_non_nullable @@ -78,38 +71,33 @@ class _$AssetCopyWithImpl<$Res, $Val extends Asset> } /// @nodoc -abstract class _$$AssetImplCopyWith<$Res> implements $AssetCopyWith<$Res> { - factory _$$AssetImplCopyWith( - _$AssetImpl value, $Res Function(_$AssetImpl) then) = - __$$AssetImplCopyWithImpl<$Res>; +abstract class _$$AssetDataImplCopyWith<$Res> + implements $AssetDataCopyWith<$Res> { + factory _$$AssetDataImplCopyWith( + _$AssetDataImpl value, $Res Function(_$AssetDataImpl) then) = + __$$AssetDataImplCopyWithImpl<$Res>; @override @useResult $Res call( - {@JsonKey(name: 'asset') String asset, - @JsonKey(name: 'topoheight') int topoheight, + {@JsonKey(name: 'topoheight') int topoheight, @JsonKey(name: 'decimals') int decimals}); } /// @nodoc -class __$$AssetImplCopyWithImpl<$Res> - extends _$AssetCopyWithImpl<$Res, _$AssetImpl> - implements _$$AssetImplCopyWith<$Res> { - __$$AssetImplCopyWithImpl( - _$AssetImpl _value, $Res Function(_$AssetImpl) _then) +class __$$AssetDataImplCopyWithImpl<$Res> + extends _$AssetDataCopyWithImpl<$Res, _$AssetDataImpl> + implements _$$AssetDataImplCopyWith<$Res> { + __$$AssetDataImplCopyWithImpl( + _$AssetDataImpl _value, $Res Function(_$AssetDataImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override $Res call({ - Object? asset = null, Object? topoheight = null, Object? decimals = null, }) { - return _then(_$AssetImpl( - asset: null == asset - ? _value.asset - : asset // ignore: cast_nullable_to_non_nullable - as String, + return _then(_$AssetDataImpl( topoheight: null == topoheight ? _value.topoheight : topoheight // ignore: cast_nullable_to_non_nullable @@ -124,18 +112,14 @@ class __$$AssetImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() -class _$AssetImpl implements _Asset { - const _$AssetImpl( - {@JsonKey(name: 'asset') required this.asset, - @JsonKey(name: 'topoheight') required this.topoheight, +class _$AssetDataImpl implements _AssetData { + const _$AssetDataImpl( + {@JsonKey(name: 'topoheight') required this.topoheight, @JsonKey(name: 'decimals') required this.decimals}); - factory _$AssetImpl.fromJson(Map json) => - _$$AssetImplFromJson(json); + factory _$AssetDataImpl.fromJson(Map json) => + _$$AssetDataImplFromJson(json); - @override - @JsonKey(name: 'asset') - final String asset; @override @JsonKey(name: 'topoheight') final int topoheight; @@ -145,15 +129,14 @@ class _$AssetImpl implements _Asset { @override String toString() { - return 'Asset(asset: $asset, topoheight: $topoheight, decimals: $decimals)'; + return 'AssetData(topoheight: $topoheight, decimals: $decimals)'; } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$AssetImpl && - (identical(other.asset, asset) || other.asset == asset) && + other is _$AssetDataImpl && (identical(other.topoheight, topoheight) || other.topoheight == topoheight) && (identical(other.decimals, decimals) || @@ -162,33 +145,31 @@ class _$AssetImpl implements _Asset { @JsonKey(ignore: true) @override - int get hashCode => Object.hash(runtimeType, asset, topoheight, decimals); + int get hashCode => Object.hash(runtimeType, topoheight, decimals); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$AssetImplCopyWith<_$AssetImpl> get copyWith => - __$$AssetImplCopyWithImpl<_$AssetImpl>(this, _$identity); + _$$AssetDataImplCopyWith<_$AssetDataImpl> get copyWith => + __$$AssetDataImplCopyWithImpl<_$AssetDataImpl>(this, _$identity); @override Map toJson() { - return _$$AssetImplToJson( + return _$$AssetDataImplToJson( this, ); } } -abstract class _Asset implements Asset { - const factory _Asset( - {@JsonKey(name: 'asset') required final String asset, - @JsonKey(name: 'topoheight') required final int topoheight, - @JsonKey(name: 'decimals') required final int decimals}) = _$AssetImpl; +abstract class _AssetData implements AssetData { + const factory _AssetData( + {@JsonKey(name: 'topoheight') required final int topoheight, + @JsonKey(name: 'decimals') required final int decimals}) = + _$AssetDataImpl; - factory _Asset.fromJson(Map json) = _$AssetImpl.fromJson; + factory _AssetData.fromJson(Map json) = + _$AssetDataImpl.fromJson; - @override - @JsonKey(name: 'asset') - String get asset; @override @JsonKey(name: 'topoheight') int get topoheight; @@ -197,6 +178,6 @@ abstract class _Asset implements Asset { int get decimals; @override @JsonKey(ignore: true) - _$$AssetImplCopyWith<_$AssetImpl> get copyWith => + _$$AssetDataImplCopyWith<_$AssetDataImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/src/data_transfer_objects/asset/asset.g.dart b/lib/src/data_transfer_objects/asset/asset_data.g.dart similarity index 68% rename from lib/src/data_transfer_objects/asset/asset.g.dart rename to lib/src/data_transfer_objects/asset/asset_data.g.dart index be7ca0f..ddbf15e 100644 --- a/lib/src/data_transfer_objects/asset/asset.g.dart +++ b/lib/src/data_transfer_objects/asset/asset_data.g.dart @@ -2,21 +2,20 @@ // ignore_for_file: package_api_docs, non_constant_identifier_names -part of 'asset.dart'; +part of 'asset_data.dart'; // ************************************************************************** // JsonSerializableGenerator // ************************************************************************** -_$AssetImpl _$$AssetImplFromJson(Map json) => _$AssetImpl( - asset: json['asset'] as String, +_$AssetDataImpl _$$AssetDataImplFromJson(Map json) => + _$AssetDataImpl( topoheight: json['topoheight'] as int, decimals: json['decimals'] as int, ); -Map _$$AssetImplToJson(_$AssetImpl instance) => +Map _$$AssetDataImplToJson(_$AssetDataImpl instance) => { - 'asset': instance.asset, 'topoheight': instance.topoheight, 'decimals': instance.decimals, }; diff --git a/lib/src/data_transfer_objects/wallet/new_asset_event/asset_with_data.dart b/lib/src/data_transfer_objects/asset/asset_with_data.dart similarity index 80% rename from lib/src/data_transfer_objects/wallet/new_asset_event/asset_with_data.dart rename to lib/src/data_transfer_objects/asset/asset_with_data.dart index 370c7d7..2a517ba 100644 --- a/lib/src/data_transfer_objects/wallet/new_asset_event/asset_with_data.dart +++ b/lib/src/data_transfer_objects/asset/asset_with_data.dart @@ -11,8 +11,8 @@ part 'asset_with_data.g.dart'; class AssetWithData with _$AssetWithData { /// @nodoc const factory AssetWithData({ - @JsonKey(name: 'asset') required String assetHash, - @JsonKey(name: 'topoheight') required int topoHeight, + @JsonKey(name: 'asset') required String asset, + @JsonKey(name: 'topoheight') required int topoheight, @JsonKey(name: 'decimals') required int decimals, }) = _AssetWithData; diff --git a/lib/src/data_transfer_objects/wallet/new_asset_event/asset_with_data.freezed.dart b/lib/src/data_transfer_objects/asset/asset_with_data.freezed.dart similarity index 75% rename from lib/src/data_transfer_objects/wallet/new_asset_event/asset_with_data.freezed.dart rename to lib/src/data_transfer_objects/asset/asset_with_data.freezed.dart index b3592a0..e02336b 100644 --- a/lib/src/data_transfer_objects/wallet/new_asset_event/asset_with_data.freezed.dart +++ b/lib/src/data_transfer_objects/asset/asset_with_data.freezed.dart @@ -21,9 +21,9 @@ AssetWithData _$AssetWithDataFromJson(Map json) { /// @nodoc mixin _$AssetWithData { @JsonKey(name: 'asset') - String get assetHash => throw _privateConstructorUsedError; + String get asset => throw _privateConstructorUsedError; @JsonKey(name: 'topoheight') - int get topoHeight => throw _privateConstructorUsedError; + int get topoheight => throw _privateConstructorUsedError; @JsonKey(name: 'decimals') int get decimals => throw _privateConstructorUsedError; @@ -40,8 +40,8 @@ abstract class $AssetWithDataCopyWith<$Res> { _$AssetWithDataCopyWithImpl<$Res, AssetWithData>; @useResult $Res call( - {@JsonKey(name: 'asset') String assetHash, - @JsonKey(name: 'topoheight') int topoHeight, + {@JsonKey(name: 'asset') String asset, + @JsonKey(name: 'topoheight') int topoheight, @JsonKey(name: 'decimals') int decimals}); } @@ -58,18 +58,18 @@ class _$AssetWithDataCopyWithImpl<$Res, $Val extends AssetWithData> @pragma('vm:prefer-inline') @override $Res call({ - Object? assetHash = null, - Object? topoHeight = null, + Object? asset = null, + Object? topoheight = null, Object? decimals = null, }) { return _then(_value.copyWith( - assetHash: null == assetHash - ? _value.assetHash - : assetHash // ignore: cast_nullable_to_non_nullable + asset: null == asset + ? _value.asset + : asset // ignore: cast_nullable_to_non_nullable as String, - topoHeight: null == topoHeight - ? _value.topoHeight - : topoHeight // ignore: cast_nullable_to_non_nullable + topoheight: null == topoheight + ? _value.topoheight + : topoheight // ignore: cast_nullable_to_non_nullable as int, decimals: null == decimals ? _value.decimals @@ -88,8 +88,8 @@ abstract class _$$AssetWithDataImplCopyWith<$Res> @override @useResult $Res call( - {@JsonKey(name: 'asset') String assetHash, - @JsonKey(name: 'topoheight') int topoHeight, + {@JsonKey(name: 'asset') String asset, + @JsonKey(name: 'topoheight') int topoheight, @JsonKey(name: 'decimals') int decimals}); } @@ -104,18 +104,18 @@ class __$$AssetWithDataImplCopyWithImpl<$Res> @pragma('vm:prefer-inline') @override $Res call({ - Object? assetHash = null, - Object? topoHeight = null, + Object? asset = null, + Object? topoheight = null, Object? decimals = null, }) { return _then(_$AssetWithDataImpl( - assetHash: null == assetHash - ? _value.assetHash - : assetHash // ignore: cast_nullable_to_non_nullable + asset: null == asset + ? _value.asset + : asset // ignore: cast_nullable_to_non_nullable as String, - topoHeight: null == topoHeight - ? _value.topoHeight - : topoHeight // ignore: cast_nullable_to_non_nullable + topoheight: null == topoheight + ? _value.topoheight + : topoheight // ignore: cast_nullable_to_non_nullable as int, decimals: null == decimals ? _value.decimals @@ -129,8 +129,8 @@ class __$$AssetWithDataImplCopyWithImpl<$Res> @JsonSerializable() class _$AssetWithDataImpl implements _AssetWithData { const _$AssetWithDataImpl( - {@JsonKey(name: 'asset') required this.assetHash, - @JsonKey(name: 'topoheight') required this.topoHeight, + {@JsonKey(name: 'asset') required this.asset, + @JsonKey(name: 'topoheight') required this.topoheight, @JsonKey(name: 'decimals') required this.decimals}); factory _$AssetWithDataImpl.fromJson(Map json) => @@ -138,17 +138,17 @@ class _$AssetWithDataImpl implements _AssetWithData { @override @JsonKey(name: 'asset') - final String assetHash; + final String asset; @override @JsonKey(name: 'topoheight') - final int topoHeight; + final int topoheight; @override @JsonKey(name: 'decimals') final int decimals; @override String toString() { - return 'AssetWithData(assetHash: $assetHash, topoHeight: $topoHeight, decimals: $decimals)'; + return 'AssetWithData(asset: $asset, topoheight: $topoheight, decimals: $decimals)'; } @override @@ -156,17 +156,16 @@ class _$AssetWithDataImpl implements _AssetWithData { return identical(this, other) || (other.runtimeType == runtimeType && other is _$AssetWithDataImpl && - (identical(other.assetHash, assetHash) || - other.assetHash == assetHash) && - (identical(other.topoHeight, topoHeight) || - other.topoHeight == topoHeight) && + (identical(other.asset, asset) || other.asset == asset) && + (identical(other.topoheight, topoheight) || + other.topoheight == topoheight) && (identical(other.decimals, decimals) || other.decimals == decimals)); } @JsonKey(ignore: true) @override - int get hashCode => Object.hash(runtimeType, assetHash, topoHeight, decimals); + int get hashCode => Object.hash(runtimeType, asset, topoheight, decimals); @JsonKey(ignore: true) @override @@ -184,8 +183,8 @@ class _$AssetWithDataImpl implements _AssetWithData { abstract class _AssetWithData implements AssetWithData { const factory _AssetWithData( - {@JsonKey(name: 'asset') required final String assetHash, - @JsonKey(name: 'topoheight') required final int topoHeight, + {@JsonKey(name: 'asset') required final String asset, + @JsonKey(name: 'topoheight') required final int topoheight, @JsonKey(name: 'decimals') required final int decimals}) = _$AssetWithDataImpl; @@ -194,10 +193,10 @@ abstract class _AssetWithData implements AssetWithData { @override @JsonKey(name: 'asset') - String get assetHash; + String get asset; @override @JsonKey(name: 'topoheight') - int get topoHeight; + int get topoheight; @override @JsonKey(name: 'decimals') int get decimals; diff --git a/lib/src/data_transfer_objects/wallet/new_asset_event/asset_with_data.g.dart b/lib/src/data_transfer_objects/asset/asset_with_data.g.dart similarity index 79% rename from lib/src/data_transfer_objects/wallet/new_asset_event/asset_with_data.g.dart rename to lib/src/data_transfer_objects/asset/asset_with_data.g.dart index d87b3df..defd2e6 100644 --- a/lib/src/data_transfer_objects/wallet/new_asset_event/asset_with_data.g.dart +++ b/lib/src/data_transfer_objects/asset/asset_with_data.g.dart @@ -10,14 +10,14 @@ part of 'asset_with_data.dart'; _$AssetWithDataImpl _$$AssetWithDataImplFromJson(Map json) => _$AssetWithDataImpl( - assetHash: json['asset'] as String, - topoHeight: json['topoheight'] as int, + asset: json['asset'] as String, + topoheight: json['topoheight'] as int, decimals: json['decimals'] as int, ); Map _$$AssetWithDataImplToJson(_$AssetWithDataImpl instance) => { - 'asset': instance.assetHash, - 'topoheight': instance.topoHeight, + 'asset': instance.asset, + 'topoheight': instance.topoheight, 'decimals': instance.decimals, }; diff --git a/lib/src/data_transfer_objects/block/block.dart b/lib/src/data_transfer_objects/block/block.dart index 7137d37..16528c5 100644 --- a/lib/src/data_transfer_objects/block/block.dart +++ b/lib/src/data_transfer_objects/block/block.dart @@ -29,8 +29,6 @@ class Block with _$Block { @JsonKey(name: 'total_fees') int? totalFees, @JsonKey(name: 'txs_hashes') required List txsHashes, @JsonKey(name: 'version') required int version, - - // @JsonKey(name: 'data') dynamic data, }) = _Block; /// @nodoc diff --git a/lib/src/data_transfer_objects/dtos.dart b/lib/src/data_transfer_objects/dtos.dart index eb97dd8..c791bb5 100644 --- a/lib/src/data_transfer_objects/dtos.dart +++ b/lib/src/data_transfer_objects/dtos.dart @@ -1,4 +1,5 @@ -export 'asset/asset.dart'; +export 'asset/asset_data.dart'; +export 'asset/asset_with_data.dart'; export 'block/block.dart'; export 'block_ordered_event/block_ordered_event.dart'; export 'block_orphaned_event/block_orphaned_event.dart'; @@ -11,12 +12,13 @@ export 'get_account_history/get_account_history_result.dart'; export 'get_account_history/incoming_history.dart'; export 'get_account_history/mining_history.dart'; export 'get_account_history/outgoing_history.dart'; +export 'get_account_registration_topoheight/get_account_registration_topoheight_params.dart'; export 'get_accounts/get_accounts_params.dart'; export 'get_accounts/get_accounts_result.dart'; export 'get_asset/get_asset_params.dart'; export 'get_assets/get_assets_params.dart'; -export 'get_balance/get_balance_params.dart'; -export 'get_balance/get_balance_result.dart'; +export 'get_balance/get_wallet_balance_params.dart'; +export 'get_balance/get_wallet_balance_result.dart'; export 'get_balance_at_topoheight/get_balance_at_topoheight_params.dart'; export 'get_block_at_topoheight/get_block_at_topoheight_params.dart'; export 'get_block_by_hash/get_block_by_hash_params.dart'; @@ -42,6 +44,7 @@ export 'has_balance/has_balance_params.dart'; export 'has_balance/has_balance_result.dart'; export 'has_nonce/has_nonce_params.dart'; export 'has_nonce/has_nonce_result.dart'; +export 'is_account_registered/is_account_registered_params.dart'; export 'is_tx_executed_in_block/is_tx_executed_in_block_params.dart'; export 'network/network.dart'; export 'p2p_status/p2p_status_result.dart'; @@ -58,9 +61,10 @@ export 'versioned_balance/versioned_balance.dart'; export 'wallet/balance_changed_event/balance_changed_event.dart'; export 'wallet/build_transaction/build_transaction_params.dart'; export 'wallet/build_transaction/fee_builder.dart'; +export 'wallet/build_transaction/wallet_transaction_response.dart'; export 'wallet/get_address/get_address_params.dart'; +export 'wallet/get_balance/get_balance_params.dart'; export 'wallet/list_transactions/list_transactions_params.dart'; -export 'wallet/new_asset_event/asset_with_data.dart'; export 'wallet/rescan/rescan_params.dart'; export 'wallet/split_address/split_address_params.dart'; export 'wallet/split_address/split_address_result.dart'; diff --git a/lib/src/data_transfer_objects/get_account_history/incoming_history.dart b/lib/src/data_transfer_objects/get_account_history/incoming_history.dart index e2a1253..742050b 100644 --- a/lib/src/data_transfer_objects/get_account_history/incoming_history.dart +++ b/lib/src/data_transfer_objects/get_account_history/incoming_history.dart @@ -11,7 +11,7 @@ part 'incoming_history.g.dart'; class IncomingHistory with _$IncomingHistory { /// @nodoc const factory IncomingHistory({ - @JsonKey(name: 'amount') required int amount, + @JsonKey(name: 'from') required String from, }) = _IncomingHistory; /// @nodoc diff --git a/lib/src/data_transfer_objects/get_account_history/incoming_history.freezed.dart b/lib/src/data_transfer_objects/get_account_history/incoming_history.freezed.dart index ecaa803..b319bab 100644 --- a/lib/src/data_transfer_objects/get_account_history/incoming_history.freezed.dart +++ b/lib/src/data_transfer_objects/get_account_history/incoming_history.freezed.dart @@ -20,8 +20,8 @@ IncomingHistory _$IncomingHistoryFromJson(Map json) { /// @nodoc mixin _$IncomingHistory { - @JsonKey(name: 'amount') - int get amount => throw _privateConstructorUsedError; + @JsonKey(name: 'from') + String get from => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) @@ -35,7 +35,7 @@ abstract class $IncomingHistoryCopyWith<$Res> { IncomingHistory value, $Res Function(IncomingHistory) then) = _$IncomingHistoryCopyWithImpl<$Res, IncomingHistory>; @useResult - $Res call({@JsonKey(name: 'amount') int amount}); + $Res call({@JsonKey(name: 'from') String from}); } /// @nodoc @@ -51,13 +51,13 @@ class _$IncomingHistoryCopyWithImpl<$Res, $Val extends IncomingHistory> @pragma('vm:prefer-inline') @override $Res call({ - Object? amount = null, + Object? from = null, }) { return _then(_value.copyWith( - amount: null == amount - ? _value.amount - : amount // ignore: cast_nullable_to_non_nullable - as int, + from: null == from + ? _value.from + : from // ignore: cast_nullable_to_non_nullable + as String, ) as $Val); } } @@ -70,7 +70,7 @@ abstract class _$$IncomingHistoryImplCopyWith<$Res> __$$IncomingHistoryImplCopyWithImpl<$Res>; @override @useResult - $Res call({@JsonKey(name: 'amount') int amount}); + $Res call({@JsonKey(name: 'from') String from}); } /// @nodoc @@ -84,13 +84,13 @@ class __$$IncomingHistoryImplCopyWithImpl<$Res> @pragma('vm:prefer-inline') @override $Res call({ - Object? amount = null, + Object? from = null, }) { return _then(_$IncomingHistoryImpl( - amount: null == amount - ? _value.amount - : amount // ignore: cast_nullable_to_non_nullable - as int, + from: null == from + ? _value.from + : from // ignore: cast_nullable_to_non_nullable + as String, )); } } @@ -98,18 +98,18 @@ class __$$IncomingHistoryImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() class _$IncomingHistoryImpl implements _IncomingHistory { - const _$IncomingHistoryImpl({@JsonKey(name: 'amount') required this.amount}); + const _$IncomingHistoryImpl({@JsonKey(name: 'from') required this.from}); factory _$IncomingHistoryImpl.fromJson(Map json) => _$$IncomingHistoryImplFromJson(json); @override - @JsonKey(name: 'amount') - final int amount; + @JsonKey(name: 'from') + final String from; @override String toString() { - return 'IncomingHistory(amount: $amount)'; + return 'IncomingHistory(from: $from)'; } @override @@ -117,12 +117,12 @@ class _$IncomingHistoryImpl implements _IncomingHistory { return identical(this, other) || (other.runtimeType == runtimeType && other is _$IncomingHistoryImpl && - (identical(other.amount, amount) || other.amount == amount)); + (identical(other.from, from) || other.from == from)); } @JsonKey(ignore: true) @override - int get hashCode => Object.hash(runtimeType, amount); + int get hashCode => Object.hash(runtimeType, from); @JsonKey(ignore: true) @override @@ -141,15 +141,15 @@ class _$IncomingHistoryImpl implements _IncomingHistory { abstract class _IncomingHistory implements IncomingHistory { const factory _IncomingHistory( - {@JsonKey(name: 'amount') required final int amount}) = + {@JsonKey(name: 'from') required final String from}) = _$IncomingHistoryImpl; factory _IncomingHistory.fromJson(Map json) = _$IncomingHistoryImpl.fromJson; @override - @JsonKey(name: 'amount') - int get amount; + @JsonKey(name: 'from') + String get from; @override @JsonKey(ignore: true) _$$IncomingHistoryImplCopyWith<_$IncomingHistoryImpl> get copyWith => diff --git a/lib/src/data_transfer_objects/get_account_history/incoming_history.g.dart b/lib/src/data_transfer_objects/get_account_history/incoming_history.g.dart index dabc94f..e7cf213 100644 --- a/lib/src/data_transfer_objects/get_account_history/incoming_history.g.dart +++ b/lib/src/data_transfer_objects/get_account_history/incoming_history.g.dart @@ -11,11 +11,11 @@ part of 'incoming_history.dart'; _$IncomingHistoryImpl _$$IncomingHistoryImplFromJson( Map json) => _$IncomingHistoryImpl( - amount: json['amount'] as int, + from: json['from'] as String, ); Map _$$IncomingHistoryImplToJson( _$IncomingHistoryImpl instance) => { - 'amount': instance.amount, + 'from': instance.from, }; diff --git a/lib/src/data_transfer_objects/get_account_history/outgoing_history.dart b/lib/src/data_transfer_objects/get_account_history/outgoing_history.dart index 17bbd39..7193715 100644 --- a/lib/src/data_transfer_objects/get_account_history/outgoing_history.dart +++ b/lib/src/data_transfer_objects/get_account_history/outgoing_history.dart @@ -11,7 +11,7 @@ part 'outgoing_history.g.dart'; class OutgoingHistory with _$OutgoingHistory { /// @nodoc const factory OutgoingHistory({ - @JsonKey(name: 'amount') required int amount, + @JsonKey(name: 'to') required String to, }) = _OutgoingHistory; /// @nodoc diff --git a/lib/src/data_transfer_objects/get_account_history/outgoing_history.freezed.dart b/lib/src/data_transfer_objects/get_account_history/outgoing_history.freezed.dart index d2d4ebc..af13331 100644 --- a/lib/src/data_transfer_objects/get_account_history/outgoing_history.freezed.dart +++ b/lib/src/data_transfer_objects/get_account_history/outgoing_history.freezed.dart @@ -20,8 +20,8 @@ OutgoingHistory _$OutgoingHistoryFromJson(Map json) { /// @nodoc mixin _$OutgoingHistory { - @JsonKey(name: 'amount') - int get amount => throw _privateConstructorUsedError; + @JsonKey(name: 'to') + String get to => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) @@ -35,7 +35,7 @@ abstract class $OutgoingHistoryCopyWith<$Res> { OutgoingHistory value, $Res Function(OutgoingHistory) then) = _$OutgoingHistoryCopyWithImpl<$Res, OutgoingHistory>; @useResult - $Res call({@JsonKey(name: 'amount') int amount}); + $Res call({@JsonKey(name: 'to') String to}); } /// @nodoc @@ -51,13 +51,13 @@ class _$OutgoingHistoryCopyWithImpl<$Res, $Val extends OutgoingHistory> @pragma('vm:prefer-inline') @override $Res call({ - Object? amount = null, + Object? to = null, }) { return _then(_value.copyWith( - amount: null == amount - ? _value.amount - : amount // ignore: cast_nullable_to_non_nullable - as int, + to: null == to + ? _value.to + : to // ignore: cast_nullable_to_non_nullable + as String, ) as $Val); } } @@ -70,7 +70,7 @@ abstract class _$$OutgoingHistoryImplCopyWith<$Res> __$$OutgoingHistoryImplCopyWithImpl<$Res>; @override @useResult - $Res call({@JsonKey(name: 'amount') int amount}); + $Res call({@JsonKey(name: 'to') String to}); } /// @nodoc @@ -84,13 +84,13 @@ class __$$OutgoingHistoryImplCopyWithImpl<$Res> @pragma('vm:prefer-inline') @override $Res call({ - Object? amount = null, + Object? to = null, }) { return _then(_$OutgoingHistoryImpl( - amount: null == amount - ? _value.amount - : amount // ignore: cast_nullable_to_non_nullable - as int, + to: null == to + ? _value.to + : to // ignore: cast_nullable_to_non_nullable + as String, )); } } @@ -98,18 +98,18 @@ class __$$OutgoingHistoryImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() class _$OutgoingHistoryImpl implements _OutgoingHistory { - const _$OutgoingHistoryImpl({@JsonKey(name: 'amount') required this.amount}); + const _$OutgoingHistoryImpl({@JsonKey(name: 'to') required this.to}); factory _$OutgoingHistoryImpl.fromJson(Map json) => _$$OutgoingHistoryImplFromJson(json); @override - @JsonKey(name: 'amount') - final int amount; + @JsonKey(name: 'to') + final String to; @override String toString() { - return 'OutgoingHistory(amount: $amount)'; + return 'OutgoingHistory(to: $to)'; } @override @@ -117,12 +117,12 @@ class _$OutgoingHistoryImpl implements _OutgoingHistory { return identical(this, other) || (other.runtimeType == runtimeType && other is _$OutgoingHistoryImpl && - (identical(other.amount, amount) || other.amount == amount)); + (identical(other.to, to) || other.to == to)); } @JsonKey(ignore: true) @override - int get hashCode => Object.hash(runtimeType, amount); + int get hashCode => Object.hash(runtimeType, to); @JsonKey(ignore: true) @override @@ -141,15 +141,14 @@ class _$OutgoingHistoryImpl implements _OutgoingHistory { abstract class _OutgoingHistory implements OutgoingHistory { const factory _OutgoingHistory( - {@JsonKey(name: 'amount') required final int amount}) = - _$OutgoingHistoryImpl; + {@JsonKey(name: 'to') required final String to}) = _$OutgoingHistoryImpl; factory _OutgoingHistory.fromJson(Map json) = _$OutgoingHistoryImpl.fromJson; @override - @JsonKey(name: 'amount') - int get amount; + @JsonKey(name: 'to') + String get to; @override @JsonKey(ignore: true) _$$OutgoingHistoryImplCopyWith<_$OutgoingHistoryImpl> get copyWith => diff --git a/lib/src/data_transfer_objects/get_account_history/outgoing_history.g.dart b/lib/src/data_transfer_objects/get_account_history/outgoing_history.g.dart index fff02a4..0b6b52b 100644 --- a/lib/src/data_transfer_objects/get_account_history/outgoing_history.g.dart +++ b/lib/src/data_transfer_objects/get_account_history/outgoing_history.g.dart @@ -11,11 +11,11 @@ part of 'outgoing_history.dart'; _$OutgoingHistoryImpl _$$OutgoingHistoryImplFromJson( Map json) => _$OutgoingHistoryImpl( - amount: json['amount'] as int, + to: json['to'] as String, ); Map _$$OutgoingHistoryImplToJson( _$OutgoingHistoryImpl instance) => { - 'amount': instance.amount, + 'to': instance.to, }; diff --git a/lib/src/data_transfer_objects/get_account_registration_topoheight/get_account_registration_topoheight_params.dart b/lib/src/data_transfer_objects/get_account_registration_topoheight/get_account_registration_topoheight_params.dart new file mode 100644 index 0000000..9ef75a1 --- /dev/null +++ b/lib/src/data_transfer_objects/get_account_registration_topoheight/get_account_registration_topoheight_params.dart @@ -0,0 +1,23 @@ +// ignore_for_file: invalid_annotation_target + +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'get_account_registration_topoheight_params.freezed.dart'; + +part 'get_account_registration_topoheight_params.g.dart'; + +/// @nodoc +@freezed +class GetAccountRegistrationTopoheightParams + with _$GetAccountRegistrationTopoheightParams { + /// @nodoc + const factory GetAccountRegistrationTopoheightParams({ + @JsonKey(name: 'address') required String address, + }) = _GetAccountRegistrationTopoheightParams; + + /// @nodoc + factory GetAccountRegistrationTopoheightParams.fromJson( + Map json, + ) => + _$GetAccountRegistrationTopoheightParamsFromJson(json); +} diff --git a/lib/src/data_transfer_objects/get_account_registration_topoheight/get_account_registration_topoheight_params.freezed.dart b/lib/src/data_transfer_objects/get_account_registration_topoheight/get_account_registration_topoheight_params.freezed.dart new file mode 100644 index 0000000..e271782 --- /dev/null +++ b/lib/src/data_transfer_objects/get_account_registration_topoheight/get_account_registration_topoheight_params.freezed.dart @@ -0,0 +1,174 @@ +// 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 'get_account_registration_topoheight_params.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'); + +GetAccountRegistrationTopoheightParams + _$GetAccountRegistrationTopoheightParamsFromJson( + Map json) { + return _GetAccountRegistrationTopoheightParams.fromJson(json); +} + +/// @nodoc +mixin _$GetAccountRegistrationTopoheightParams { + @JsonKey(name: 'address') + String get address => throw _privateConstructorUsedError; + + Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) + $GetAccountRegistrationTopoheightParamsCopyWith< + GetAccountRegistrationTopoheightParams> + get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $GetAccountRegistrationTopoheightParamsCopyWith<$Res> { + factory $GetAccountRegistrationTopoheightParamsCopyWith( + GetAccountRegistrationTopoheightParams value, + $Res Function(GetAccountRegistrationTopoheightParams) then) = + _$GetAccountRegistrationTopoheightParamsCopyWithImpl<$Res, + GetAccountRegistrationTopoheightParams>; + @useResult + $Res call({@JsonKey(name: 'address') String address}); +} + +/// @nodoc +class _$GetAccountRegistrationTopoheightParamsCopyWithImpl<$Res, + $Val extends GetAccountRegistrationTopoheightParams> + implements $GetAccountRegistrationTopoheightParamsCopyWith<$Res> { + _$GetAccountRegistrationTopoheightParamsCopyWithImpl(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? address = null, + }) { + return _then(_value.copyWith( + address: null == address + ? _value.address + : address // ignore: cast_nullable_to_non_nullable + as String, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$GetAccountRegistrationTopoheightParamsImplCopyWith<$Res> + implements $GetAccountRegistrationTopoheightParamsCopyWith<$Res> { + factory _$$GetAccountRegistrationTopoheightParamsImplCopyWith( + _$GetAccountRegistrationTopoheightParamsImpl value, + $Res Function(_$GetAccountRegistrationTopoheightParamsImpl) then) = + __$$GetAccountRegistrationTopoheightParamsImplCopyWithImpl<$Res>; + @override + @useResult + $Res call({@JsonKey(name: 'address') String address}); +} + +/// @nodoc +class __$$GetAccountRegistrationTopoheightParamsImplCopyWithImpl<$Res> + extends _$GetAccountRegistrationTopoheightParamsCopyWithImpl<$Res, + _$GetAccountRegistrationTopoheightParamsImpl> + implements _$$GetAccountRegistrationTopoheightParamsImplCopyWith<$Res> { + __$$GetAccountRegistrationTopoheightParamsImplCopyWithImpl( + _$GetAccountRegistrationTopoheightParamsImpl _value, + $Res Function(_$GetAccountRegistrationTopoheightParamsImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? address = null, + }) { + return _then(_$GetAccountRegistrationTopoheightParamsImpl( + address: null == address + ? _value.address + : address // ignore: cast_nullable_to_non_nullable + as String, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$GetAccountRegistrationTopoheightParamsImpl + implements _GetAccountRegistrationTopoheightParams { + const _$GetAccountRegistrationTopoheightParamsImpl( + {@JsonKey(name: 'address') required this.address}); + + factory _$GetAccountRegistrationTopoheightParamsImpl.fromJson( + Map json) => + _$$GetAccountRegistrationTopoheightParamsImplFromJson(json); + + @override + @JsonKey(name: 'address') + final String address; + + @override + String toString() { + return 'GetAccountRegistrationTopoheightParams(address: $address)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$GetAccountRegistrationTopoheightParamsImpl && + (identical(other.address, address) || other.address == address)); + } + + @JsonKey(ignore: true) + @override + int get hashCode => Object.hash(runtimeType, address); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$GetAccountRegistrationTopoheightParamsImplCopyWith< + _$GetAccountRegistrationTopoheightParamsImpl> + get copyWith => + __$$GetAccountRegistrationTopoheightParamsImplCopyWithImpl< + _$GetAccountRegistrationTopoheightParamsImpl>(this, _$identity); + + @override + Map toJson() { + return _$$GetAccountRegistrationTopoheightParamsImplToJson( + this, + ); + } +} + +abstract class _GetAccountRegistrationTopoheightParams + implements GetAccountRegistrationTopoheightParams { + const factory _GetAccountRegistrationTopoheightParams( + {@JsonKey(name: 'address') required final String address}) = + _$GetAccountRegistrationTopoheightParamsImpl; + + factory _GetAccountRegistrationTopoheightParams.fromJson( + Map json) = + _$GetAccountRegistrationTopoheightParamsImpl.fromJson; + + @override + @JsonKey(name: 'address') + String get address; + @override + @JsonKey(ignore: true) + _$$GetAccountRegistrationTopoheightParamsImplCopyWith< + _$GetAccountRegistrationTopoheightParamsImpl> + get copyWith => throw _privateConstructorUsedError; +} diff --git a/lib/src/data_transfer_objects/get_account_registration_topoheight/get_account_registration_topoheight_params.g.dart b/lib/src/data_transfer_objects/get_account_registration_topoheight/get_account_registration_topoheight_params.g.dart new file mode 100644 index 0000000..7ef1eed --- /dev/null +++ b/lib/src/data_transfer_objects/get_account_registration_topoheight/get_account_registration_topoheight_params.g.dart @@ -0,0 +1,22 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +// ignore_for_file: package_api_docs, non_constant_identifier_names + +part of 'get_account_registration_topoheight_params.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_$GetAccountRegistrationTopoheightParamsImpl + _$$GetAccountRegistrationTopoheightParamsImplFromJson( + Map json) => + _$GetAccountRegistrationTopoheightParamsImpl( + address: json['address'] as String, + ); + +Map _$$GetAccountRegistrationTopoheightParamsImplToJson( + _$GetAccountRegistrationTopoheightParamsImpl instance) => + { + 'address': instance.address, + }; diff --git a/lib/src/data_transfer_objects/get_balance/get_balance_result.dart b/lib/src/data_transfer_objects/get_balance/get_balance_result.dart deleted file mode 100644 index a394b2d..0000000 --- a/lib/src/data_transfer_objects/get_balance/get_balance_result.dart +++ /dev/null @@ -1,23 +0,0 @@ -// ignore_for_file: invalid_annotation_target - -import 'package:freezed_annotation/freezed_annotation.dart'; - -import 'package:xelis_dart_sdk/xelis_dart_sdk.dart'; - -part 'get_balance_result.freezed.dart'; - -part 'get_balance_result.g.dart'; - -/// @nodoc -@freezed -class GetBalanceResult with _$GetBalanceResult { - /// @nodoc - const factory GetBalanceResult({ - @JsonKey(name: 'version') required VersionedBalance versionedBalance, - @JsonKey(name: 'topoheight') required int topoHeight, - }) = _GetBalanceResult; - - /// @nodoc - factory GetBalanceResult.fromJson(Map json) => - _$GetBalanceResultFromJson(json); -} diff --git a/lib/src/data_transfer_objects/get_balance/get_wallet_balance_params.dart b/lib/src/data_transfer_objects/get_balance/get_wallet_balance_params.dart new file mode 100644 index 0000000..74fe2c3 --- /dev/null +++ b/lib/src/data_transfer_objects/get_balance/get_wallet_balance_params.dart @@ -0,0 +1,21 @@ +// ignore_for_file: invalid_annotation_target + +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'get_wallet_balance_params.freezed.dart'; + +part 'get_wallet_balance_params.g.dart'; + +/// @nodoc +@freezed +class GetWalletBalanceParams with _$GetWalletBalanceParams { + /// @nodoc + const factory GetWalletBalanceParams({ + @JsonKey(name: 'address') required String address, + @JsonKey(name: 'asset') required String asset, + }) = _GetWalletBalanceParams; + + /// @nodoc + factory GetWalletBalanceParams.fromJson(Map json) => + _$GetWalletBalanceParamsFromJson(json); +} diff --git a/lib/src/data_transfer_objects/get_balance/get_wallet_balance_params.freezed.dart b/lib/src/data_transfer_objects/get_balance/get_wallet_balance_params.freezed.dart new file mode 100644 index 0000000..c4a781f --- /dev/null +++ b/lib/src/data_transfer_objects/get_balance/get_wallet_balance_params.freezed.dart @@ -0,0 +1,188 @@ +// 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 'get_wallet_balance_params.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'); + +GetWalletBalanceParams _$GetWalletBalanceParamsFromJson( + Map json) { + return _GetWalletBalanceParams.fromJson(json); +} + +/// @nodoc +mixin _$GetWalletBalanceParams { + @JsonKey(name: 'address') + String get address => throw _privateConstructorUsedError; + @JsonKey(name: 'asset') + String get asset => throw _privateConstructorUsedError; + + Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) + $GetWalletBalanceParamsCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $GetWalletBalanceParamsCopyWith<$Res> { + factory $GetWalletBalanceParamsCopyWith(GetWalletBalanceParams value, + $Res Function(GetWalletBalanceParams) then) = + _$GetWalletBalanceParamsCopyWithImpl<$Res, GetWalletBalanceParams>; + @useResult + $Res call( + {@JsonKey(name: 'address') String address, + @JsonKey(name: 'asset') String asset}); +} + +/// @nodoc +class _$GetWalletBalanceParamsCopyWithImpl<$Res, + $Val extends GetWalletBalanceParams> + implements $GetWalletBalanceParamsCopyWith<$Res> { + _$GetWalletBalanceParamsCopyWithImpl(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? address = null, + Object? asset = null, + }) { + return _then(_value.copyWith( + address: null == address + ? _value.address + : address // ignore: cast_nullable_to_non_nullable + as String, + asset: null == asset + ? _value.asset + : asset // ignore: cast_nullable_to_non_nullable + as String, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$GetWalletBalanceParamsImplCopyWith<$Res> + implements $GetWalletBalanceParamsCopyWith<$Res> { + factory _$$GetWalletBalanceParamsImplCopyWith( + _$GetWalletBalanceParamsImpl value, + $Res Function(_$GetWalletBalanceParamsImpl) then) = + __$$GetWalletBalanceParamsImplCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {@JsonKey(name: 'address') String address, + @JsonKey(name: 'asset') String asset}); +} + +/// @nodoc +class __$$GetWalletBalanceParamsImplCopyWithImpl<$Res> + extends _$GetWalletBalanceParamsCopyWithImpl<$Res, + _$GetWalletBalanceParamsImpl> + implements _$$GetWalletBalanceParamsImplCopyWith<$Res> { + __$$GetWalletBalanceParamsImplCopyWithImpl( + _$GetWalletBalanceParamsImpl _value, + $Res Function(_$GetWalletBalanceParamsImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? address = null, + Object? asset = null, + }) { + return _then(_$GetWalletBalanceParamsImpl( + address: null == address + ? _value.address + : address // ignore: cast_nullable_to_non_nullable + as String, + asset: null == asset + ? _value.asset + : asset // ignore: cast_nullable_to_non_nullable + as String, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$GetWalletBalanceParamsImpl implements _GetWalletBalanceParams { + const _$GetWalletBalanceParamsImpl( + {@JsonKey(name: 'address') required this.address, + @JsonKey(name: 'asset') required this.asset}); + + factory _$GetWalletBalanceParamsImpl.fromJson(Map json) => + _$$GetWalletBalanceParamsImplFromJson(json); + + @override + @JsonKey(name: 'address') + final String address; + @override + @JsonKey(name: 'asset') + final String asset; + + @override + String toString() { + return 'GetWalletBalanceParams(address: $address, asset: $asset)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$GetWalletBalanceParamsImpl && + (identical(other.address, address) || other.address == address) && + (identical(other.asset, asset) || other.asset == asset)); + } + + @JsonKey(ignore: true) + @override + int get hashCode => Object.hash(runtimeType, address, asset); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$GetWalletBalanceParamsImplCopyWith<_$GetWalletBalanceParamsImpl> + get copyWith => __$$GetWalletBalanceParamsImplCopyWithImpl< + _$GetWalletBalanceParamsImpl>(this, _$identity); + + @override + Map toJson() { + return _$$GetWalletBalanceParamsImplToJson( + this, + ); + } +} + +abstract class _GetWalletBalanceParams implements GetWalletBalanceParams { + const factory _GetWalletBalanceParams( + {@JsonKey(name: 'address') required final String address, + @JsonKey(name: 'asset') required final String asset}) = + _$GetWalletBalanceParamsImpl; + + factory _GetWalletBalanceParams.fromJson(Map json) = + _$GetWalletBalanceParamsImpl.fromJson; + + @override + @JsonKey(name: 'address') + String get address; + @override + @JsonKey(name: 'asset') + String get asset; + @override + @JsonKey(ignore: true) + _$$GetWalletBalanceParamsImplCopyWith<_$GetWalletBalanceParamsImpl> + get copyWith => throw _privateConstructorUsedError; +} diff --git a/lib/src/data_transfer_objects/get_balance/get_wallet_balance_params.g.dart b/lib/src/data_transfer_objects/get_balance/get_wallet_balance_params.g.dart new file mode 100644 index 0000000..1a67c79 --- /dev/null +++ b/lib/src/data_transfer_objects/get_balance/get_wallet_balance_params.g.dart @@ -0,0 +1,23 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +// ignore_for_file: package_api_docs, non_constant_identifier_names + +part of 'get_wallet_balance_params.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_$GetWalletBalanceParamsImpl _$$GetWalletBalanceParamsImplFromJson( + Map json) => + _$GetWalletBalanceParamsImpl( + address: json['address'] as String, + asset: json['asset'] as String, + ); + +Map _$$GetWalletBalanceParamsImplToJson( + _$GetWalletBalanceParamsImpl instance) => + { + 'address': instance.address, + 'asset': instance.asset, + }; diff --git a/lib/src/data_transfer_objects/get_balance/get_wallet_balance_result.dart b/lib/src/data_transfer_objects/get_balance/get_wallet_balance_result.dart new file mode 100644 index 0000000..dd968fb --- /dev/null +++ b/lib/src/data_transfer_objects/get_balance/get_wallet_balance_result.dart @@ -0,0 +1,23 @@ +// ignore_for_file: invalid_annotation_target + +import 'package:freezed_annotation/freezed_annotation.dart'; + +import 'package:xelis_dart_sdk/xelis_dart_sdk.dart'; + +part 'get_wallet_balance_result.freezed.dart'; + +part 'get_wallet_balance_result.g.dart'; + +/// @nodoc +@freezed +class GetWalletBalanceResult with _$GetWalletBalanceResult { + /// @nodoc + const factory GetWalletBalanceResult({ + @JsonKey(name: 'version') required VersionedBalance versionedBalance, + @JsonKey(name: 'topoheight') required int topoheight, + }) = _GetWalletBalanceResult; + + /// @nodoc + factory GetWalletBalanceResult.fromJson(Map json) => + _$GetWalletBalanceResultFromJson(json); +} diff --git a/lib/src/data_transfer_objects/get_balance/get_balance_result.freezed.dart b/lib/src/data_transfer_objects/get_balance/get_wallet_balance_result.freezed.dart similarity index 53% rename from lib/src/data_transfer_objects/get_balance/get_balance_result.freezed.dart rename to lib/src/data_transfer_objects/get_balance/get_wallet_balance_result.freezed.dart index 3f7fab0..8ce601d 100644 --- a/lib/src/data_transfer_objects/get_balance/get_balance_result.freezed.dart +++ b/lib/src/data_transfer_objects/get_balance/get_wallet_balance_result.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 'get_balance_result.dart'; +part of 'get_wallet_balance_result.dart'; // ************************************************************************** // FreezedGenerator @@ -14,40 +14,42 @@ 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'); -GetBalanceResult _$GetBalanceResultFromJson(Map json) { - return _GetBalanceResult.fromJson(json); +GetWalletBalanceResult _$GetWalletBalanceResultFromJson( + Map json) { + return _GetWalletBalanceResult.fromJson(json); } /// @nodoc -mixin _$GetBalanceResult { +mixin _$GetWalletBalanceResult { @JsonKey(name: 'version') VersionedBalance get versionedBalance => throw _privateConstructorUsedError; @JsonKey(name: 'topoheight') - int get topoHeight => throw _privateConstructorUsedError; + int get topoheight => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) - $GetBalanceResultCopyWith get copyWith => + $GetWalletBalanceResultCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class $GetBalanceResultCopyWith<$Res> { - factory $GetBalanceResultCopyWith( - GetBalanceResult value, $Res Function(GetBalanceResult) then) = - _$GetBalanceResultCopyWithImpl<$Res, GetBalanceResult>; +abstract class $GetWalletBalanceResultCopyWith<$Res> { + factory $GetWalletBalanceResultCopyWith(GetWalletBalanceResult value, + $Res Function(GetWalletBalanceResult) then) = + _$GetWalletBalanceResultCopyWithImpl<$Res, GetWalletBalanceResult>; @useResult $Res call( {@JsonKey(name: 'version') VersionedBalance versionedBalance, - @JsonKey(name: 'topoheight') int topoHeight}); + @JsonKey(name: 'topoheight') int topoheight}); $VersionedBalanceCopyWith<$Res> get versionedBalance; } /// @nodoc -class _$GetBalanceResultCopyWithImpl<$Res, $Val extends GetBalanceResult> - implements $GetBalanceResultCopyWith<$Res> { - _$GetBalanceResultCopyWithImpl(this._value, this._then); +class _$GetWalletBalanceResultCopyWithImpl<$Res, + $Val extends GetWalletBalanceResult> + implements $GetWalletBalanceResultCopyWith<$Res> { + _$GetWalletBalanceResultCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; @@ -58,16 +60,16 @@ class _$GetBalanceResultCopyWithImpl<$Res, $Val extends GetBalanceResult> @override $Res call({ Object? versionedBalance = null, - Object? topoHeight = null, + Object? topoheight = null, }) { return _then(_value.copyWith( versionedBalance: null == versionedBalance ? _value.versionedBalance : versionedBalance // ignore: cast_nullable_to_non_nullable as VersionedBalance, - topoHeight: null == topoHeight - ? _value.topoHeight - : topoHeight // ignore: cast_nullable_to_non_nullable + topoheight: null == topoheight + ? _value.topoheight + : topoheight // ignore: cast_nullable_to_non_nullable as int, ) as $Val); } @@ -82,43 +84,46 @@ class _$GetBalanceResultCopyWithImpl<$Res, $Val extends GetBalanceResult> } /// @nodoc -abstract class _$$GetBalanceResultImplCopyWith<$Res> - implements $GetBalanceResultCopyWith<$Res> { - factory _$$GetBalanceResultImplCopyWith(_$GetBalanceResultImpl value, - $Res Function(_$GetBalanceResultImpl) then) = - __$$GetBalanceResultImplCopyWithImpl<$Res>; +abstract class _$$GetWalletBalanceResultImplCopyWith<$Res> + implements $GetWalletBalanceResultCopyWith<$Res> { + factory _$$GetWalletBalanceResultImplCopyWith( + _$GetWalletBalanceResultImpl value, + $Res Function(_$GetWalletBalanceResultImpl) then) = + __$$GetWalletBalanceResultImplCopyWithImpl<$Res>; @override @useResult $Res call( {@JsonKey(name: 'version') VersionedBalance versionedBalance, - @JsonKey(name: 'topoheight') int topoHeight}); + @JsonKey(name: 'topoheight') int topoheight}); @override $VersionedBalanceCopyWith<$Res> get versionedBalance; } /// @nodoc -class __$$GetBalanceResultImplCopyWithImpl<$Res> - extends _$GetBalanceResultCopyWithImpl<$Res, _$GetBalanceResultImpl> - implements _$$GetBalanceResultImplCopyWith<$Res> { - __$$GetBalanceResultImplCopyWithImpl(_$GetBalanceResultImpl _value, - $Res Function(_$GetBalanceResultImpl) _then) +class __$$GetWalletBalanceResultImplCopyWithImpl<$Res> + extends _$GetWalletBalanceResultCopyWithImpl<$Res, + _$GetWalletBalanceResultImpl> + implements _$$GetWalletBalanceResultImplCopyWith<$Res> { + __$$GetWalletBalanceResultImplCopyWithImpl( + _$GetWalletBalanceResultImpl _value, + $Res Function(_$GetWalletBalanceResultImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @override $Res call({ Object? versionedBalance = null, - Object? topoHeight = null, + Object? topoheight = null, }) { - return _then(_$GetBalanceResultImpl( + return _then(_$GetWalletBalanceResultImpl( versionedBalance: null == versionedBalance ? _value.versionedBalance : versionedBalance // ignore: cast_nullable_to_non_nullable as VersionedBalance, - topoHeight: null == topoHeight - ? _value.topoHeight - : topoHeight // ignore: cast_nullable_to_non_nullable + topoheight: null == topoheight + ? _value.topoheight + : topoheight // ignore: cast_nullable_to_non_nullable as int, )); } @@ -126,74 +131,74 @@ class __$$GetBalanceResultImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() -class _$GetBalanceResultImpl implements _GetBalanceResult { - const _$GetBalanceResultImpl( +class _$GetWalletBalanceResultImpl implements _GetWalletBalanceResult { + const _$GetWalletBalanceResultImpl( {@JsonKey(name: 'version') required this.versionedBalance, - @JsonKey(name: 'topoheight') required this.topoHeight}); + @JsonKey(name: 'topoheight') required this.topoheight}); - factory _$GetBalanceResultImpl.fromJson(Map json) => - _$$GetBalanceResultImplFromJson(json); + factory _$GetWalletBalanceResultImpl.fromJson(Map json) => + _$$GetWalletBalanceResultImplFromJson(json); @override @JsonKey(name: 'version') final VersionedBalance versionedBalance; @override @JsonKey(name: 'topoheight') - final int topoHeight; + final int topoheight; @override String toString() { - return 'GetBalanceResult(versionedBalance: $versionedBalance, topoHeight: $topoHeight)'; + return 'GetWalletBalanceResult(versionedBalance: $versionedBalance, topoheight: $topoheight)'; } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$GetBalanceResultImpl && + other is _$GetWalletBalanceResultImpl && (identical(other.versionedBalance, versionedBalance) || other.versionedBalance == versionedBalance) && - (identical(other.topoHeight, topoHeight) || - other.topoHeight == topoHeight)); + (identical(other.topoheight, topoheight) || + other.topoheight == topoheight)); } @JsonKey(ignore: true) @override - int get hashCode => Object.hash(runtimeType, versionedBalance, topoHeight); + int get hashCode => Object.hash(runtimeType, versionedBalance, topoheight); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$GetBalanceResultImplCopyWith<_$GetBalanceResultImpl> get copyWith => - __$$GetBalanceResultImplCopyWithImpl<_$GetBalanceResultImpl>( - this, _$identity); + _$$GetWalletBalanceResultImplCopyWith<_$GetWalletBalanceResultImpl> + get copyWith => __$$GetWalletBalanceResultImplCopyWithImpl< + _$GetWalletBalanceResultImpl>(this, _$identity); @override Map toJson() { - return _$$GetBalanceResultImplToJson( + return _$$GetWalletBalanceResultImplToJson( this, ); } } -abstract class _GetBalanceResult implements GetBalanceResult { - const factory _GetBalanceResult( +abstract class _GetWalletBalanceResult implements GetWalletBalanceResult { + const factory _GetWalletBalanceResult( {@JsonKey(name: 'version') required final VersionedBalance versionedBalance, - @JsonKey(name: 'topoheight') required final int topoHeight}) = - _$GetBalanceResultImpl; + @JsonKey(name: 'topoheight') required final int topoheight}) = + _$GetWalletBalanceResultImpl; - factory _GetBalanceResult.fromJson(Map json) = - _$GetBalanceResultImpl.fromJson; + factory _GetWalletBalanceResult.fromJson(Map json) = + _$GetWalletBalanceResultImpl.fromJson; @override @JsonKey(name: 'version') VersionedBalance get versionedBalance; @override @JsonKey(name: 'topoheight') - int get topoHeight; + int get topoheight; @override @JsonKey(ignore: true) - _$$GetBalanceResultImplCopyWith<_$GetBalanceResultImpl> get copyWith => - throw _privateConstructorUsedError; + _$$GetWalletBalanceResultImplCopyWith<_$GetWalletBalanceResultImpl> + get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/src/data_transfer_objects/get_balance/get_balance_result.g.dart b/lib/src/data_transfer_objects/get_balance/get_wallet_balance_result.g.dart similarity index 60% rename from lib/src/data_transfer_objects/get_balance/get_balance_result.g.dart rename to lib/src/data_transfer_objects/get_balance/get_wallet_balance_result.g.dart index 230da60..1d4bdb6 100644 --- a/lib/src/data_transfer_objects/get_balance/get_balance_result.g.dart +++ b/lib/src/data_transfer_objects/get_balance/get_wallet_balance_result.g.dart @@ -2,23 +2,23 @@ // ignore_for_file: package_api_docs, non_constant_identifier_names -part of 'get_balance_result.dart'; +part of 'get_wallet_balance_result.dart'; // ************************************************************************** // JsonSerializableGenerator // ************************************************************************** -_$GetBalanceResultImpl _$$GetBalanceResultImplFromJson( +_$GetWalletBalanceResultImpl _$$GetWalletBalanceResultImplFromJson( Map json) => - _$GetBalanceResultImpl( + _$GetWalletBalanceResultImpl( versionedBalance: VersionedBalance.fromJson(json['version'] as Map), - topoHeight: json['topoheight'] as int, + topoheight: json['topoheight'] as int, ); -Map _$$GetBalanceResultImplToJson( - _$GetBalanceResultImpl instance) => +Map _$$GetWalletBalanceResultImplToJson( + _$GetWalletBalanceResultImpl instance) => { 'version': instance.versionedBalance, - 'topoheight': instance.topoHeight, + 'topoheight': instance.topoheight, }; diff --git a/lib/src/data_transfer_objects/get_peers/peer.dart b/lib/src/data_transfer_objects/get_peers/peer.dart index 5810084..7efbeed 100644 --- a/lib/src/data_transfer_objects/get_peers/peer.dart +++ b/lib/src/data_transfer_objects/get_peers/peer.dart @@ -17,6 +17,7 @@ class Peer with _$Peer { @JsonKey(name: 'height') required int height, @JsonKey(name: 'id') required num id, @JsonKey(name: 'last_ping') required int lastPing, + @JsonKey(name: 'local_port') required int localPort, @JsonKey(name: 'pruned_topoheight') int? prunedTopoHeight, @JsonKey(name: 'tag') String? tag, @JsonKey(name: 'top_block_hash') required String topBlockHash, diff --git a/lib/src/data_transfer_objects/get_peers/peer.freezed.dart b/lib/src/data_transfer_objects/get_peers/peer.freezed.dart index 5ffdd8c..56ee4ff 100644 --- a/lib/src/data_transfer_objects/get_peers/peer.freezed.dart +++ b/lib/src/data_transfer_objects/get_peers/peer.freezed.dart @@ -30,6 +30,8 @@ mixin _$Peer { num get id => throw _privateConstructorUsedError; @JsonKey(name: 'last_ping') int get lastPing => throw _privateConstructorUsedError; + @JsonKey(name: 'local_port') + int get localPort => throw _privateConstructorUsedError; @JsonKey(name: 'pruned_topoheight') int? get prunedTopoHeight => throw _privateConstructorUsedError; @JsonKey(name: 'tag') @@ -59,6 +61,7 @@ abstract class $PeerCopyWith<$Res> { @JsonKey(name: 'height') int height, @JsonKey(name: 'id') num id, @JsonKey(name: 'last_ping') int lastPing, + @JsonKey(name: 'local_port') int localPort, @JsonKey(name: 'pruned_topoheight') int? prunedTopoHeight, @JsonKey(name: 'tag') String? tag, @JsonKey(name: 'top_block_hash') String topBlockHash, @@ -85,6 +88,7 @@ class _$PeerCopyWithImpl<$Res, $Val extends Peer> Object? height = null, Object? id = null, Object? lastPing = null, + Object? localPort = null, Object? prunedTopoHeight = freezed, Object? tag = freezed, Object? topBlockHash = null, @@ -113,6 +117,10 @@ class _$PeerCopyWithImpl<$Res, $Val extends Peer> ? _value.lastPing : lastPing // ignore: cast_nullable_to_non_nullable as int, + localPort: null == localPort + ? _value.localPort + : localPort // ignore: cast_nullable_to_non_nullable + as int, prunedTopoHeight: freezed == prunedTopoHeight ? _value.prunedTopoHeight : prunedTopoHeight // ignore: cast_nullable_to_non_nullable @@ -154,6 +162,7 @@ abstract class _$$PeerImplCopyWith<$Res> implements $PeerCopyWith<$Res> { @JsonKey(name: 'height') int height, @JsonKey(name: 'id') num id, @JsonKey(name: 'last_ping') int lastPing, + @JsonKey(name: 'local_port') int localPort, @JsonKey(name: 'pruned_topoheight') int? prunedTopoHeight, @JsonKey(name: 'tag') String? tag, @JsonKey(name: 'top_block_hash') String topBlockHash, @@ -177,6 +186,7 @@ class __$$PeerImplCopyWithImpl<$Res> Object? height = null, Object? id = null, Object? lastPing = null, + Object? localPort = null, Object? prunedTopoHeight = freezed, Object? tag = freezed, Object? topBlockHash = null, @@ -205,6 +215,10 @@ class __$$PeerImplCopyWithImpl<$Res> ? _value.lastPing : lastPing // ignore: cast_nullable_to_non_nullable as int, + localPort: null == localPort + ? _value.localPort + : localPort // ignore: cast_nullable_to_non_nullable + as int, prunedTopoHeight: freezed == prunedTopoHeight ? _value.prunedTopoHeight : prunedTopoHeight // ignore: cast_nullable_to_non_nullable @@ -243,6 +257,7 @@ class _$PeerImpl implements _Peer { @JsonKey(name: 'height') required this.height, @JsonKey(name: 'id') required this.id, @JsonKey(name: 'last_ping') required this.lastPing, + @JsonKey(name: 'local_port') required this.localPort, @JsonKey(name: 'pruned_topoheight') this.prunedTopoHeight, @JsonKey(name: 'tag') this.tag, @JsonKey(name: 'top_block_hash') required this.topBlockHash, @@ -270,6 +285,9 @@ class _$PeerImpl implements _Peer { @JsonKey(name: 'last_ping') final int lastPing; @override + @JsonKey(name: 'local_port') + final int localPort; + @override @JsonKey(name: 'pruned_topoheight') final int? prunedTopoHeight; @override @@ -295,7 +313,7 @@ class _$PeerImpl implements _Peer { @override String toString() { - return 'Peer(address: $address, cumulativeDifficulty: $cumulativeDifficulty, height: $height, id: $id, lastPing: $lastPing, prunedTopoHeight: $prunedTopoHeight, tag: $tag, topBlockHash: $topBlockHash, topoheight: $topoheight, version: $version, peers: $peers)'; + return 'Peer(address: $address, cumulativeDifficulty: $cumulativeDifficulty, height: $height, id: $id, lastPing: $lastPing, localPort: $localPort, prunedTopoHeight: $prunedTopoHeight, tag: $tag, topBlockHash: $topBlockHash, topoheight: $topoheight, version: $version, peers: $peers)'; } @override @@ -310,6 +328,8 @@ class _$PeerImpl implements _Peer { (identical(other.id, id) || other.id == id) && (identical(other.lastPing, lastPing) || other.lastPing == lastPing) && + (identical(other.localPort, localPort) || + other.localPort == localPort) && (identical(other.prunedTopoHeight, prunedTopoHeight) || other.prunedTopoHeight == prunedTopoHeight) && (identical(other.tag, tag) || other.tag == tag) && @@ -330,6 +350,7 @@ class _$PeerImpl implements _Peer { height, id, lastPing, + localPort, prunedTopoHeight, tag, topBlockHash, @@ -359,6 +380,7 @@ abstract class _Peer implements Peer { @JsonKey(name: 'height') required final int height, @JsonKey(name: 'id') required final num id, @JsonKey(name: 'last_ping') required final int lastPing, + @JsonKey(name: 'local_port') required final int localPort, @JsonKey(name: 'pruned_topoheight') final int? prunedTopoHeight, @JsonKey(name: 'tag') final String? tag, @JsonKey(name: 'top_block_hash') required final String topBlockHash, @@ -385,6 +407,9 @@ abstract class _Peer implements Peer { @JsonKey(name: 'last_ping') int get lastPing; @override + @JsonKey(name: 'local_port') + int get localPort; + @override @JsonKey(name: 'pruned_topoheight') int? get prunedTopoHeight; @override diff --git a/lib/src/data_transfer_objects/get_peers/peer.g.dart b/lib/src/data_transfer_objects/get_peers/peer.g.dart index ee0531e..8be6588 100644 --- a/lib/src/data_transfer_objects/get_peers/peer.g.dart +++ b/lib/src/data_transfer_objects/get_peers/peer.g.dart @@ -14,6 +14,7 @@ _$PeerImpl _$$PeerImplFromJson(Map json) => _$PeerImpl( height: json['height'] as int, id: json['id'] as num, lastPing: json['last_ping'] as int, + localPort: json['local_port'] as int, prunedTopoHeight: json['pruned_topoheight'] as int?, tag: json['tag'] as String?, topBlockHash: json['top_block_hash'] as String, @@ -31,6 +32,7 @@ Map _$$PeerImplToJson(_$PeerImpl instance) => 'height': instance.height, 'id': instance.id, 'last_ping': instance.lastPing, + 'local_port': instance.localPort, 'pruned_topoheight': instance.prunedTopoHeight, 'tag': instance.tag, 'top_block_hash': instance.topBlockHash, diff --git a/lib/src/data_transfer_objects/is_account_registered/is_account_registered_params.dart b/lib/src/data_transfer_objects/is_account_registered/is_account_registered_params.dart new file mode 100644 index 0000000..de2bbc5 --- /dev/null +++ b/lib/src/data_transfer_objects/is_account_registered/is_account_registered_params.dart @@ -0,0 +1,21 @@ +// ignore_for_file: invalid_annotation_target + +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'is_account_registered_params.freezed.dart'; + +part 'is_account_registered_params.g.dart'; + +/// @nodoc +@freezed +class IsAccountRegisteredParams with _$IsAccountRegisteredParams { + /// @nodoc + const factory IsAccountRegisteredParams({ + @JsonKey(name: 'address') required String address, + @JsonKey(name: 'in_stable_height') required bool inStableHeight, + }) = _IsAccountRegisteredParams; + + /// @nodoc + factory IsAccountRegisteredParams.fromJson(Map json) => + _$IsAccountRegisteredParamsFromJson(json); +} diff --git a/lib/src/data_transfer_objects/is_account_registered/is_account_registered_params.freezed.dart b/lib/src/data_transfer_objects/is_account_registered/is_account_registered_params.freezed.dart new file mode 100644 index 0000000..1306786 --- /dev/null +++ b/lib/src/data_transfer_objects/is_account_registered/is_account_registered_params.freezed.dart @@ -0,0 +1,189 @@ +// 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 'is_account_registered_params.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'); + +IsAccountRegisteredParams _$IsAccountRegisteredParamsFromJson( + Map json) { + return _IsAccountRegisteredParams.fromJson(json); +} + +/// @nodoc +mixin _$IsAccountRegisteredParams { + @JsonKey(name: 'address') + String get address => throw _privateConstructorUsedError; + @JsonKey(name: 'in_stable_height') + bool get inStableHeight => throw _privateConstructorUsedError; + + Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) + $IsAccountRegisteredParamsCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $IsAccountRegisteredParamsCopyWith<$Res> { + factory $IsAccountRegisteredParamsCopyWith(IsAccountRegisteredParams value, + $Res Function(IsAccountRegisteredParams) then) = + _$IsAccountRegisteredParamsCopyWithImpl<$Res, IsAccountRegisteredParams>; + @useResult + $Res call( + {@JsonKey(name: 'address') String address, + @JsonKey(name: 'in_stable_height') bool inStableHeight}); +} + +/// @nodoc +class _$IsAccountRegisteredParamsCopyWithImpl<$Res, + $Val extends IsAccountRegisteredParams> + implements $IsAccountRegisteredParamsCopyWith<$Res> { + _$IsAccountRegisteredParamsCopyWithImpl(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? address = null, + Object? inStableHeight = null, + }) { + return _then(_value.copyWith( + address: null == address + ? _value.address + : address // ignore: cast_nullable_to_non_nullable + as String, + inStableHeight: null == inStableHeight + ? _value.inStableHeight + : inStableHeight // ignore: cast_nullable_to_non_nullable + as bool, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$IsAccountRegisteredParamsImplCopyWith<$Res> + implements $IsAccountRegisteredParamsCopyWith<$Res> { + factory _$$IsAccountRegisteredParamsImplCopyWith( + _$IsAccountRegisteredParamsImpl value, + $Res Function(_$IsAccountRegisteredParamsImpl) then) = + __$$IsAccountRegisteredParamsImplCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {@JsonKey(name: 'address') String address, + @JsonKey(name: 'in_stable_height') bool inStableHeight}); +} + +/// @nodoc +class __$$IsAccountRegisteredParamsImplCopyWithImpl<$Res> + extends _$IsAccountRegisteredParamsCopyWithImpl<$Res, + _$IsAccountRegisteredParamsImpl> + implements _$$IsAccountRegisteredParamsImplCopyWith<$Res> { + __$$IsAccountRegisteredParamsImplCopyWithImpl( + _$IsAccountRegisteredParamsImpl _value, + $Res Function(_$IsAccountRegisteredParamsImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? address = null, + Object? inStableHeight = null, + }) { + return _then(_$IsAccountRegisteredParamsImpl( + address: null == address + ? _value.address + : address // ignore: cast_nullable_to_non_nullable + as String, + inStableHeight: null == inStableHeight + ? _value.inStableHeight + : inStableHeight // ignore: cast_nullable_to_non_nullable + as bool, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$IsAccountRegisteredParamsImpl implements _IsAccountRegisteredParams { + const _$IsAccountRegisteredParamsImpl( + {@JsonKey(name: 'address') required this.address, + @JsonKey(name: 'in_stable_height') required this.inStableHeight}); + + factory _$IsAccountRegisteredParamsImpl.fromJson(Map json) => + _$$IsAccountRegisteredParamsImplFromJson(json); + + @override + @JsonKey(name: 'address') + final String address; + @override + @JsonKey(name: 'in_stable_height') + final bool inStableHeight; + + @override + String toString() { + return 'IsAccountRegisteredParams(address: $address, inStableHeight: $inStableHeight)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$IsAccountRegisteredParamsImpl && + (identical(other.address, address) || other.address == address) && + (identical(other.inStableHeight, inStableHeight) || + other.inStableHeight == inStableHeight)); + } + + @JsonKey(ignore: true) + @override + int get hashCode => Object.hash(runtimeType, address, inStableHeight); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$IsAccountRegisteredParamsImplCopyWith<_$IsAccountRegisteredParamsImpl> + get copyWith => __$$IsAccountRegisteredParamsImplCopyWithImpl< + _$IsAccountRegisteredParamsImpl>(this, _$identity); + + @override + Map toJson() { + return _$$IsAccountRegisteredParamsImplToJson( + this, + ); + } +} + +abstract class _IsAccountRegisteredParams implements IsAccountRegisteredParams { + const factory _IsAccountRegisteredParams( + {@JsonKey(name: 'address') required final String address, + @JsonKey(name: 'in_stable_height') + required final bool inStableHeight}) = _$IsAccountRegisteredParamsImpl; + + factory _IsAccountRegisteredParams.fromJson(Map json) = + _$IsAccountRegisteredParamsImpl.fromJson; + + @override + @JsonKey(name: 'address') + String get address; + @override + @JsonKey(name: 'in_stable_height') + bool get inStableHeight; + @override + @JsonKey(ignore: true) + _$$IsAccountRegisteredParamsImplCopyWith<_$IsAccountRegisteredParamsImpl> + get copyWith => throw _privateConstructorUsedError; +} diff --git a/lib/src/data_transfer_objects/is_account_registered/is_account_registered_params.g.dart b/lib/src/data_transfer_objects/is_account_registered/is_account_registered_params.g.dart new file mode 100644 index 0000000..b818b92 --- /dev/null +++ b/lib/src/data_transfer_objects/is_account_registered/is_account_registered_params.g.dart @@ -0,0 +1,23 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +// ignore_for_file: package_api_docs, non_constant_identifier_names + +part of 'is_account_registered_params.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_$IsAccountRegisteredParamsImpl _$$IsAccountRegisteredParamsImplFromJson( + Map json) => + _$IsAccountRegisteredParamsImpl( + address: json['address'] as String, + inStableHeight: json['in_stable_height'] as bool, + ); + +Map _$$IsAccountRegisteredParamsImplToJson( + _$IsAccountRegisteredParamsImpl instance) => + { + 'address': instance.address, + 'in_stable_height': instance.inStableHeight, + }; diff --git a/lib/src/data_transfer_objects/p2p_status/p2p_status_result.dart b/lib/src/data_transfer_objects/p2p_status/p2p_status_result.dart index 5874919..1532faf 100644 --- a/lib/src/data_transfer_objects/p2p_status/p2p_status_result.dart +++ b/lib/src/data_transfer_objects/p2p_status/p2p_status_result.dart @@ -12,6 +12,7 @@ class P2pStatusResult with _$P2pStatusResult { /// @nodoc const factory P2pStatusResult({ @JsonKey(name: 'best_topoheight') required int bestTopoHeight, + @JsonKey(name: 'median_topoheight') required int medianTopoHeight, @JsonKey(name: 'max_peers') required int maxPeers, @JsonKey(name: 'our_topoheight') required int ourTopoHeight, @JsonKey(name: 'peer_count') required int peerCount, diff --git a/lib/src/data_transfer_objects/p2p_status/p2p_status_result.freezed.dart b/lib/src/data_transfer_objects/p2p_status/p2p_status_result.freezed.dart index 9245712..45bf509 100644 --- a/lib/src/data_transfer_objects/p2p_status/p2p_status_result.freezed.dart +++ b/lib/src/data_transfer_objects/p2p_status/p2p_status_result.freezed.dart @@ -22,6 +22,8 @@ P2pStatusResult _$P2pStatusResultFromJson(Map json) { mixin _$P2pStatusResult { @JsonKey(name: 'best_topoheight') int get bestTopoHeight => throw _privateConstructorUsedError; + @JsonKey(name: 'median_topoheight') + int get medianTopoHeight => throw _privateConstructorUsedError; @JsonKey(name: 'max_peers') int get maxPeers => throw _privateConstructorUsedError; @JsonKey(name: 'our_topoheight') @@ -47,6 +49,7 @@ abstract class $P2pStatusResultCopyWith<$Res> { @useResult $Res call( {@JsonKey(name: 'best_topoheight') int bestTopoHeight, + @JsonKey(name: 'median_topoheight') int medianTopoHeight, @JsonKey(name: 'max_peers') int maxPeers, @JsonKey(name: 'our_topoheight') int ourTopoHeight, @JsonKey(name: 'peer_count') int peerCount, @@ -68,6 +71,7 @@ class _$P2pStatusResultCopyWithImpl<$Res, $Val extends P2pStatusResult> @override $Res call({ Object? bestTopoHeight = null, + Object? medianTopoHeight = null, Object? maxPeers = null, Object? ourTopoHeight = null, Object? peerCount = null, @@ -79,6 +83,10 @@ class _$P2pStatusResultCopyWithImpl<$Res, $Val extends P2pStatusResult> ? _value.bestTopoHeight : bestTopoHeight // ignore: cast_nullable_to_non_nullable as int, + medianTopoHeight: null == medianTopoHeight + ? _value.medianTopoHeight + : medianTopoHeight // ignore: cast_nullable_to_non_nullable + as int, maxPeers: null == maxPeers ? _value.maxPeers : maxPeers // ignore: cast_nullable_to_non_nullable @@ -113,6 +121,7 @@ abstract class _$$P2pStatusResultImplCopyWith<$Res> @useResult $Res call( {@JsonKey(name: 'best_topoheight') int bestTopoHeight, + @JsonKey(name: 'median_topoheight') int medianTopoHeight, @JsonKey(name: 'max_peers') int maxPeers, @JsonKey(name: 'our_topoheight') int ourTopoHeight, @JsonKey(name: 'peer_count') int peerCount, @@ -132,6 +141,7 @@ class __$$P2pStatusResultImplCopyWithImpl<$Res> @override $Res call({ Object? bestTopoHeight = null, + Object? medianTopoHeight = null, Object? maxPeers = null, Object? ourTopoHeight = null, Object? peerCount = null, @@ -143,6 +153,10 @@ class __$$P2pStatusResultImplCopyWithImpl<$Res> ? _value.bestTopoHeight : bestTopoHeight // ignore: cast_nullable_to_non_nullable as int, + medianTopoHeight: null == medianTopoHeight + ? _value.medianTopoHeight + : medianTopoHeight // ignore: cast_nullable_to_non_nullable + as int, maxPeers: null == maxPeers ? _value.maxPeers : maxPeers // ignore: cast_nullable_to_non_nullable @@ -172,6 +186,7 @@ class __$$P2pStatusResultImplCopyWithImpl<$Res> class _$P2pStatusResultImpl implements _P2pStatusResult { const _$P2pStatusResultImpl( {@JsonKey(name: 'best_topoheight') required this.bestTopoHeight, + @JsonKey(name: 'median_topoheight') required this.medianTopoHeight, @JsonKey(name: 'max_peers') required this.maxPeers, @JsonKey(name: 'our_topoheight') required this.ourTopoHeight, @JsonKey(name: 'peer_count') required this.peerCount, @@ -185,6 +200,9 @@ class _$P2pStatusResultImpl implements _P2pStatusResult { @JsonKey(name: 'best_topoheight') final int bestTopoHeight; @override + @JsonKey(name: 'median_topoheight') + final int medianTopoHeight; + @override @JsonKey(name: 'max_peers') final int maxPeers; @override @@ -202,7 +220,7 @@ class _$P2pStatusResultImpl implements _P2pStatusResult { @override String toString() { - return 'P2pStatusResult(bestTopoHeight: $bestTopoHeight, maxPeers: $maxPeers, ourTopoHeight: $ourTopoHeight, peerCount: $peerCount, peerId: $peerId, tag: $tag)'; + return 'P2pStatusResult(bestTopoHeight: $bestTopoHeight, medianTopoHeight: $medianTopoHeight, maxPeers: $maxPeers, ourTopoHeight: $ourTopoHeight, peerCount: $peerCount, peerId: $peerId, tag: $tag)'; } @override @@ -212,6 +230,8 @@ class _$P2pStatusResultImpl implements _P2pStatusResult { other is _$P2pStatusResultImpl && (identical(other.bestTopoHeight, bestTopoHeight) || other.bestTopoHeight == bestTopoHeight) && + (identical(other.medianTopoHeight, medianTopoHeight) || + other.medianTopoHeight == medianTopoHeight) && (identical(other.maxPeers, maxPeers) || other.maxPeers == maxPeers) && (identical(other.ourTopoHeight, ourTopoHeight) || @@ -224,8 +244,8 @@ class _$P2pStatusResultImpl implements _P2pStatusResult { @JsonKey(ignore: true) @override - int get hashCode => Object.hash(runtimeType, bestTopoHeight, maxPeers, - ourTopoHeight, peerCount, peerId, tag); + int get hashCode => Object.hash(runtimeType, bestTopoHeight, medianTopoHeight, + maxPeers, ourTopoHeight, peerCount, peerId, tag); @JsonKey(ignore: true) @override @@ -245,6 +265,7 @@ class _$P2pStatusResultImpl implements _P2pStatusResult { abstract class _P2pStatusResult implements P2pStatusResult { const factory _P2pStatusResult( {@JsonKey(name: 'best_topoheight') required final int bestTopoHeight, + @JsonKey(name: 'median_topoheight') required final int medianTopoHeight, @JsonKey(name: 'max_peers') required final int maxPeers, @JsonKey(name: 'our_topoheight') required final int ourTopoHeight, @JsonKey(name: 'peer_count') required final int peerCount, @@ -258,6 +279,9 @@ abstract class _P2pStatusResult implements P2pStatusResult { @JsonKey(name: 'best_topoheight') int get bestTopoHeight; @override + @JsonKey(name: 'median_topoheight') + int get medianTopoHeight; + @override @JsonKey(name: 'max_peers') int get maxPeers; @override diff --git a/lib/src/data_transfer_objects/p2p_status/p2p_status_result.g.dart b/lib/src/data_transfer_objects/p2p_status/p2p_status_result.g.dart index 0368b12..e28845b 100644 --- a/lib/src/data_transfer_objects/p2p_status/p2p_status_result.g.dart +++ b/lib/src/data_transfer_objects/p2p_status/p2p_status_result.g.dart @@ -12,6 +12,7 @@ _$P2pStatusResultImpl _$$P2pStatusResultImplFromJson( Map json) => _$P2pStatusResultImpl( bestTopoHeight: json['best_topoheight'] as int, + medianTopoHeight: json['median_topoheight'] as int, maxPeers: json['max_peers'] as int, ourTopoHeight: json['our_topoheight'] as int, peerCount: json['peer_count'] as int, @@ -23,6 +24,7 @@ Map _$$P2pStatusResultImplToJson( _$P2pStatusResultImpl instance) => { 'best_topoheight': instance.bestTopoHeight, + 'median_topoheight': instance.medianTopoHeight, 'max_peers': instance.maxPeers, 'our_topoheight': instance.ourTopoHeight, 'peer_count': instance.peerCount, diff --git a/lib/src/data_transfer_objects/transaction/transaction_response.dart b/lib/src/data_transfer_objects/transaction/transaction_response.dart index 21b90b5..99ae455 100644 --- a/lib/src/data_transfer_objects/transaction/transaction_response.dart +++ b/lib/src/data_transfer_objects/transaction/transaction_response.dart @@ -19,6 +19,9 @@ class TransactionResponse with _$TransactionResponse { required bool inMempool, required int nonce, required String source, + required List rangeProof, + required List> sourceCommitments, + required Map reference, required String signature, }) = _TransactionResponse; @@ -34,6 +37,10 @@ class TransactionResponse with _$TransactionResponse { 'in_mempool': final bool inMempool, 'nonce': final int nonce, 'source': final String source, + 'range_proof': final List rangeProof, + 'source_commitments': final List> + sourceCommitments, + 'reference': final Map reference, 'signature': final String signature, }) { return TransactionResponse( @@ -46,6 +53,9 @@ class TransactionResponse with _$TransactionResponse { inMempool: inMempool, nonce: nonce, source: source, + rangeProof: rangeProof, + sourceCommitments: sourceCommitments, + reference: reference, signature: signature, ); } else if (json @@ -58,6 +68,10 @@ class TransactionResponse with _$TransactionResponse { 'in_mempool': final bool inMempool, 'nonce': final int nonce, 'source': final String source, + 'range_proof': final List rangeProof, + 'source_commitments': final List> + sourceCommitments, + 'reference': final Map reference, 'signature': final String signature, }) { return TransactionResponse( @@ -70,9 +84,12 @@ class TransactionResponse with _$TransactionResponse { inMempool: inMempool, nonce: nonce, source: source, + rangeProof: rangeProof, + sourceCommitments: sourceCommitments, + reference: reference, signature: signature, ); - } else if (json + } /*else if (json case { 'blocks': final List? blocks, 'hash': final String hash, @@ -82,6 +99,10 @@ class TransactionResponse with _$TransactionResponse { 'in_mempool': final bool inMempool, 'nonce': final int nonce, 'source': final String source, + 'range_proof': final List rangeProof, + 'source_commitments': final List> + sourceCommitments, + 'reference': final Map reference, 'signature': final String signature, }) { return TransactionResponse( @@ -94,6 +115,9 @@ class TransactionResponse with _$TransactionResponse { inMempool: inMempool, nonce: nonce, source: source, + rangeProof: rangeProof, + sourceCommitments: sourceCommitments, + reference: reference, signature: signature, ); } else if (json @@ -108,6 +132,10 @@ class TransactionResponse with _$TransactionResponse { 'in_mempool': final bool inMempool, 'nonce': final int nonce, 'source': final String source, + 'range_proof': final List rangeProof, + 'source_commitments': final List> + sourceCommitments, + 'reference': final Map reference, 'signature': final String signature, }) { return TransactionResponse( @@ -120,9 +148,13 @@ class TransactionResponse with _$TransactionResponse { inMempool: inMempool, nonce: nonce, source: source, + rangeProof: rangeProof, + sourceCommitments: sourceCommitments, + reference: reference, signature: signature, ); - } else { + }*/ + else { throw Exception('Unknown type for this transaction : $json'); } } diff --git a/lib/src/data_transfer_objects/transaction/transaction_response.freezed.dart b/lib/src/data_transfer_objects/transaction/transaction_response.freezed.dart index 36efe7a..2283590 100644 --- a/lib/src/data_transfer_objects/transaction/transaction_response.freezed.dart +++ b/lib/src/data_transfer_objects/transaction/transaction_response.freezed.dart @@ -25,6 +25,10 @@ mixin _$TransactionResponse { bool get inMempool => throw _privateConstructorUsedError; int get nonce => throw _privateConstructorUsedError; String get source => throw _privateConstructorUsedError; + List get rangeProof => throw _privateConstructorUsedError; + List> get sourceCommitments => + throw _privateConstructorUsedError; + Map get reference => throw _privateConstructorUsedError; String get signature => throw _privateConstructorUsedError; @JsonKey(ignore: true) @@ -48,6 +52,9 @@ abstract class $TransactionResponseCopyWith<$Res> { bool inMempool, int nonce, String source, + List rangeProof, + List> sourceCommitments, + Map reference, String signature}); $TransactionTypeCopyWith<$Res> get data; @@ -75,6 +82,9 @@ class _$TransactionResponseCopyWithImpl<$Res, $Val extends TransactionResponse> Object? inMempool = null, Object? nonce = null, Object? source = null, + Object? rangeProof = null, + Object? sourceCommitments = null, + Object? reference = null, Object? signature = null, }) { return _then(_value.copyWith( @@ -114,6 +124,18 @@ class _$TransactionResponseCopyWithImpl<$Res, $Val extends TransactionResponse> ? _value.source : source // ignore: cast_nullable_to_non_nullable as String, + rangeProof: null == rangeProof + ? _value.rangeProof + : rangeProof // ignore: cast_nullable_to_non_nullable + as List, + sourceCommitments: null == sourceCommitments + ? _value.sourceCommitments + : sourceCommitments // ignore: cast_nullable_to_non_nullable + as List>, + reference: null == reference + ? _value.reference + : reference // ignore: cast_nullable_to_non_nullable + as Map, signature: null == signature ? _value.signature : signature // ignore: cast_nullable_to_non_nullable @@ -148,6 +170,9 @@ abstract class _$$TransactionResponseImplCopyWith<$Res> bool inMempool, int nonce, String source, + List rangeProof, + List> sourceCommitments, + Map reference, String signature}); @override @@ -174,6 +199,9 @@ class __$$TransactionResponseImplCopyWithImpl<$Res> Object? inMempool = null, Object? nonce = null, Object? source = null, + Object? rangeProof = null, + Object? sourceCommitments = null, + Object? reference = null, Object? signature = null, }) { return _then(_$TransactionResponseImpl( @@ -213,6 +241,18 @@ class __$$TransactionResponseImplCopyWithImpl<$Res> ? _value.source : source // ignore: cast_nullable_to_non_nullable as String, + rangeProof: null == rangeProof + ? _value._rangeProof + : rangeProof // ignore: cast_nullable_to_non_nullable + as List, + sourceCommitments: null == sourceCommitments + ? _value._sourceCommitments + : sourceCommitments // ignore: cast_nullable_to_non_nullable + as List>, + reference: null == reference + ? _value._reference + : reference // ignore: cast_nullable_to_non_nullable + as Map, signature: null == signature ? _value.signature : signature // ignore: cast_nullable_to_non_nullable @@ -234,8 +274,14 @@ class _$TransactionResponseImpl implements _TransactionResponse { required this.inMempool, required this.nonce, required this.source, + required final List rangeProof, + required final List> sourceCommitments, + required final Map reference, required this.signature}) - : _blocks = blocks; + : _blocks = blocks, + _rangeProof = rangeProof, + _sourceCommitments = sourceCommitments, + _reference = reference; final List? _blocks; @override @@ -263,12 +309,37 @@ class _$TransactionResponseImpl implements _TransactionResponse { final int nonce; @override final String source; + final List _rangeProof; + @override + List get rangeProof { + if (_rangeProof is EqualUnmodifiableListView) return _rangeProof; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_rangeProof); + } + + final List> _sourceCommitments; + @override + List> get sourceCommitments { + if (_sourceCommitments is EqualUnmodifiableListView) + return _sourceCommitments; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_sourceCommitments); + } + + final Map _reference; + @override + Map get reference { + if (_reference is EqualUnmodifiableMapView) return _reference; + // ignore: implicit_dynamic_type + return EqualUnmodifiableMapView(_reference); + } + @override final String signature; @override String toString() { - return 'TransactionResponse(blocks: $blocks, executedInBlock: $executedInBlock, hash: $hash, data: $data, fee: $fee, version: $version, inMempool: $inMempool, nonce: $nonce, source: $source, signature: $signature)'; + return 'TransactionResponse(blocks: $blocks, executedInBlock: $executedInBlock, hash: $hash, data: $data, fee: $fee, version: $version, inMempool: $inMempool, nonce: $nonce, source: $source, rangeProof: $rangeProof, sourceCommitments: $sourceCommitments, reference: $reference, signature: $signature)'; } @override @@ -287,6 +358,12 @@ class _$TransactionResponseImpl implements _TransactionResponse { other.inMempool == inMempool) && (identical(other.nonce, nonce) || other.nonce == nonce) && (identical(other.source, source) || other.source == source) && + const DeepCollectionEquality() + .equals(other._rangeProof, _rangeProof) && + const DeepCollectionEquality() + .equals(other._sourceCommitments, _sourceCommitments) && + const DeepCollectionEquality() + .equals(other._reference, _reference) && (identical(other.signature, signature) || other.signature == signature)); } @@ -303,6 +380,9 @@ class _$TransactionResponseImpl implements _TransactionResponse { inMempool, nonce, source, + const DeepCollectionEquality().hash(_rangeProof), + const DeepCollectionEquality().hash(_sourceCommitments), + const DeepCollectionEquality().hash(_reference), signature); @JsonKey(ignore: true) @@ -324,6 +404,9 @@ abstract class _TransactionResponse implements TransactionResponse { required final bool inMempool, required final int nonce, required final String source, + required final List rangeProof, + required final List> sourceCommitments, + required final Map reference, required final String signature}) = _$TransactionResponseImpl; @override @@ -345,6 +428,12 @@ abstract class _TransactionResponse implements TransactionResponse { @override String get source; @override + List get rangeProof; + @override + List> get sourceCommitments; + @override + Map get reference; + @override String get signature; @override @JsonKey(ignore: true) diff --git a/lib/src/data_transfer_objects/transaction/transaction_type.dart b/lib/src/data_transfer_objects/transaction/transaction_type.dart index 8d73269..dfc796e 100644 --- a/lib/src/data_transfer_objects/transaction/transaction_type.dart +++ b/lib/src/data_transfer_objects/transaction/transaction_type.dart @@ -21,7 +21,7 @@ sealed class TransactionType with _$TransactionType { @JsonKey(name: 'amount') required int amount, }) = Burn; - /// @nodoc + /*/// @nodoc const factory TransactionType.callContract({ @JsonKey(name: 'contract') required String contractHash, @JsonKey(name: 'assets') required Map assets, @@ -31,7 +31,7 @@ sealed class TransactionType with _$TransactionType { /// @nodoc const factory TransactionType.deployContract( @JsonKey(name: 'deploy_contract') dynamic deployContract, - ) = DeployContract; + ) = DeployContract;*/ /// @nodoc factory TransactionType.fromJson(Map json) => diff --git a/lib/src/data_transfer_objects/transaction/transaction_type.freezed.dart b/lib/src/data_transfer_objects/transaction/transaction_type.freezed.dart index 4197b22..b17ed17 100644 --- a/lib/src/data_transfer_objects/transaction/transaction_type.freezed.dart +++ b/lib/src/data_transfer_objects/transaction/transaction_type.freezed.dart @@ -20,10 +20,6 @@ TransactionType _$TransactionTypeFromJson(Map json) { return Transfers.fromJson(json); case 'burn': return Burn.fromJson(json); - case 'callContract': - return CallContract.fromJson(json); - case 'deployContract': - return DeployContract.fromJson(json); default: throw CheckedFromJsonException(json, 'runtimeType', 'TransactionType', @@ -41,14 +37,6 @@ mixin _$TransactionType { required TResult Function(@JsonKey(name: 'asset') String asset, @JsonKey(name: 'amount') int amount) burn, - required TResult Function( - @JsonKey(name: 'contract') String contractHash, - @JsonKey(name: 'assets') Map assets, - @JsonKey(name: 'params') Map params) - callContract, - required TResult Function( - @JsonKey(name: 'deploy_contract') dynamic deployContract) - deployContract, }) => throw _privateConstructorUsedError; @optionalTypeArgs @@ -58,13 +46,6 @@ mixin _$TransactionType { TResult? Function(@JsonKey(name: 'asset') String asset, @JsonKey(name: 'amount') int amount)? burn, - TResult? Function( - @JsonKey(name: 'contract') String contractHash, - @JsonKey(name: 'assets') Map assets, - @JsonKey(name: 'params') Map params)? - callContract, - TResult? Function(@JsonKey(name: 'deploy_contract') dynamic deployContract)? - deployContract, }) => throw _privateConstructorUsedError; @optionalTypeArgs @@ -74,13 +55,6 @@ mixin _$TransactionType { TResult Function(@JsonKey(name: 'asset') String asset, @JsonKey(name: 'amount') int amount)? burn, - TResult Function( - @JsonKey(name: 'contract') String contractHash, - @JsonKey(name: 'assets') Map assets, - @JsonKey(name: 'params') Map params)? - callContract, - TResult Function(@JsonKey(name: 'deploy_contract') dynamic deployContract)? - deployContract, required TResult orElse(), }) => throw _privateConstructorUsedError; @@ -88,24 +62,18 @@ mixin _$TransactionType { TResult map({ required TResult Function(Transfers value) transfers, required TResult Function(Burn value) burn, - required TResult Function(CallContract value) callContract, - required TResult Function(DeployContract value) deployContract, }) => throw _privateConstructorUsedError; @optionalTypeArgs TResult? mapOrNull({ TResult? Function(Transfers value)? transfers, TResult? Function(Burn value)? burn, - TResult? Function(CallContract value)? callContract, - TResult? Function(DeployContract value)? deployContract, }) => throw _privateConstructorUsedError; @optionalTypeArgs TResult maybeMap({ TResult Function(Transfers value)? transfers, TResult Function(Burn value)? burn, - TResult Function(CallContract value)? callContract, - TResult Function(DeployContract value)? deployContract, required TResult orElse(), }) => throw _privateConstructorUsedError; @@ -219,14 +187,6 @@ class _$TransfersImpl implements Transfers { required TResult Function(@JsonKey(name: 'asset') String asset, @JsonKey(name: 'amount') int amount) burn, - required TResult Function( - @JsonKey(name: 'contract') String contractHash, - @JsonKey(name: 'assets') Map assets, - @JsonKey(name: 'params') Map params) - callContract, - required TResult Function( - @JsonKey(name: 'deploy_contract') dynamic deployContract) - deployContract, }) { return transfers(this.transfers); } @@ -239,13 +199,6 @@ class _$TransfersImpl implements Transfers { TResult? Function(@JsonKey(name: 'asset') String asset, @JsonKey(name: 'amount') int amount)? burn, - TResult? Function( - @JsonKey(name: 'contract') String contractHash, - @JsonKey(name: 'assets') Map assets, - @JsonKey(name: 'params') Map params)? - callContract, - TResult? Function(@JsonKey(name: 'deploy_contract') dynamic deployContract)? - deployContract, }) { return transfers?.call(this.transfers); } @@ -258,13 +211,6 @@ class _$TransfersImpl implements Transfers { TResult Function(@JsonKey(name: 'asset') String asset, @JsonKey(name: 'amount') int amount)? burn, - TResult Function( - @JsonKey(name: 'contract') String contractHash, - @JsonKey(name: 'assets') Map assets, - @JsonKey(name: 'params') Map params)? - callContract, - TResult Function(@JsonKey(name: 'deploy_contract') dynamic deployContract)? - deployContract, required TResult orElse(), }) { if (transfers != null) { @@ -278,8 +224,6 @@ class _$TransfersImpl implements Transfers { TResult map({ required TResult Function(Transfers value) transfers, required TResult Function(Burn value) burn, - required TResult Function(CallContract value) callContract, - required TResult Function(DeployContract value) deployContract, }) { return transfers(this); } @@ -289,8 +233,6 @@ class _$TransfersImpl implements Transfers { TResult? mapOrNull({ TResult? Function(Transfers value)? transfers, TResult? Function(Burn value)? burn, - TResult? Function(CallContract value)? callContract, - TResult? Function(DeployContract value)? deployContract, }) { return transfers?.call(this); } @@ -300,8 +242,6 @@ class _$TransfersImpl implements Transfers { TResult maybeMap({ TResult Function(Transfers value)? transfers, TResult Function(Burn value)? burn, - TResult Function(CallContract value)? callContract, - TResult Function(DeployContract value)? deployContract, required TResult orElse(), }) { if (transfers != null) { @@ -425,14 +365,6 @@ class _$BurnImpl implements Burn { required TResult Function(@JsonKey(name: 'asset') String asset, @JsonKey(name: 'amount') int amount) burn, - required TResult Function( - @JsonKey(name: 'contract') String contractHash, - @JsonKey(name: 'assets') Map assets, - @JsonKey(name: 'params') Map params) - callContract, - required TResult Function( - @JsonKey(name: 'deploy_contract') dynamic deployContract) - deployContract, }) { return burn(asset, amount); } @@ -445,13 +377,6 @@ class _$BurnImpl implements Burn { TResult? Function(@JsonKey(name: 'asset') String asset, @JsonKey(name: 'amount') int amount)? burn, - TResult? Function( - @JsonKey(name: 'contract') String contractHash, - @JsonKey(name: 'assets') Map assets, - @JsonKey(name: 'params') Map params)? - callContract, - TResult? Function(@JsonKey(name: 'deploy_contract') dynamic deployContract)? - deployContract, }) { return burn?.call(asset, amount); } @@ -464,13 +389,6 @@ class _$BurnImpl implements Burn { TResult Function(@JsonKey(name: 'asset') String asset, @JsonKey(name: 'amount') int amount)? burn, - TResult Function( - @JsonKey(name: 'contract') String contractHash, - @JsonKey(name: 'assets') Map assets, - @JsonKey(name: 'params') Map params)? - callContract, - TResult Function(@JsonKey(name: 'deploy_contract') dynamic deployContract)? - deployContract, required TResult orElse(), }) { if (burn != null) { @@ -484,8 +402,6 @@ class _$BurnImpl implements Burn { TResult map({ required TResult Function(Transfers value) transfers, required TResult Function(Burn value) burn, - required TResult Function(CallContract value) callContract, - required TResult Function(DeployContract value) deployContract, }) { return burn(this); } @@ -495,8 +411,6 @@ class _$BurnImpl implements Burn { TResult? mapOrNull({ TResult? Function(Transfers value)? transfers, TResult? Function(Burn value)? burn, - TResult? Function(CallContract value)? callContract, - TResult? Function(DeployContract value)? deployContract, }) { return burn?.call(this); } @@ -506,8 +420,6 @@ class _$BurnImpl implements Burn { TResult maybeMap({ TResult Function(Transfers value)? transfers, TResult Function(Burn value)? burn, - TResult Function(CallContract value)? callContract, - TResult Function(DeployContract value)? deployContract, required TResult orElse(), }) { if (burn != null) { @@ -539,443 +451,3 @@ abstract class Burn implements TransactionType { _$$BurnImplCopyWith<_$BurnImpl> get copyWith => throw _privateConstructorUsedError; } - -/// @nodoc -abstract class _$$CallContractImplCopyWith<$Res> { - factory _$$CallContractImplCopyWith( - _$CallContractImpl value, $Res Function(_$CallContractImpl) then) = - __$$CallContractImplCopyWithImpl<$Res>; - @useResult - $Res call( - {@JsonKey(name: 'contract') String contractHash, - @JsonKey(name: 'assets') Map assets, - @JsonKey(name: 'params') Map params}); -} - -/// @nodoc -class __$$CallContractImplCopyWithImpl<$Res> - extends _$TransactionTypeCopyWithImpl<$Res, _$CallContractImpl> - implements _$$CallContractImplCopyWith<$Res> { - __$$CallContractImplCopyWithImpl( - _$CallContractImpl _value, $Res Function(_$CallContractImpl) _then) - : super(_value, _then); - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? contractHash = null, - Object? assets = null, - Object? params = null, - }) { - return _then(_$CallContractImpl( - contractHash: null == contractHash - ? _value.contractHash - : contractHash // ignore: cast_nullable_to_non_nullable - as String, - assets: null == assets - ? _value._assets - : assets // ignore: cast_nullable_to_non_nullable - as Map, - params: null == params - ? _value._params - : params // ignore: cast_nullable_to_non_nullable - as Map, - )); - } -} - -/// @nodoc -@JsonSerializable() -class _$CallContractImpl implements CallContract { - const _$CallContractImpl( - {@JsonKey(name: 'contract') required this.contractHash, - @JsonKey(name: 'assets') required final Map assets, - @JsonKey(name: 'params') required final Map params, - final String? $type}) - : _assets = assets, - _params = params, - $type = $type ?? 'callContract'; - - factory _$CallContractImpl.fromJson(Map json) => - _$$CallContractImplFromJson(json); - - @override - @JsonKey(name: 'contract') - final String contractHash; - final Map _assets; - @override - @JsonKey(name: 'assets') - Map get assets { - if (_assets is EqualUnmodifiableMapView) return _assets; - // ignore: implicit_dynamic_type - return EqualUnmodifiableMapView(_assets); - } - - final Map _params; - @override - @JsonKey(name: 'params') - Map get params { - if (_params is EqualUnmodifiableMapView) return _params; - // ignore: implicit_dynamic_type - return EqualUnmodifiableMapView(_params); - } - - @JsonKey(name: 'runtimeType') - final String $type; - - @override - String toString() { - return 'TransactionType.callContract(contractHash: $contractHash, assets: $assets, params: $params)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$CallContractImpl && - (identical(other.contractHash, contractHash) || - other.contractHash == contractHash) && - const DeepCollectionEquality().equals(other._assets, _assets) && - const DeepCollectionEquality().equals(other._params, _params)); - } - - @JsonKey(ignore: true) - @override - int get hashCode => Object.hash( - runtimeType, - contractHash, - const DeepCollectionEquality().hash(_assets), - const DeepCollectionEquality().hash(_params)); - - @JsonKey(ignore: true) - @override - @pragma('vm:prefer-inline') - _$$CallContractImplCopyWith<_$CallContractImpl> get copyWith => - __$$CallContractImplCopyWithImpl<_$CallContractImpl>(this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function( - @JsonKey(name: 'transfers') List transfers) - transfers, - required TResult Function(@JsonKey(name: 'asset') String asset, - @JsonKey(name: 'amount') int amount) - burn, - required TResult Function( - @JsonKey(name: 'contract') String contractHash, - @JsonKey(name: 'assets') Map assets, - @JsonKey(name: 'params') Map params) - callContract, - required TResult Function( - @JsonKey(name: 'deploy_contract') dynamic deployContract) - deployContract, - }) { - return callContract(contractHash, assets, params); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(@JsonKey(name: 'transfers') List transfers)? - transfers, - TResult? Function(@JsonKey(name: 'asset') String asset, - @JsonKey(name: 'amount') int amount)? - burn, - TResult? Function( - @JsonKey(name: 'contract') String contractHash, - @JsonKey(name: 'assets') Map assets, - @JsonKey(name: 'params') Map params)? - callContract, - TResult? Function(@JsonKey(name: 'deploy_contract') dynamic deployContract)? - deployContract, - }) { - return callContract?.call(contractHash, assets, params); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(@JsonKey(name: 'transfers') List transfers)? - transfers, - TResult Function(@JsonKey(name: 'asset') String asset, - @JsonKey(name: 'amount') int amount)? - burn, - TResult Function( - @JsonKey(name: 'contract') String contractHash, - @JsonKey(name: 'assets') Map assets, - @JsonKey(name: 'params') Map params)? - callContract, - TResult Function(@JsonKey(name: 'deploy_contract') dynamic deployContract)? - deployContract, - required TResult orElse(), - }) { - if (callContract != null) { - return callContract(contractHash, assets, params); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(Transfers value) transfers, - required TResult Function(Burn value) burn, - required TResult Function(CallContract value) callContract, - required TResult Function(DeployContract value) deployContract, - }) { - return callContract(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(Transfers value)? transfers, - TResult? Function(Burn value)? burn, - TResult? Function(CallContract value)? callContract, - TResult? Function(DeployContract value)? deployContract, - }) { - return callContract?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(Transfers value)? transfers, - TResult Function(Burn value)? burn, - TResult Function(CallContract value)? callContract, - TResult Function(DeployContract value)? deployContract, - required TResult orElse(), - }) { - if (callContract != null) { - return callContract(this); - } - return orElse(); - } - - @override - Map toJson() { - return _$$CallContractImplToJson( - this, - ); - } -} - -abstract class CallContract implements TransactionType { - const factory CallContract( - {@JsonKey(name: 'contract') required final String contractHash, - @JsonKey(name: 'assets') required final Map assets, - @JsonKey(name: 'params') - required final Map params}) = _$CallContractImpl; - - factory CallContract.fromJson(Map json) = - _$CallContractImpl.fromJson; - - @JsonKey(name: 'contract') - String get contractHash; - @JsonKey(name: 'assets') - Map get assets; - @JsonKey(name: 'params') - Map get params; - @JsonKey(ignore: true) - _$$CallContractImplCopyWith<_$CallContractImpl> get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class _$$DeployContractImplCopyWith<$Res> { - factory _$$DeployContractImplCopyWith(_$DeployContractImpl value, - $Res Function(_$DeployContractImpl) then) = - __$$DeployContractImplCopyWithImpl<$Res>; - @useResult - $Res call({@JsonKey(name: 'deploy_contract') dynamic deployContract}); -} - -/// @nodoc -class __$$DeployContractImplCopyWithImpl<$Res> - extends _$TransactionTypeCopyWithImpl<$Res, _$DeployContractImpl> - implements _$$DeployContractImplCopyWith<$Res> { - __$$DeployContractImplCopyWithImpl( - _$DeployContractImpl _value, $Res Function(_$DeployContractImpl) _then) - : super(_value, _then); - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? deployContract = freezed, - }) { - return _then(_$DeployContractImpl( - freezed == deployContract - ? _value.deployContract - : deployContract // ignore: cast_nullable_to_non_nullable - as dynamic, - )); - } -} - -/// @nodoc -@JsonSerializable() -class _$DeployContractImpl implements DeployContract { - const _$DeployContractImpl( - @JsonKey(name: 'deploy_contract') this.deployContract, - {final String? $type}) - : $type = $type ?? 'deployContract'; - - factory _$DeployContractImpl.fromJson(Map json) => - _$$DeployContractImplFromJson(json); - - @override - @JsonKey(name: 'deploy_contract') - final dynamic deployContract; - - @JsonKey(name: 'runtimeType') - final String $type; - - @override - String toString() { - return 'TransactionType.deployContract(deployContract: $deployContract)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$DeployContractImpl && - const DeepCollectionEquality() - .equals(other.deployContract, deployContract)); - } - - @JsonKey(ignore: true) - @override - int get hashCode => Object.hash( - runtimeType, const DeepCollectionEquality().hash(deployContract)); - - @JsonKey(ignore: true) - @override - @pragma('vm:prefer-inline') - _$$DeployContractImplCopyWith<_$DeployContractImpl> get copyWith => - __$$DeployContractImplCopyWithImpl<_$DeployContractImpl>( - this, _$identity); - - @override - @optionalTypeArgs - TResult when({ - required TResult Function( - @JsonKey(name: 'transfers') List transfers) - transfers, - required TResult Function(@JsonKey(name: 'asset') String asset, - @JsonKey(name: 'amount') int amount) - burn, - required TResult Function( - @JsonKey(name: 'contract') String contractHash, - @JsonKey(name: 'assets') Map assets, - @JsonKey(name: 'params') Map params) - callContract, - required TResult Function( - @JsonKey(name: 'deploy_contract') dynamic deployContract) - deployContract, - }) { - return deployContract(this.deployContract); - } - - @override - @optionalTypeArgs - TResult? whenOrNull({ - TResult? Function(@JsonKey(name: 'transfers') List transfers)? - transfers, - TResult? Function(@JsonKey(name: 'asset') String asset, - @JsonKey(name: 'amount') int amount)? - burn, - TResult? Function( - @JsonKey(name: 'contract') String contractHash, - @JsonKey(name: 'assets') Map assets, - @JsonKey(name: 'params') Map params)? - callContract, - TResult? Function(@JsonKey(name: 'deploy_contract') dynamic deployContract)? - deployContract, - }) { - return deployContract?.call(this.deployContract); - } - - @override - @optionalTypeArgs - TResult maybeWhen({ - TResult Function(@JsonKey(name: 'transfers') List transfers)? - transfers, - TResult Function(@JsonKey(name: 'asset') String asset, - @JsonKey(name: 'amount') int amount)? - burn, - TResult Function( - @JsonKey(name: 'contract') String contractHash, - @JsonKey(name: 'assets') Map assets, - @JsonKey(name: 'params') Map params)? - callContract, - TResult Function(@JsonKey(name: 'deploy_contract') dynamic deployContract)? - deployContract, - required TResult orElse(), - }) { - if (deployContract != null) { - return deployContract(this.deployContract); - } - return orElse(); - } - - @override - @optionalTypeArgs - TResult map({ - required TResult Function(Transfers value) transfers, - required TResult Function(Burn value) burn, - required TResult Function(CallContract value) callContract, - required TResult Function(DeployContract value) deployContract, - }) { - return deployContract(this); - } - - @override - @optionalTypeArgs - TResult? mapOrNull({ - TResult? Function(Transfers value)? transfers, - TResult? Function(Burn value)? burn, - TResult? Function(CallContract value)? callContract, - TResult? Function(DeployContract value)? deployContract, - }) { - return deployContract?.call(this); - } - - @override - @optionalTypeArgs - TResult maybeMap({ - TResult Function(Transfers value)? transfers, - TResult Function(Burn value)? burn, - TResult Function(CallContract value)? callContract, - TResult Function(DeployContract value)? deployContract, - required TResult orElse(), - }) { - if (deployContract != null) { - return deployContract(this); - } - return orElse(); - } - - @override - Map toJson() { - return _$$DeployContractImplToJson( - this, - ); - } -} - -abstract class DeployContract implements TransactionType { - const factory DeployContract( - @JsonKey(name: 'deploy_contract') final dynamic deployContract) = - _$DeployContractImpl; - - factory DeployContract.fromJson(Map json) = - _$DeployContractImpl.fromJson; - - @JsonKey(name: 'deploy_contract') - dynamic get deployContract; - @JsonKey(ignore: true) - _$$DeployContractImplCopyWith<_$DeployContractImpl> get copyWith => - throw _privateConstructorUsedError; -} diff --git a/lib/src/data_transfer_objects/transaction/transaction_type.g.dart b/lib/src/data_transfer_objects/transaction/transaction_type.g.dart index 318b831..d9e0bce 100644 --- a/lib/src/data_transfer_objects/transaction/transaction_type.g.dart +++ b/lib/src/data_transfer_objects/transaction/transaction_type.g.dart @@ -34,32 +34,3 @@ Map _$$BurnImplToJson(_$BurnImpl instance) => 'amount': instance.amount, 'runtimeType': instance.$type, }; - -_$CallContractImpl _$$CallContractImplFromJson(Map json) => - _$CallContractImpl( - contractHash: json['contract'] as String, - assets: Map.from(json['assets'] as Map), - params: json['params'] as Map, - $type: json['runtimeType'] as String?, - ); - -Map _$$CallContractImplToJson(_$CallContractImpl instance) => - { - 'contract': instance.contractHash, - 'assets': instance.assets, - 'params': instance.params, - 'runtimeType': instance.$type, - }; - -_$DeployContractImpl _$$DeployContractImplFromJson(Map json) => - _$DeployContractImpl( - json['deploy_contract'], - $type: json['runtimeType'] as String?, - ); - -Map _$$DeployContractImplToJson( - _$DeployContractImpl instance) => - { - 'deploy_contract': instance.deployContract, - 'runtimeType': instance.$type, - }; diff --git a/lib/src/data_transfer_objects/transaction/transfer.dart b/lib/src/data_transfer_objects/transaction/transfer.dart index 5823b3a..03605d1 100644 --- a/lib/src/data_transfer_objects/transaction/transfer.dart +++ b/lib/src/data_transfer_objects/transaction/transfer.dart @@ -11,9 +11,12 @@ part 'transfer.g.dart'; class Transfer with _$Transfer { /// @nodoc const factory Transfer({ - @JsonKey(name: 'amount') required int amount, @JsonKey(name: 'asset') required String asset, - @JsonKey(name: 'to') required String to, + @JsonKey(name: 'commitment') required List commitment, + @JsonKey(name: 'ct_validity_proof') + required Map validityProof, + @JsonKey(name: 'destination') required String destination, + @JsonKey(name: 'receiver_handle') required List receiverHandle, @JsonKey(name: 'extra_data') dynamic extraData, }) = _Transfer; diff --git a/lib/src/data_transfer_objects/transaction/transfer.freezed.dart b/lib/src/data_transfer_objects/transaction/transfer.freezed.dart index 51ed890..84c71cc 100644 --- a/lib/src/data_transfer_objects/transaction/transfer.freezed.dart +++ b/lib/src/data_transfer_objects/transaction/transfer.freezed.dart @@ -20,12 +20,16 @@ Transfer _$TransferFromJson(Map json) { /// @nodoc mixin _$Transfer { - @JsonKey(name: 'amount') - int get amount => throw _privateConstructorUsedError; @JsonKey(name: 'asset') String get asset => throw _privateConstructorUsedError; - @JsonKey(name: 'to') - String get to => throw _privateConstructorUsedError; + @JsonKey(name: 'commitment') + List get commitment => throw _privateConstructorUsedError; + @JsonKey(name: 'ct_validity_proof') + Map get validityProof => throw _privateConstructorUsedError; + @JsonKey(name: 'destination') + String get destination => throw _privateConstructorUsedError; + @JsonKey(name: 'receiver_handle') + List get receiverHandle => throw _privateConstructorUsedError; @JsonKey(name: 'extra_data') dynamic get extraData => throw _privateConstructorUsedError; @@ -41,9 +45,11 @@ abstract class $TransferCopyWith<$Res> { _$TransferCopyWithImpl<$Res, Transfer>; @useResult $Res call( - {@JsonKey(name: 'amount') int amount, - @JsonKey(name: 'asset') String asset, - @JsonKey(name: 'to') String to, + {@JsonKey(name: 'asset') String asset, + @JsonKey(name: 'commitment') List commitment, + @JsonKey(name: 'ct_validity_proof') Map validityProof, + @JsonKey(name: 'destination') String destination, + @JsonKey(name: 'receiver_handle') List receiverHandle, @JsonKey(name: 'extra_data') dynamic extraData}); } @@ -60,24 +66,34 @@ class _$TransferCopyWithImpl<$Res, $Val extends Transfer> @pragma('vm:prefer-inline') @override $Res call({ - Object? amount = null, Object? asset = null, - Object? to = null, + Object? commitment = null, + Object? validityProof = null, + Object? destination = null, + Object? receiverHandle = null, Object? extraData = freezed, }) { return _then(_value.copyWith( - 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, - to: null == to - ? _value.to - : to // ignore: cast_nullable_to_non_nullable + commitment: null == commitment + ? _value.commitment + : commitment // ignore: cast_nullable_to_non_nullable + as List, + validityProof: null == validityProof + ? _value.validityProof + : validityProof // ignore: cast_nullable_to_non_nullable + as Map, + destination: null == destination + ? _value.destination + : destination // ignore: cast_nullable_to_non_nullable as String, + receiverHandle: null == receiverHandle + ? _value.receiverHandle + : receiverHandle // ignore: cast_nullable_to_non_nullable + as List, extraData: freezed == extraData ? _value.extraData : extraData // ignore: cast_nullable_to_non_nullable @@ -95,9 +111,11 @@ abstract class _$$TransferImplCopyWith<$Res> @override @useResult $Res call( - {@JsonKey(name: 'amount') int amount, - @JsonKey(name: 'asset') String asset, - @JsonKey(name: 'to') String to, + {@JsonKey(name: 'asset') String asset, + @JsonKey(name: 'commitment') List commitment, + @JsonKey(name: 'ct_validity_proof') Map validityProof, + @JsonKey(name: 'destination') String destination, + @JsonKey(name: 'receiver_handle') List receiverHandle, @JsonKey(name: 'extra_data') dynamic extraData}); } @@ -112,24 +130,34 @@ class __$$TransferImplCopyWithImpl<$Res> @pragma('vm:prefer-inline') @override $Res call({ - Object? amount = null, Object? asset = null, - Object? to = null, + Object? commitment = null, + Object? validityProof = null, + Object? destination = null, + Object? receiverHandle = null, Object? extraData = freezed, }) { return _then(_$TransferImpl( - 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, - to: null == to - ? _value.to - : to // ignore: cast_nullable_to_non_nullable + commitment: null == commitment + ? _value._commitment + : commitment // ignore: cast_nullable_to_non_nullable + as List, + validityProof: null == validityProof + ? _value._validityProof + : validityProof // ignore: cast_nullable_to_non_nullable + as Map, + destination: null == destination + ? _value.destination + : destination // ignore: cast_nullable_to_non_nullable as String, + receiverHandle: null == receiverHandle + ? _value._receiverHandle + : receiverHandle // ignore: cast_nullable_to_non_nullable + as List, extraData: freezed == extraData ? _value.extraData : extraData // ignore: cast_nullable_to_non_nullable @@ -142,30 +170,60 @@ class __$$TransferImplCopyWithImpl<$Res> @JsonSerializable() class _$TransferImpl implements _Transfer { const _$TransferImpl( - {@JsonKey(name: 'amount') required this.amount, - @JsonKey(name: 'asset') required this.asset, - @JsonKey(name: 'to') required this.to, - @JsonKey(name: 'extra_data') this.extraData}); + {@JsonKey(name: 'asset') required this.asset, + @JsonKey(name: 'commitment') required final List commitment, + @JsonKey(name: 'ct_validity_proof') + required final Map validityProof, + @JsonKey(name: 'destination') required this.destination, + @JsonKey(name: 'receiver_handle') required final List receiverHandle, + @JsonKey(name: 'extra_data') this.extraData}) + : _commitment = commitment, + _validityProof = validityProof, + _receiverHandle = receiverHandle; factory _$TransferImpl.fromJson(Map json) => _$$TransferImplFromJson(json); - @override - @JsonKey(name: 'amount') - final int amount; @override @JsonKey(name: 'asset') final String asset; + final List _commitment; + @override + @JsonKey(name: 'commitment') + List get commitment { + if (_commitment is EqualUnmodifiableListView) return _commitment; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_commitment); + } + + final Map _validityProof; + @override + @JsonKey(name: 'ct_validity_proof') + Map get validityProof { + if (_validityProof is EqualUnmodifiableMapView) return _validityProof; + // ignore: implicit_dynamic_type + return EqualUnmodifiableMapView(_validityProof); + } + @override - @JsonKey(name: 'to') - final String to; + @JsonKey(name: 'destination') + final String destination; + final List _receiverHandle; + @override + @JsonKey(name: 'receiver_handle') + List get receiverHandle { + if (_receiverHandle is EqualUnmodifiableListView) return _receiverHandle; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_receiverHandle); + } + @override @JsonKey(name: 'extra_data') final dynamic extraData; @override String toString() { - return 'Transfer(amount: $amount, asset: $asset, to: $to, extraData: $extraData)'; + return 'Transfer(asset: $asset, commitment: $commitment, validityProof: $validityProof, destination: $destination, receiverHandle: $receiverHandle, extraData: $extraData)'; } @override @@ -173,15 +231,27 @@ class _$TransferImpl implements _Transfer { return identical(this, other) || (other.runtimeType == runtimeType && other is _$TransferImpl && - (identical(other.amount, amount) || other.amount == amount) && (identical(other.asset, asset) || other.asset == asset) && - (identical(other.to, to) || other.to == to) && + const DeepCollectionEquality() + .equals(other._commitment, _commitment) && + const DeepCollectionEquality() + .equals(other._validityProof, _validityProof) && + (identical(other.destination, destination) || + other.destination == destination) && + const DeepCollectionEquality() + .equals(other._receiverHandle, _receiverHandle) && const DeepCollectionEquality().equals(other.extraData, extraData)); } @JsonKey(ignore: true) @override - int get hashCode => Object.hash(runtimeType, amount, asset, to, + int get hashCode => Object.hash( + runtimeType, + asset, + const DeepCollectionEquality().hash(_commitment), + const DeepCollectionEquality().hash(_validityProof), + destination, + const DeepCollectionEquality().hash(_receiverHandle), const DeepCollectionEquality().hash(extraData)); @JsonKey(ignore: true) @@ -200,23 +270,32 @@ class _$TransferImpl implements _Transfer { abstract class _Transfer implements Transfer { const factory _Transfer( - {@JsonKey(name: 'amount') required final int amount, - @JsonKey(name: 'asset') required final String asset, - @JsonKey(name: 'to') required final String to, + {@JsonKey(name: 'asset') required final String asset, + @JsonKey(name: 'commitment') required final List commitment, + @JsonKey(name: 'ct_validity_proof') + required final Map validityProof, + @JsonKey(name: 'destination') required final String destination, + @JsonKey(name: 'receiver_handle') required final List receiverHandle, @JsonKey(name: 'extra_data') final dynamic extraData}) = _$TransferImpl; factory _Transfer.fromJson(Map json) = _$TransferImpl.fromJson; - @override - @JsonKey(name: 'amount') - int get amount; @override @JsonKey(name: 'asset') String get asset; @override - @JsonKey(name: 'to') - String get to; + @JsonKey(name: 'commitment') + List get commitment; + @override + @JsonKey(name: 'ct_validity_proof') + Map get validityProof; + @override + @JsonKey(name: 'destination') + String get destination; + @override + @JsonKey(name: 'receiver_handle') + List get receiverHandle; @override @JsonKey(name: 'extra_data') dynamic get extraData; diff --git a/lib/src/data_transfer_objects/transaction/transfer.g.dart b/lib/src/data_transfer_objects/transaction/transfer.g.dart index 83c991f..0f674fb 100644 --- a/lib/src/data_transfer_objects/transaction/transfer.g.dart +++ b/lib/src/data_transfer_objects/transaction/transfer.g.dart @@ -10,16 +10,23 @@ part of 'transfer.dart'; _$TransferImpl _$$TransferImplFromJson(Map json) => _$TransferImpl( - amount: json['amount'] as int, asset: json['asset'] as String, - to: json['to'] as String, + commitment: + (json['commitment'] as List).map((e) => e as int).toList(), + validityProof: json['ct_validity_proof'] as Map, + destination: json['destination'] as String, + receiverHandle: (json['receiver_handle'] as List) + .map((e) => e as int) + .toList(), extraData: json['extra_data'], ); Map _$$TransferImplToJson(_$TransferImpl instance) => { - 'amount': instance.amount, 'asset': instance.asset, - 'to': instance.to, + 'commitment': instance.commitment, + 'ct_validity_proof': instance.validityProof, + 'destination': instance.destination, + 'receiver_handle': instance.receiverHandle, 'extra_data': instance.extraData, }; diff --git a/lib/src/data_transfer_objects/versioned_balance/versioned_balance.dart b/lib/src/data_transfer_objects/versioned_balance/versioned_balance.dart index ffcdd0c..787c95e 100644 --- a/lib/src/data_transfer_objects/versioned_balance/versioned_balance.dart +++ b/lib/src/data_transfer_objects/versioned_balance/versioned_balance.dart @@ -11,8 +11,10 @@ part 'versioned_balance.g.dart'; class VersionedBalance with _$VersionedBalance { /// @nodoc const factory VersionedBalance({ - @JsonKey(name: 'balance') required int balance, - @JsonKey(name: 'previous_topoheight') int? previousTopoHeight, + @JsonKey(name: 'balance_type') required String balanceType, + @JsonKey(name: 'final_balance') required Map finalBalance, + @JsonKey(name: 'previous_topoheight') required int previousTopoheight, + @JsonKey(name: 'output_balance') required dynamic outputBalance, }) = _VersionedBalance; /// @nodoc diff --git a/lib/src/data_transfer_objects/versioned_balance/versioned_balance.freezed.dart b/lib/src/data_transfer_objects/versioned_balance/versioned_balance.freezed.dart index 83cb8ee..b237d47 100644 --- a/lib/src/data_transfer_objects/versioned_balance/versioned_balance.freezed.dart +++ b/lib/src/data_transfer_objects/versioned_balance/versioned_balance.freezed.dart @@ -20,10 +20,14 @@ VersionedBalance _$VersionedBalanceFromJson(Map json) { /// @nodoc mixin _$VersionedBalance { - @JsonKey(name: 'balance') - int get balance => throw _privateConstructorUsedError; + @JsonKey(name: 'balance_type') + String get balanceType => throw _privateConstructorUsedError; + @JsonKey(name: 'final_balance') + Map get finalBalance => throw _privateConstructorUsedError; @JsonKey(name: 'previous_topoheight') - int? get previousTopoHeight => throw _privateConstructorUsedError; + int get previousTopoheight => throw _privateConstructorUsedError; + @JsonKey(name: 'output_balance') + dynamic get outputBalance => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) @@ -38,8 +42,10 @@ abstract class $VersionedBalanceCopyWith<$Res> { _$VersionedBalanceCopyWithImpl<$Res, VersionedBalance>; @useResult $Res call( - {@JsonKey(name: 'balance') int balance, - @JsonKey(name: 'previous_topoheight') int? previousTopoHeight}); + {@JsonKey(name: 'balance_type') String balanceType, + @JsonKey(name: 'final_balance') Map finalBalance, + @JsonKey(name: 'previous_topoheight') int previousTopoheight, + @JsonKey(name: 'output_balance') dynamic outputBalance}); } /// @nodoc @@ -55,18 +61,28 @@ class _$VersionedBalanceCopyWithImpl<$Res, $Val extends VersionedBalance> @pragma('vm:prefer-inline') @override $Res call({ - Object? balance = null, - Object? previousTopoHeight = freezed, + Object? balanceType = null, + Object? finalBalance = null, + Object? previousTopoheight = null, + Object? outputBalance = freezed, }) { return _then(_value.copyWith( - balance: null == balance - ? _value.balance - : balance // ignore: cast_nullable_to_non_nullable + balanceType: null == balanceType + ? _value.balanceType + : balanceType // ignore: cast_nullable_to_non_nullable + as String, + finalBalance: null == finalBalance + ? _value.finalBalance + : finalBalance // ignore: cast_nullable_to_non_nullable + as Map, + previousTopoheight: null == previousTopoheight + ? _value.previousTopoheight + : previousTopoheight // ignore: cast_nullable_to_non_nullable as int, - previousTopoHeight: freezed == previousTopoHeight - ? _value.previousTopoHeight - : previousTopoHeight // ignore: cast_nullable_to_non_nullable - as int?, + outputBalance: freezed == outputBalance + ? _value.outputBalance + : outputBalance // ignore: cast_nullable_to_non_nullable + as dynamic, ) as $Val); } } @@ -80,8 +96,10 @@ abstract class _$$VersionedBalanceImplCopyWith<$Res> @override @useResult $Res call( - {@JsonKey(name: 'balance') int balance, - @JsonKey(name: 'previous_topoheight') int? previousTopoHeight}); + {@JsonKey(name: 'balance_type') String balanceType, + @JsonKey(name: 'final_balance') Map finalBalance, + @JsonKey(name: 'previous_topoheight') int previousTopoheight, + @JsonKey(name: 'output_balance') dynamic outputBalance}); } /// @nodoc @@ -95,18 +113,28 @@ class __$$VersionedBalanceImplCopyWithImpl<$Res> @pragma('vm:prefer-inline') @override $Res call({ - Object? balance = null, - Object? previousTopoHeight = freezed, + Object? balanceType = null, + Object? finalBalance = null, + Object? previousTopoheight = null, + Object? outputBalance = freezed, }) { return _then(_$VersionedBalanceImpl( - balance: null == balance - ? _value.balance - : balance // ignore: cast_nullable_to_non_nullable + balanceType: null == balanceType + ? _value.balanceType + : balanceType // ignore: cast_nullable_to_non_nullable + as String, + finalBalance: null == finalBalance + ? _value._finalBalance + : finalBalance // ignore: cast_nullable_to_non_nullable + as Map, + previousTopoheight: null == previousTopoheight + ? _value.previousTopoheight + : previousTopoheight // ignore: cast_nullable_to_non_nullable as int, - previousTopoHeight: freezed == previousTopoHeight - ? _value.previousTopoHeight - : previousTopoHeight // ignore: cast_nullable_to_non_nullable - as int?, + outputBalance: freezed == outputBalance + ? _value.outputBalance + : outputBalance // ignore: cast_nullable_to_non_nullable + as dynamic, )); } } @@ -115,22 +143,38 @@ class __$$VersionedBalanceImplCopyWithImpl<$Res> @JsonSerializable() class _$VersionedBalanceImpl implements _VersionedBalance { const _$VersionedBalanceImpl( - {@JsonKey(name: 'balance') required this.balance, - @JsonKey(name: 'previous_topoheight') this.previousTopoHeight}); + {@JsonKey(name: 'balance_type') required this.balanceType, + @JsonKey(name: 'final_balance') + required final Map finalBalance, + @JsonKey(name: 'previous_topoheight') required this.previousTopoheight, + @JsonKey(name: 'output_balance') required this.outputBalance}) + : _finalBalance = finalBalance; factory _$VersionedBalanceImpl.fromJson(Map json) => _$$VersionedBalanceImplFromJson(json); @override - @JsonKey(name: 'balance') - final int balance; + @JsonKey(name: 'balance_type') + final String balanceType; + final Map _finalBalance; + @override + @JsonKey(name: 'final_balance') + Map get finalBalance { + if (_finalBalance is EqualUnmodifiableMapView) return _finalBalance; + // ignore: implicit_dynamic_type + return EqualUnmodifiableMapView(_finalBalance); + } + @override @JsonKey(name: 'previous_topoheight') - final int? previousTopoHeight; + final int previousTopoheight; + @override + @JsonKey(name: 'output_balance') + final dynamic outputBalance; @override String toString() { - return 'VersionedBalance(balance: $balance, previousTopoHeight: $previousTopoHeight)'; + return 'VersionedBalance(balanceType: $balanceType, finalBalance: $finalBalance, previousTopoheight: $previousTopoheight, outputBalance: $outputBalance)'; } @override @@ -138,14 +182,24 @@ class _$VersionedBalanceImpl implements _VersionedBalance { return identical(this, other) || (other.runtimeType == runtimeType && other is _$VersionedBalanceImpl && - (identical(other.balance, balance) || other.balance == balance) && - (identical(other.previousTopoHeight, previousTopoHeight) || - other.previousTopoHeight == previousTopoHeight)); + (identical(other.balanceType, balanceType) || + other.balanceType == balanceType) && + const DeepCollectionEquality() + .equals(other._finalBalance, _finalBalance) && + (identical(other.previousTopoheight, previousTopoheight) || + other.previousTopoheight == previousTopoheight) && + const DeepCollectionEquality() + .equals(other.outputBalance, outputBalance)); } @JsonKey(ignore: true) @override - int get hashCode => Object.hash(runtimeType, balance, previousTopoHeight); + int get hashCode => Object.hash( + runtimeType, + balanceType, + const DeepCollectionEquality().hash(_finalBalance), + previousTopoheight, + const DeepCollectionEquality().hash(outputBalance)); @JsonKey(ignore: true) @override @@ -164,19 +218,29 @@ class _$VersionedBalanceImpl implements _VersionedBalance { abstract class _VersionedBalance implements VersionedBalance { const factory _VersionedBalance( - {@JsonKey(name: 'balance') required final int balance, + {@JsonKey(name: 'balance_type') required final String balanceType, + @JsonKey(name: 'final_balance') + required final Map finalBalance, @JsonKey(name: 'previous_topoheight') - final int? previousTopoHeight}) = _$VersionedBalanceImpl; + required final int previousTopoheight, + @JsonKey(name: 'output_balance') + required final dynamic outputBalance}) = _$VersionedBalanceImpl; factory _VersionedBalance.fromJson(Map json) = _$VersionedBalanceImpl.fromJson; @override - @JsonKey(name: 'balance') - int get balance; + @JsonKey(name: 'balance_type') + String get balanceType; + @override + @JsonKey(name: 'final_balance') + Map get finalBalance; @override @JsonKey(name: 'previous_topoheight') - int? get previousTopoHeight; + int get previousTopoheight; + @override + @JsonKey(name: 'output_balance') + dynamic get outputBalance; @override @JsonKey(ignore: true) _$$VersionedBalanceImplCopyWith<_$VersionedBalanceImpl> get copyWith => diff --git a/lib/src/data_transfer_objects/versioned_balance/versioned_balance.g.dart b/lib/src/data_transfer_objects/versioned_balance/versioned_balance.g.dart index 4a5db8f..ee253d1 100644 --- a/lib/src/data_transfer_objects/versioned_balance/versioned_balance.g.dart +++ b/lib/src/data_transfer_objects/versioned_balance/versioned_balance.g.dart @@ -11,13 +11,17 @@ part of 'versioned_balance.dart'; _$VersionedBalanceImpl _$$VersionedBalanceImplFromJson( Map json) => _$VersionedBalanceImpl( - balance: json['balance'] as int, - previousTopoHeight: json['previous_topoheight'] as int?, + balanceType: json['balance_type'] as String, + finalBalance: json['final_balance'] as Map, + previousTopoheight: json['previous_topoheight'] as int, + outputBalance: json['output_balance'], ); Map _$$VersionedBalanceImplToJson( _$VersionedBalanceImpl instance) => { - 'balance': instance.balance, - 'previous_topoheight': instance.previousTopoHeight, + 'balance_type': instance.balanceType, + 'final_balance': instance.finalBalance, + 'previous_topoheight': instance.previousTopoheight, + 'output_balance': instance.outputBalance, }; diff --git a/lib/src/data_transfer_objects/wallet/build_transaction/build_transaction_params.dart b/lib/src/data_transfer_objects/wallet/build_transaction/build_transaction_params.dart index fbb4721..2a91dc5 100644 --- a/lib/src/data_transfer_objects/wallet/build_transaction/build_transaction_params.dart +++ b/lib/src/data_transfer_objects/wallet/build_transaction/build_transaction_params.dart @@ -32,7 +32,7 @@ class BuildTransactionParams with _$BuildTransactionParams { 'broadcast': broadcast, if (txAsHex != null) 'tx_as_hex': txAsHex, }, - CallContract() => { +/* CallContract() => { 'call_contract': transactionType.toJson(), if (feeBuilder != null) 'fee': feeBuilder, 'broadcast': broadcast, @@ -43,6 +43,6 @@ class BuildTransactionParams with _$BuildTransactionParams { if (feeBuilder != null) 'fee': feeBuilder, 'broadcast': broadcast, if (txAsHex != null) 'tx_as_hex': txAsHex, - }, + },*/ }; } diff --git a/lib/src/data_transfer_objects/wallet/build_transaction/wallet_transaction_response.dart b/lib/src/data_transfer_objects/wallet/build_transaction/wallet_transaction_response.dart new file mode 100644 index 0000000..0342330 --- /dev/null +++ b/lib/src/data_transfer_objects/wallet/build_transaction/wallet_transaction_response.dart @@ -0,0 +1,83 @@ +// ignore_for_file: invalid_annotation_target + +import 'package:freezed_annotation/freezed_annotation.dart'; +import 'package:xelis_dart_sdk/xelis_dart_sdk.dart'; + +part 'wallet_transaction_response.freezed.dart'; + +/// @nodoc +@freezed +class WalletTransactionResponse with _$WalletTransactionResponse { + /// @nodoc + const factory WalletTransactionResponse({ + required String? txAsHex, + required TransactionType data, + required int fee, + required int version, + required int nonce, + required String source, + required List rangeProof, + required List> sourceCommitments, + required Map reference, + required String signature, + }) = _WalletTransactionResponse; + + /// @nodoc + factory WalletTransactionResponse.fromJson(Map json) { + if (json + case { + 'tx_as_hex': final String? txAsHex, + 'data': final Map transfers, + 'fee': final int fee, + 'version': final int version, + 'nonce': final int nonce, + 'source': final String source, + 'range_proof': final List rangeProof, + 'source_commitments': final List> + sourceCommitments, + 'reference': final Map reference, + 'signature': final String signature, + }) { + return WalletTransactionResponse( + txAsHex: txAsHex, + data: Transfers.fromJson(transfers), + fee: fee, + version: version, + nonce: nonce, + source: source, + rangeProof: rangeProof, + sourceCommitments: sourceCommitments, + reference: reference, + signature: signature, + ); + } else if (json + case { + 'tx_as_hex': final String? txAsHex, + 'data': {'burn': final Map burn}, + 'fee': final int fee, + 'version': final int version, + 'nonce': final int nonce, + 'source': final String source, + 'range_proof': final List rangeProof, + 'source_commitments': final List> + sourceCommitments, + 'reference': final Map reference, + 'signature': final String signature, + }) { + return WalletTransactionResponse( + txAsHex: txAsHex, + data: Burn.fromJson(burn), + fee: fee, + version: version, + nonce: nonce, + source: source, + rangeProof: rangeProof, + sourceCommitments: sourceCommitments, + reference: reference, + signature: signature, + ); + } else { + throw Exception('Unknown type for this transaction : $json'); + } + } +} diff --git a/lib/src/data_transfer_objects/wallet/build_transaction/wallet_transaction_response.freezed.dart b/lib/src/data_transfer_objects/wallet/build_transaction/wallet_transaction_response.freezed.dart new file mode 100644 index 0000000..572b8c9 --- /dev/null +++ b/lib/src/data_transfer_objects/wallet/build_transaction/wallet_transaction_response.freezed.dart @@ -0,0 +1,372 @@ +// 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 'wallet_transaction_response.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'); + +/// @nodoc +mixin _$WalletTransactionResponse { + String? get txAsHex => throw _privateConstructorUsedError; + TransactionType get data => throw _privateConstructorUsedError; + int get fee => throw _privateConstructorUsedError; + int get version => throw _privateConstructorUsedError; + int get nonce => throw _privateConstructorUsedError; + String get source => throw _privateConstructorUsedError; + List get rangeProof => throw _privateConstructorUsedError; + List> get sourceCommitments => + throw _privateConstructorUsedError; + Map get reference => throw _privateConstructorUsedError; + String get signature => throw _privateConstructorUsedError; + + @JsonKey(ignore: true) + $WalletTransactionResponseCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $WalletTransactionResponseCopyWith<$Res> { + factory $WalletTransactionResponseCopyWith(WalletTransactionResponse value, + $Res Function(WalletTransactionResponse) then) = + _$WalletTransactionResponseCopyWithImpl<$Res, WalletTransactionResponse>; + @useResult + $Res call( + {String? txAsHex, + TransactionType data, + int fee, + int version, + int nonce, + String source, + List rangeProof, + List> sourceCommitments, + Map reference, + String signature}); + + $TransactionTypeCopyWith<$Res> get data; +} + +/// @nodoc +class _$WalletTransactionResponseCopyWithImpl<$Res, + $Val extends WalletTransactionResponse> + implements $WalletTransactionResponseCopyWith<$Res> { + _$WalletTransactionResponseCopyWithImpl(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? txAsHex = freezed, + Object? data = null, + Object? fee = null, + Object? version = null, + Object? nonce = null, + Object? source = null, + Object? rangeProof = null, + Object? sourceCommitments = null, + Object? reference = null, + Object? signature = null, + }) { + return _then(_value.copyWith( + txAsHex: freezed == txAsHex + ? _value.txAsHex + : txAsHex // ignore: cast_nullable_to_non_nullable + as String?, + data: null == data + ? _value.data + : data // ignore: cast_nullable_to_non_nullable + as TransactionType, + fee: null == fee + ? _value.fee + : fee // ignore: cast_nullable_to_non_nullable + as int, + version: null == version + ? _value.version + : version // ignore: cast_nullable_to_non_nullable + as int, + nonce: null == nonce + ? _value.nonce + : nonce // ignore: cast_nullable_to_non_nullable + as int, + source: null == source + ? _value.source + : source // ignore: cast_nullable_to_non_nullable + as String, + rangeProof: null == rangeProof + ? _value.rangeProof + : rangeProof // ignore: cast_nullable_to_non_nullable + as List, + sourceCommitments: null == sourceCommitments + ? _value.sourceCommitments + : sourceCommitments // ignore: cast_nullable_to_non_nullable + as List>, + reference: null == reference + ? _value.reference + : reference // ignore: cast_nullable_to_non_nullable + as Map, + signature: null == signature + ? _value.signature + : signature // ignore: cast_nullable_to_non_nullable + as String, + ) as $Val); + } + + @override + @pragma('vm:prefer-inline') + $TransactionTypeCopyWith<$Res> get data { + return $TransactionTypeCopyWith<$Res>(_value.data, (value) { + return _then(_value.copyWith(data: value) as $Val); + }); + } +} + +/// @nodoc +abstract class _$$WalletTransactionResponseImplCopyWith<$Res> + implements $WalletTransactionResponseCopyWith<$Res> { + factory _$$WalletTransactionResponseImplCopyWith( + _$WalletTransactionResponseImpl value, + $Res Function(_$WalletTransactionResponseImpl) then) = + __$$WalletTransactionResponseImplCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {String? txAsHex, + TransactionType data, + int fee, + int version, + int nonce, + String source, + List rangeProof, + List> sourceCommitments, + Map reference, + String signature}); + + @override + $TransactionTypeCopyWith<$Res> get data; +} + +/// @nodoc +class __$$WalletTransactionResponseImplCopyWithImpl<$Res> + extends _$WalletTransactionResponseCopyWithImpl<$Res, + _$WalletTransactionResponseImpl> + implements _$$WalletTransactionResponseImplCopyWith<$Res> { + __$$WalletTransactionResponseImplCopyWithImpl( + _$WalletTransactionResponseImpl _value, + $Res Function(_$WalletTransactionResponseImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? txAsHex = freezed, + Object? data = null, + Object? fee = null, + Object? version = null, + Object? nonce = null, + Object? source = null, + Object? rangeProof = null, + Object? sourceCommitments = null, + Object? reference = null, + Object? signature = null, + }) { + return _then(_$WalletTransactionResponseImpl( + txAsHex: freezed == txAsHex + ? _value.txAsHex + : txAsHex // ignore: cast_nullable_to_non_nullable + as String?, + data: null == data + ? _value.data + : data // ignore: cast_nullable_to_non_nullable + as TransactionType, + fee: null == fee + ? _value.fee + : fee // ignore: cast_nullable_to_non_nullable + as int, + version: null == version + ? _value.version + : version // ignore: cast_nullable_to_non_nullable + as int, + nonce: null == nonce + ? _value.nonce + : nonce // ignore: cast_nullable_to_non_nullable + as int, + source: null == source + ? _value.source + : source // ignore: cast_nullable_to_non_nullable + as String, + rangeProof: null == rangeProof + ? _value._rangeProof + : rangeProof // ignore: cast_nullable_to_non_nullable + as List, + sourceCommitments: null == sourceCommitments + ? _value._sourceCommitments + : sourceCommitments // ignore: cast_nullable_to_non_nullable + as List>, + reference: null == reference + ? _value._reference + : reference // ignore: cast_nullable_to_non_nullable + as Map, + signature: null == signature + ? _value.signature + : signature // ignore: cast_nullable_to_non_nullable + as String, + )); + } +} + +/// @nodoc + +class _$WalletTransactionResponseImpl implements _WalletTransactionResponse { + const _$WalletTransactionResponseImpl( + {required this.txAsHex, + required this.data, + required this.fee, + required this.version, + required this.nonce, + required this.source, + required final List rangeProof, + required final List> sourceCommitments, + required final Map reference, + required this.signature}) + : _rangeProof = rangeProof, + _sourceCommitments = sourceCommitments, + _reference = reference; + + @override + final String? txAsHex; + @override + final TransactionType data; + @override + final int fee; + @override + final int version; + @override + final int nonce; + @override + final String source; + final List _rangeProof; + @override + List get rangeProof { + if (_rangeProof is EqualUnmodifiableListView) return _rangeProof; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_rangeProof); + } + + final List> _sourceCommitments; + @override + List> get sourceCommitments { + if (_sourceCommitments is EqualUnmodifiableListView) + return _sourceCommitments; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_sourceCommitments); + } + + final Map _reference; + @override + Map get reference { + if (_reference is EqualUnmodifiableMapView) return _reference; + // ignore: implicit_dynamic_type + return EqualUnmodifiableMapView(_reference); + } + + @override + final String signature; + + @override + String toString() { + return 'WalletTransactionResponse(txAsHex: $txAsHex, data: $data, fee: $fee, version: $version, nonce: $nonce, source: $source, rangeProof: $rangeProof, sourceCommitments: $sourceCommitments, reference: $reference, signature: $signature)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$WalletTransactionResponseImpl && + (identical(other.txAsHex, txAsHex) || other.txAsHex == txAsHex) && + (identical(other.data, data) || other.data == data) && + (identical(other.fee, fee) || other.fee == fee) && + (identical(other.version, version) || other.version == version) && + (identical(other.nonce, nonce) || other.nonce == nonce) && + (identical(other.source, source) || other.source == source) && + const DeepCollectionEquality() + .equals(other._rangeProof, _rangeProof) && + const DeepCollectionEquality() + .equals(other._sourceCommitments, _sourceCommitments) && + const DeepCollectionEquality() + .equals(other._reference, _reference) && + (identical(other.signature, signature) || + other.signature == signature)); + } + + @override + int get hashCode => Object.hash( + runtimeType, + txAsHex, + data, + fee, + version, + nonce, + source, + const DeepCollectionEquality().hash(_rangeProof), + const DeepCollectionEquality().hash(_sourceCommitments), + const DeepCollectionEquality().hash(_reference), + signature); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$WalletTransactionResponseImplCopyWith<_$WalletTransactionResponseImpl> + get copyWith => __$$WalletTransactionResponseImplCopyWithImpl< + _$WalletTransactionResponseImpl>(this, _$identity); +} + +abstract class _WalletTransactionResponse implements WalletTransactionResponse { + const factory _WalletTransactionResponse( + {required final String? txAsHex, + required final TransactionType data, + required final int fee, + required final int version, + required final int nonce, + required final String source, + required final List rangeProof, + required final List> sourceCommitments, + required final Map reference, + required final String signature}) = _$WalletTransactionResponseImpl; + + @override + String? get txAsHex; + @override + TransactionType get data; + @override + int get fee; + @override + int get version; + @override + int get nonce; + @override + String get source; + @override + List get rangeProof; + @override + List> get sourceCommitments; + @override + Map get reference; + @override + String get signature; + @override + @JsonKey(ignore: true) + _$$WalletTransactionResponseImplCopyWith<_$WalletTransactionResponseImpl> + get copyWith => throw _privateConstructorUsedError; +} diff --git a/lib/src/data_transfer_objects/get_balance/get_balance_params.dart b/lib/src/data_transfer_objects/wallet/get_balance/get_balance_params.dart similarity index 80% rename from lib/src/data_transfer_objects/get_balance/get_balance_params.dart rename to lib/src/data_transfer_objects/wallet/get_balance/get_balance_params.dart index 178d4d4..9c6b229 100644 --- a/lib/src/data_transfer_objects/get_balance/get_balance_params.dart +++ b/lib/src/data_transfer_objects/wallet/get_balance/get_balance_params.dart @@ -11,8 +11,7 @@ part 'get_balance_params.g.dart'; class GetBalanceParams with _$GetBalanceParams { /// @nodoc const factory GetBalanceParams({ - @JsonKey(name: 'address') required String address, - @JsonKey(name: 'asset') required String asset, + @JsonKey(name: 'asset') String? assetHash, }) = _GetBalanceParams; /// @nodoc diff --git a/lib/src/data_transfer_objects/get_balance/get_balance_params.freezed.dart b/lib/src/data_transfer_objects/wallet/get_balance/get_balance_params.freezed.dart similarity index 70% rename from lib/src/data_transfer_objects/get_balance/get_balance_params.freezed.dart rename to lib/src/data_transfer_objects/wallet/get_balance/get_balance_params.freezed.dart index 119caea..333cf99 100644 --- a/lib/src/data_transfer_objects/get_balance/get_balance_params.freezed.dart +++ b/lib/src/data_transfer_objects/wallet/get_balance/get_balance_params.freezed.dart @@ -20,10 +20,8 @@ GetBalanceParams _$GetBalanceParamsFromJson(Map json) { /// @nodoc mixin _$GetBalanceParams { - @JsonKey(name: 'address') - String get address => throw _privateConstructorUsedError; @JsonKey(name: 'asset') - String get asset => throw _privateConstructorUsedError; + String? get assetHash => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) @@ -37,9 +35,7 @@ abstract class $GetBalanceParamsCopyWith<$Res> { GetBalanceParams value, $Res Function(GetBalanceParams) then) = _$GetBalanceParamsCopyWithImpl<$Res, GetBalanceParams>; @useResult - $Res call( - {@JsonKey(name: 'address') String address, - @JsonKey(name: 'asset') String asset}); + $Res call({@JsonKey(name: 'asset') String? assetHash}); } /// @nodoc @@ -55,18 +51,13 @@ class _$GetBalanceParamsCopyWithImpl<$Res, $Val extends GetBalanceParams> @pragma('vm:prefer-inline') @override $Res call({ - Object? address = null, - Object? asset = null, + Object? assetHash = freezed, }) { return _then(_value.copyWith( - address: null == address - ? _value.address - : address // ignore: cast_nullable_to_non_nullable - as String, - asset: null == asset - ? _value.asset - : asset // ignore: cast_nullable_to_non_nullable - as String, + assetHash: freezed == assetHash + ? _value.assetHash + : assetHash // ignore: cast_nullable_to_non_nullable + as String?, ) as $Val); } } @@ -79,9 +70,7 @@ abstract class _$$GetBalanceParamsImplCopyWith<$Res> __$$GetBalanceParamsImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {@JsonKey(name: 'address') String address, - @JsonKey(name: 'asset') String asset}); + $Res call({@JsonKey(name: 'asset') String? assetHash}); } /// @nodoc @@ -95,18 +84,13 @@ class __$$GetBalanceParamsImplCopyWithImpl<$Res> @pragma('vm:prefer-inline') @override $Res call({ - Object? address = null, - Object? asset = null, + Object? assetHash = freezed, }) { return _then(_$GetBalanceParamsImpl( - address: null == address - ? _value.address - : address // ignore: cast_nullable_to_non_nullable - as String, - asset: null == asset - ? _value.asset - : asset // ignore: cast_nullable_to_non_nullable - as String, + assetHash: freezed == assetHash + ? _value.assetHash + : assetHash // ignore: cast_nullable_to_non_nullable + as String?, )); } } @@ -114,23 +98,18 @@ class __$$GetBalanceParamsImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() class _$GetBalanceParamsImpl implements _GetBalanceParams { - const _$GetBalanceParamsImpl( - {@JsonKey(name: 'address') required this.address, - @JsonKey(name: 'asset') required this.asset}); + const _$GetBalanceParamsImpl({@JsonKey(name: 'asset') this.assetHash}); factory _$GetBalanceParamsImpl.fromJson(Map json) => _$$GetBalanceParamsImplFromJson(json); - @override - @JsonKey(name: 'address') - final String address; @override @JsonKey(name: 'asset') - final String asset; + final String? assetHash; @override String toString() { - return 'GetBalanceParams(address: $address, asset: $asset)'; + return 'GetBalanceParams(assetHash: $assetHash)'; } @override @@ -138,13 +117,13 @@ class _$GetBalanceParamsImpl implements _GetBalanceParams { return identical(this, other) || (other.runtimeType == runtimeType && other is _$GetBalanceParamsImpl && - (identical(other.address, address) || other.address == address) && - (identical(other.asset, asset) || other.asset == asset)); + (identical(other.assetHash, assetHash) || + other.assetHash == assetHash)); } @JsonKey(ignore: true) @override - int get hashCode => Object.hash(runtimeType, address, asset); + int get hashCode => Object.hash(runtimeType, assetHash); @JsonKey(ignore: true) @override @@ -163,19 +142,15 @@ class _$GetBalanceParamsImpl implements _GetBalanceParams { abstract class _GetBalanceParams implements GetBalanceParams { const factory _GetBalanceParams( - {@JsonKey(name: 'address') required final String address, - @JsonKey(name: 'asset') required final String asset}) = + {@JsonKey(name: 'asset') final String? assetHash}) = _$GetBalanceParamsImpl; factory _GetBalanceParams.fromJson(Map json) = _$GetBalanceParamsImpl.fromJson; - @override - @JsonKey(name: 'address') - String get address; @override @JsonKey(name: 'asset') - String get asset; + String? get assetHash; @override @JsonKey(ignore: true) _$$GetBalanceParamsImplCopyWith<_$GetBalanceParamsImpl> get copyWith => diff --git a/lib/src/data_transfer_objects/get_balance/get_balance_params.g.dart b/lib/src/data_transfer_objects/wallet/get_balance/get_balance_params.g.dart similarity index 80% rename from lib/src/data_transfer_objects/get_balance/get_balance_params.g.dart rename to lib/src/data_transfer_objects/wallet/get_balance/get_balance_params.g.dart index e2e71d7..f7b12bf 100644 --- a/lib/src/data_transfer_objects/get_balance/get_balance_params.g.dart +++ b/lib/src/data_transfer_objects/wallet/get_balance/get_balance_params.g.dart @@ -11,13 +11,11 @@ part of 'get_balance_params.dart'; _$GetBalanceParamsImpl _$$GetBalanceParamsImplFromJson( Map json) => _$GetBalanceParamsImpl( - address: json['address'] as String, - asset: json['asset'] as String, + assetHash: json['asset'] as String?, ); Map _$$GetBalanceParamsImplToJson( _$GetBalanceParamsImpl instance) => { - 'address': instance.address, - 'asset': instance.asset, + 'asset': instance.assetHash, }; diff --git a/lib/src/data_transfer_objects/wallet/list_transactions/list_transactions_params.dart b/lib/src/data_transfer_objects/wallet/list_transactions/list_transactions_params.dart index 97be0f5..f978738 100644 --- a/lib/src/data_transfer_objects/wallet/list_transactions/list_transactions_params.dart +++ b/lib/src/data_transfer_objects/wallet/list_transactions/list_transactions_params.dart @@ -19,6 +19,8 @@ class ListTransactionsParams with _$ListTransactionsParams { @JsonKey(name: 'accept_outgoing') bool? acceptOutgoing, @JsonKey(name: 'accept_coinbase') bool? acceptCoinbase, @JsonKey(name: 'accept_burn') bool? acceptBurn, + // TODO + @JsonKey(name: 'query') dynamic query, }) = _ListTransactionsParams; /// @nodoc diff --git a/lib/src/data_transfer_objects/wallet/list_transactions/list_transactions_params.freezed.dart b/lib/src/data_transfer_objects/wallet/list_transactions/list_transactions_params.freezed.dart index e813996..3259ace 100644 --- a/lib/src/data_transfer_objects/wallet/list_transactions/list_transactions_params.freezed.dart +++ b/lib/src/data_transfer_objects/wallet/list_transactions/list_transactions_params.freezed.dart @@ -34,7 +34,9 @@ mixin _$ListTransactionsParams { @JsonKey(name: 'accept_coinbase') bool? get acceptCoinbase => throw _privateConstructorUsedError; @JsonKey(name: 'accept_burn') - bool? get acceptBurn => throw _privateConstructorUsedError; + bool? get acceptBurn => throw _privateConstructorUsedError; // TODO + @JsonKey(name: 'query') + dynamic get query => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) @@ -55,7 +57,8 @@ abstract class $ListTransactionsParamsCopyWith<$Res> { @JsonKey(name: 'accept_incoming') bool? acceptIncoming, @JsonKey(name: 'accept_outgoing') bool? acceptOutgoing, @JsonKey(name: 'accept_coinbase') bool? acceptCoinbase, - @JsonKey(name: 'accept_burn') bool? acceptBurn}); + @JsonKey(name: 'accept_burn') bool? acceptBurn, + @JsonKey(name: 'query') dynamic query}); } /// @nodoc @@ -79,6 +82,7 @@ class _$ListTransactionsParamsCopyWithImpl<$Res, Object? acceptOutgoing = freezed, Object? acceptCoinbase = freezed, Object? acceptBurn = freezed, + Object? query = freezed, }) { return _then(_value.copyWith( minTopoHeight: freezed == minTopoHeight @@ -109,6 +113,10 @@ class _$ListTransactionsParamsCopyWithImpl<$Res, ? _value.acceptBurn : acceptBurn // ignore: cast_nullable_to_non_nullable as bool?, + query: freezed == query + ? _value.query + : query // ignore: cast_nullable_to_non_nullable + as dynamic, ) as $Val); } } @@ -129,7 +137,8 @@ abstract class _$$ListTransactionsParamsImplCopyWith<$Res> @JsonKey(name: 'accept_incoming') bool? acceptIncoming, @JsonKey(name: 'accept_outgoing') bool? acceptOutgoing, @JsonKey(name: 'accept_coinbase') bool? acceptCoinbase, - @JsonKey(name: 'accept_burn') bool? acceptBurn}); + @JsonKey(name: 'accept_burn') bool? acceptBurn, + @JsonKey(name: 'query') dynamic query}); } /// @nodoc @@ -152,6 +161,7 @@ class __$$ListTransactionsParamsImplCopyWithImpl<$Res> Object? acceptOutgoing = freezed, Object? acceptCoinbase = freezed, Object? acceptBurn = freezed, + Object? query = freezed, }) { return _then(_$ListTransactionsParamsImpl( minTopoHeight: freezed == minTopoHeight @@ -182,6 +192,10 @@ class __$$ListTransactionsParamsImplCopyWithImpl<$Res> ? _value.acceptBurn : acceptBurn // ignore: cast_nullable_to_non_nullable as bool?, + query: freezed == query + ? _value.query + : query // ignore: cast_nullable_to_non_nullable + as dynamic, )); } } @@ -197,7 +211,8 @@ class _$ListTransactionsParamsImpl implements _ListTransactionsParams { @JsonKey(name: 'accept_incoming') this.acceptIncoming, @JsonKey(name: 'accept_outgoing') this.acceptOutgoing, @JsonKey(name: 'accept_coinbase') this.acceptCoinbase, - @JsonKey(name: 'accept_burn') this.acceptBurn}); + @JsonKey(name: 'accept_burn') this.acceptBurn, + @JsonKey(name: 'query') this.query}); factory _$ListTransactionsParamsImpl.fromJson(Map json) => _$$ListTransactionsParamsImplFromJson(json); @@ -223,10 +238,14 @@ class _$ListTransactionsParamsImpl implements _ListTransactionsParams { @override @JsonKey(name: 'accept_burn') final bool? acceptBurn; +// TODO + @override + @JsonKey(name: 'query') + final dynamic query; @override String toString() { - return 'ListTransactionsParams(minTopoHeight: $minTopoHeight, maxTopoHeight: $maxTopoHeight, address: $address, acceptIncoming: $acceptIncoming, acceptOutgoing: $acceptOutgoing, acceptCoinbase: $acceptCoinbase, acceptBurn: $acceptBurn)'; + return 'ListTransactionsParams(minTopoHeight: $minTopoHeight, maxTopoHeight: $maxTopoHeight, address: $address, acceptIncoming: $acceptIncoming, acceptOutgoing: $acceptOutgoing, acceptCoinbase: $acceptCoinbase, acceptBurn: $acceptBurn, query: $query)'; } @override @@ -246,13 +265,22 @@ class _$ListTransactionsParamsImpl implements _ListTransactionsParams { (identical(other.acceptCoinbase, acceptCoinbase) || other.acceptCoinbase == acceptCoinbase) && (identical(other.acceptBurn, acceptBurn) || - other.acceptBurn == acceptBurn)); + other.acceptBurn == acceptBurn) && + const DeepCollectionEquality().equals(other.query, query)); } @JsonKey(ignore: true) @override - int get hashCode => Object.hash(runtimeType, minTopoHeight, maxTopoHeight, - address, acceptIncoming, acceptOutgoing, acceptCoinbase, acceptBurn); + int get hashCode => Object.hash( + runtimeType, + minTopoHeight, + maxTopoHeight, + address, + acceptIncoming, + acceptOutgoing, + acceptCoinbase, + acceptBurn, + const DeepCollectionEquality().hash(query)); @JsonKey(ignore: true) @override @@ -277,7 +305,8 @@ abstract class _ListTransactionsParams implements ListTransactionsParams { @JsonKey(name: 'accept_incoming') final bool? acceptIncoming, @JsonKey(name: 'accept_outgoing') final bool? acceptOutgoing, @JsonKey(name: 'accept_coinbase') final bool? acceptCoinbase, - @JsonKey(name: 'accept_burn') final bool? acceptBurn}) = + @JsonKey(name: 'accept_burn') final bool? acceptBurn, + @JsonKey(name: 'query') final dynamic query}) = _$ListTransactionsParamsImpl; factory _ListTransactionsParams.fromJson(Map json) = @@ -304,6 +333,9 @@ abstract class _ListTransactionsParams implements ListTransactionsParams { @override @JsonKey(name: 'accept_burn') bool? get acceptBurn; + @override // TODO + @JsonKey(name: 'query') + dynamic get query; @override @JsonKey(ignore: true) _$$ListTransactionsParamsImplCopyWith<_$ListTransactionsParamsImpl> diff --git a/lib/src/data_transfer_objects/wallet/list_transactions/list_transactions_params.g.dart b/lib/src/data_transfer_objects/wallet/list_transactions/list_transactions_params.g.dart index dddd496..392036e 100644 --- a/lib/src/data_transfer_objects/wallet/list_transactions/list_transactions_params.g.dart +++ b/lib/src/data_transfer_objects/wallet/list_transactions/list_transactions_params.g.dart @@ -18,6 +18,7 @@ _$ListTransactionsParamsImpl _$$ListTransactionsParamsImplFromJson( acceptOutgoing: json['accept_outgoing'] as bool?, acceptCoinbase: json['accept_coinbase'] as bool?, acceptBurn: json['accept_burn'] as bool?, + query: json['query'], ); Map _$$ListTransactionsParamsImplToJson( @@ -37,5 +38,6 @@ Map _$$ListTransactionsParamsImplToJson( writeNotNull('accept_outgoing', instance.acceptOutgoing); writeNotNull('accept_coinbase', instance.acceptCoinbase); writeNotNull('accept_burn', instance.acceptBurn); + writeNotNull('query', instance.query); return val; } diff --git a/lib/src/data_transfer_objects/wallet/rescan/rescan_params.dart b/lib/src/data_transfer_objects/wallet/rescan/rescan_params.dart index f82e77b..7f37da7 100644 --- a/lib/src/data_transfer_objects/wallet/rescan/rescan_params.dart +++ b/lib/src/data_transfer_objects/wallet/rescan/rescan_params.dart @@ -11,7 +11,7 @@ part 'rescan_params.g.dart'; class RescanParams with _$RescanParams { /// @nodoc const factory RescanParams({ - @JsonKey(name: 'topoheight') required int topoHeight, + @JsonKey(name: 'until_topoheight') required int untilTopoheight, }) = _RescanParams; /// @nodoc diff --git a/lib/src/data_transfer_objects/wallet/rescan/rescan_params.freezed.dart b/lib/src/data_transfer_objects/wallet/rescan/rescan_params.freezed.dart index 64f1340..3a7a1cb 100644 --- a/lib/src/data_transfer_objects/wallet/rescan/rescan_params.freezed.dart +++ b/lib/src/data_transfer_objects/wallet/rescan/rescan_params.freezed.dart @@ -20,8 +20,8 @@ RescanParams _$RescanParamsFromJson(Map json) { /// @nodoc mixin _$RescanParams { - @JsonKey(name: 'topoheight') - int get topoHeight => throw _privateConstructorUsedError; + @JsonKey(name: 'until_topoheight') + int get untilTopoheight => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) @@ -35,7 +35,7 @@ abstract class $RescanParamsCopyWith<$Res> { RescanParams value, $Res Function(RescanParams) then) = _$RescanParamsCopyWithImpl<$Res, RescanParams>; @useResult - $Res call({@JsonKey(name: 'topoheight') int topoHeight}); + $Res call({@JsonKey(name: 'until_topoheight') int untilTopoheight}); } /// @nodoc @@ -51,12 +51,12 @@ class _$RescanParamsCopyWithImpl<$Res, $Val extends RescanParams> @pragma('vm:prefer-inline') @override $Res call({ - Object? topoHeight = null, + Object? untilTopoheight = null, }) { return _then(_value.copyWith( - topoHeight: null == topoHeight - ? _value.topoHeight - : topoHeight // ignore: cast_nullable_to_non_nullable + untilTopoheight: null == untilTopoheight + ? _value.untilTopoheight + : untilTopoheight // ignore: cast_nullable_to_non_nullable as int, ) as $Val); } @@ -70,7 +70,7 @@ abstract class _$$RescanParamsImplCopyWith<$Res> __$$RescanParamsImplCopyWithImpl<$Res>; @override @useResult - $Res call({@JsonKey(name: 'topoheight') int topoHeight}); + $Res call({@JsonKey(name: 'until_topoheight') int untilTopoheight}); } /// @nodoc @@ -84,12 +84,12 @@ class __$$RescanParamsImplCopyWithImpl<$Res> @pragma('vm:prefer-inline') @override $Res call({ - Object? topoHeight = null, + Object? untilTopoheight = null, }) { return _then(_$RescanParamsImpl( - topoHeight: null == topoHeight - ? _value.topoHeight - : topoHeight // ignore: cast_nullable_to_non_nullable + untilTopoheight: null == untilTopoheight + ? _value.untilTopoheight + : untilTopoheight // ignore: cast_nullable_to_non_nullable as int, )); } @@ -99,18 +99,18 @@ class __$$RescanParamsImplCopyWithImpl<$Res> @JsonSerializable() class _$RescanParamsImpl implements _RescanParams { const _$RescanParamsImpl( - {@JsonKey(name: 'topoheight') required this.topoHeight}); + {@JsonKey(name: 'until_topoheight') required this.untilTopoheight}); factory _$RescanParamsImpl.fromJson(Map json) => _$$RescanParamsImplFromJson(json); @override - @JsonKey(name: 'topoheight') - final int topoHeight; + @JsonKey(name: 'until_topoheight') + final int untilTopoheight; @override String toString() { - return 'RescanParams(topoHeight: $topoHeight)'; + return 'RescanParams(untilTopoheight: $untilTopoheight)'; } @override @@ -118,13 +118,13 @@ class _$RescanParamsImpl implements _RescanParams { return identical(this, other) || (other.runtimeType == runtimeType && other is _$RescanParamsImpl && - (identical(other.topoHeight, topoHeight) || - other.topoHeight == topoHeight)); + (identical(other.untilTopoheight, untilTopoheight) || + other.untilTopoheight == untilTopoheight)); } @JsonKey(ignore: true) @override - int get hashCode => Object.hash(runtimeType, topoHeight); + int get hashCode => Object.hash(runtimeType, untilTopoheight); @JsonKey(ignore: true) @override @@ -142,15 +142,15 @@ class _$RescanParamsImpl implements _RescanParams { abstract class _RescanParams implements RescanParams { const factory _RescanParams( - {@JsonKey(name: 'topoheight') required final int topoHeight}) = - _$RescanParamsImpl; + {@JsonKey(name: 'until_topoheight') + required final int untilTopoheight}) = _$RescanParamsImpl; factory _RescanParams.fromJson(Map json) = _$RescanParamsImpl.fromJson; @override - @JsonKey(name: 'topoheight') - int get topoHeight; + @JsonKey(name: 'until_topoheight') + int get untilTopoheight; @override @JsonKey(ignore: true) _$$RescanParamsImplCopyWith<_$RescanParamsImpl> get copyWith => diff --git a/lib/src/data_transfer_objects/wallet/rescan/rescan_params.g.dart b/lib/src/data_transfer_objects/wallet/rescan/rescan_params.g.dart index 44dd554..87faf81 100644 --- a/lib/src/data_transfer_objects/wallet/rescan/rescan_params.g.dart +++ b/lib/src/data_transfer_objects/wallet/rescan/rescan_params.g.dart @@ -10,10 +10,10 @@ part of 'rescan_params.dart'; _$RescanParamsImpl _$$RescanParamsImplFromJson(Map json) => _$RescanParamsImpl( - topoHeight: json['topoheight'] as int, + untilTopoheight: json['until_topoheight'] as int, ); Map _$$RescanParamsImplToJson(_$RescanParamsImpl instance) => { - 'topoheight': instance.topoHeight, + 'until_topoheight': instance.untilTopoheight, }; diff --git a/lib/src/repositories/daemon/daemon_constants.dart b/lib/src/repositories/daemon/daemon_constants.dart index aa91ba8..cfe94da 100644 --- a/lib/src/repositories/daemon/daemon_constants.dart +++ b/lib/src/repositories/daemon/daemon_constants.dart @@ -110,6 +110,17 @@ enum DaemonMethod implements XelisJsonKey { /// Retrieve all assets for an account getAccountAssets('get_account_assets'), + /// Verify if the account on chain is registered. + /// This is useful to determine if we should pay additionnal fee or not. + /// + /// For transactions, it is recommended to verify that the account is already registered in stable height. + isAccountRegistered('is_account_registered'), + + /// Retrieve the account registration topoheight. + /// + /// This is like its "first time" doing an action on the chain. + getAccountRegistrationTopoheight('get_account_registration_topoheight'), + /// Verify if address has a nonce on-chain registered hasNonce('has_nonce'), diff --git a/lib/src/repositories/daemon/daemon_rpc_methods_extension.dart b/lib/src/repositories/daemon/daemon_rpc_methods_extension.dart index 74c8bfa..9c03441 100644 --- a/lib/src/repositories/daemon/daemon_rpc_methods_extension.dart +++ b/lib/src/repositories/daemon/daemon_rpc_methods_extension.dart @@ -121,14 +121,14 @@ extension DaemonRpcMethodsExtension on DaemonClient { /// Returns up-to-date asset's balance for a specific address. /// /// NOTE: Balance is returned in atomic units. - Future getBalance( - GetBalanceParams getBalanceParams, + Future getBalance( + GetWalletBalanceParams getBalanceParams, ) async { final result = await sendRequest( DaemonMethod.getBalance, getBalanceParams.toJson(), ); - return GetBalanceResult.fromJson(result as Map); + return GetWalletBalanceResult.fromJson(result as Map); } /// Returns asset's balance from address at exact topo height. @@ -145,20 +145,21 @@ extension DaemonRpcMethodsExtension on DaemonClient { } /// Get registered topoheight and decimals data from a specific asset. - Future getAsset(GetAssetParams getAssetParams) async { + Future getAsset(GetAssetParams getAssetParams) async { final result = await sendRequest(DaemonMethod.getAsset, getAssetParams.toJson()); - return Asset.fromJson(result as Map); + return AssetData.fromJson(result as Map); } /// Get all assets available on network with its registered topoheight. - Future> getAssets([GetAssetsParams? getAssetsParams]) async { + Future> getAssets( + [GetAssetsParams? getAssetsParams]) async { final result = await sendRequest( DaemonMethod.getAssets, getAssetsParams?.toJson() ?? const GetAssetsParams().toJson(), ); return (result as List) - .map((e) => Asset.fromJson(e as Map)) + .map((e) => AssetWithData.fromJson(e as Map)) .toList(); } @@ -340,6 +341,34 @@ extension DaemonRpcMethodsExtension on DaemonClient { ); } + /// Verify if the account on chain is registered. + /// This is useful to determine if we should pay additionnal fee or not. + /// + /// For transactions, it is recommended to verify that the account is already registered in stable height. + Future isAccountRegistered( + IsAccountRegisteredParams isAccountRegisteredParams, + ) async { + final result = await sendRequest( + DaemonMethod.isAccountRegistered, + isAccountRegisteredParams.toJson(), + ); + return result as bool; + } + + /// Retrieve the account registration topoheight. + /// + /// This is like its "first time" doing an action on the chain. + Future getAccountRegistrationTopoheight( + GetAccountRegistrationTopoheightParams + getAccountRegistrationTopoheightParams, + ) async { + final result = await sendRequest( + DaemonMethod.getAccountRegistrationTopoheight, + getAccountRegistrationTopoheightParams.toJson(), + ); + return result as int; + } + /// Verify if address has a nonce on-chain registered Future hasNonce(HasNonceParams hasNonceParams) async { final result = diff --git a/lib/src/repositories/wallet/wallet_constants.dart b/lib/src/repositories/wallet/wallet_constants.dart index 815fc5a..09078a8 100644 --- a/lib/src/repositories/wallet/wallet_constants.dart +++ b/lib/src/repositories/wallet/wallet_constants.dart @@ -30,6 +30,10 @@ enum WalletMethod implements XelisJsonKey { /// When no parameter is set, default asset is XELIS. getBalance('get_balance'), + /// Verify if wallet has the requested asset balance. + /// When no parameter is set, default asset is XELIS. + hasBalance('has_balance'), + /// Retrieves all assets that are tracked by the wallet. getTrackedAssets('get_tracked_assets'), @@ -56,6 +60,10 @@ enum WalletMethod implements XelisJsonKey { /// Signs data with the wallet's private key. signData('sign_data'), + /// Estimate the minimum required fees for a future transaction. + /// Returned fees are in atomic units. + estimateFees('estimate_fees'), + //---------------------------------------------------------------------------- /// TODO: implement getMatchingKeys('get_matching_keys'), diff --git a/lib/src/repositories/wallet/wallet_rpc_methods_extension.dart b/lib/src/repositories/wallet/wallet_rpc_methods_extension.dart index c185eb7..e5e3e4e 100644 --- a/lib/src/repositories/wallet/wallet_rpc_methods_extension.dart +++ b/lib/src/repositories/wallet/wallet_rpc_methods_extension.dart @@ -52,6 +52,8 @@ extension WalletRpcMethodsExtension on WalletClient { /// Requests the wallet to rescan balances and transactions history /// until the specified topoheight. /// When no topoheight is set, it rescan until 0. + /// + /// **WARNING**: All balances and transactions will be deleted from wallet storage to be up-to-date with the chain of the node connected to. Future rescan(RescanParams rescanParams) async { final result = await sendRequest( WalletMethod.rescan, @@ -63,11 +65,24 @@ extension WalletRpcMethodsExtension on WalletClient { /// Gets asset balance from wallet. /// When no parameter is set, default asset is XELIS. - Future getBalance() async { - final result = await sendRequest(WalletMethod.getBalance); + Future getBalance([GetBalanceParams? getBalanceParams]) async { + final result = await sendRequest( + WalletMethod.getBalance, + getBalanceParams?.toJson() ?? const GetBalanceParams().toJson(), + ); return result as int; } + /// Gets asset balance from wallet. + /// When no parameter is set, default asset is XELIS. + Future hasBalance([GetBalanceParams? getBalanceParams]) async { + final result = await sendRequest( + WalletMethod.hasBalance, + getBalanceParams?.toJson() ?? const GetBalanceParams().toJson(), + ); + return result as bool; + } + /// Retrieves all assets that are tracked by the wallet. Future> getTrackedAssets() async { final result = await sendRequest(WalletMethod.getTrackedAssets); @@ -101,14 +116,14 @@ extension WalletRpcMethodsExtension on WalletClient { /// /// NOTE: Amount set are in atomic units, for XELIS it would 100000 to /// represents 1 XELIS because of 5 decimals precision. - Future buildTransaction( + Future buildTransaction( BuildTransactionParams buildTransactionParams, ) async { final result = await sendRequest( WalletMethod.buildTransaction, buildTransactionParams.toJson(), ); - return TransactionResponse.fromJson(result as Map); + return WalletTransactionResponse.fromJson(result as Map); } /// Search for transactions based on various parameters. @@ -147,4 +162,15 @@ extension WalletRpcMethodsExtension on WalletClient { return result as String; } + + /// Estimate the minimum required fees for a future transaction. + /// Returned fees are in atomic units. + Future estimateFees(TransactionType transactionType) async { + final result = await sendRequest( + WalletMethod.estimateFees, + transactionType.toJson(), + ); + + return result as int; + } } diff --git a/lib/src/utils/bigint_json.dart b/lib/src/utils/bigint_json.dart new file mode 100644 index 0000000..9256895 --- /dev/null +++ b/lib/src/utils/bigint_json.dart @@ -0,0 +1,94 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/// An example of how to read JSON numbers into custom number types. +/// +/// Here integers are parsed into [BigInt] and floating points are +/// kept as doubles. +/// Choosing other representations is a matter of adapting the +/// `processNum`/`processUnknown` overrides in the [JsonProcessor] +/// sub-classes. +library; + +import 'package:jsontool/jsontool.dart'; + +/// Parses a JSON string into JSON-like object structure. +/// +/// Like normal JSON parsing except the all integers are represented +/// by [BigInt] values. +Object? parseBigIntJson(String source) { + Object? value; + _BigIntJsonReader((result) { + value = result; + }).processValue(JsonReader.fromString(source)); + return value; +} + +/// Converts a JSON-like object structure to a string. +/// +/// Any [BigInt] values are written into the result as number literals. +String serializeBigIntJson(Object? value, {String? indent}) { + final buffer = StringBuffer(); + _BigIntJsonWriter(buffer, indent).processValue(JsonReader.fromObject(value)); + return buffer.toString(); +} + +base class _BigIntJsonWriter + extends JsonSinkProcessor, JsonWriter> { + _BigIntJsonWriter(StringSink sink, String? indent) + : super(jsonStringWriter(sink, indent: indent)); + + @override + void processUnknown(JsonReader reader, String? key) { + // The source of a JsonReader is the unknown object. + final value = reader.expectAnyValueSource(); + if (value is BigInt) { + if (key != null) sink.addKey(key); + sink.addSourceValue(value.toString()); + } else { + throw FormatException('Unexpected value', value); + } + } +} + +base class _BigIntJsonReader + extends JsonSinkProcessor, JsonWriter> { + _BigIntJsonReader(void Function(Object?) resultCallback) + : super(jsonObjectWriter(resultCallback)); + + @override + void processNum(JsonReader reader, String? key) { + if (key != null) sink.addKey(key); + final copy = reader.copy(); + final source = reader.expectAnyValueSource().toString(); + assert(source.isNotEmpty); + final result = BigInt.tryParse(source); + if (result != null) { + sink.addSourceValue(result); + return; + } + sink.addNumber(copy.expectDouble()); + } +} + +// void main() { +// // Start with a JSON containing a number too big for Dart integers. +// var source = '{"x":123456789123456789123456789123456789}'; +// print("source: $source"); +// var data = parseBigIntJson(source) as Map; +// print("big value: ${data["x"]}"); // The big integer. +// var newSource = serializeBigIntJson(data); +// print("new source: $newSource"); // Roundtripped. +// assert(source == newSource); +// } diff --git a/pubspec.yaml b/pubspec.yaml index 4df87e2..3d480c0 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,24 +1,24 @@ name: xelis_dart_sdk description: Software Development Kit in Dart to build Apps for the Xelis Blockchain. -version: 0.17.0 +version: 0.18.0 repository: https://github.com/xelis-project/xelis-dart-jdk environment: - sdk: '>=3.2.0 <4.0.0' + sdk: '>=3.3.0 <4.0.0' dependencies: convert: ^3.1.1 freezed_annotation: ^2.4.1 json_annotation: ^4.8.1 json_rpc_2: ^3.0.2 - jsontool: ^1.2.0 + jsontool: ^2.0.0 logging: ^1.2.0 very_good_analysis: ^5.1.0 web_socket_client: ^0.1.1 dev_dependencies: build_runner: ^2.4.9 - freezed: ^2.5.1 + freezed: ^2.5.2 json_serializable: ^6.7.1 lints: ^3.0.0 - test: ^1.25.3 + test: ^1.25.4 diff --git a/test/xelis_dart_sdk_test.dart b/test/xelis_dart_sdk_test.dart deleted file mode 100644 index 98f6823..0000000 --- a/test/xelis_dart_sdk_test.dart +++ /dev/null @@ -1,29 +0,0 @@ -import 'package:test/test.dart'; -// import 'package:xelis_dart_sdk/xelis_dart_sdk.dart'; - -void main() { - group('A group of tests', () { - // final dr = DaemonClientRepository( - // endPoint: localhostAddress, - // secureWebSocket: false, - // ); - - setUp(() async { - // Additional setup goes here. - // await dr.connect(); - }); - - test('First Test', () { - // dr - // ..onOpen(() { - // print('open callback'); - // }) - // ..onClose(() { - // print('close callback'); - // }) - // ..onError((error) { - // print('error callback: $error'); - // }); - }); - }); -}