From 0d80dac35b8e592d342761ca2ada00bb7add3acc Mon Sep 17 00:00:00 2001 From: Ez3kiel Date: Thu, 11 Jan 2024 11:58:48 +0100 Subject: [PATCH] fix: update get_last_balance RPC method to get_balance --- CHANGELOG.md | 4 + lib/src/data_transfer_objects/dtos.dart | 6 +- .../get_balance/balance.dart | 18 -- .../get_balance/get_balance_params.dart | 18 ++ .../get_balance_params.freezed.dart} | 89 ++++---- .../get_balance_params.g.dart} | 10 +- .../get_balance/get_balance_result.dart | 20 ++ .../get_balance_result.freezed.dart | 201 ++++++++++++++++++ .../get_balance_result.g.dart} | 15 +- .../get_last_balance_params.dart | 18 -- .../get_last_balance_result.dart | 20 -- .../get_last_balance_result.freezed.dart | 199 ----------------- .../versioned_balance/versioned_balance.dart | 18 ++ .../versioned_balance.freezed.dart} | 82 ++++--- .../versioned_balance.g.dart} | 10 +- .../balance_changed.freezed.dart | 7 - .../build_transaction_params.freezed.dart | 22 -- .../fee_builder.freezed.dart | 7 - .../get_address_params.freezed.dart | 6 - .../list_transactions_params.freezed.dart | 17 -- .../transaction_entry.freezed.dart | 22 -- .../asset_with_data.freezed.dart | 9 - .../wallet/rescan/rescan_params.freezed.dart | 5 - .../split_address_params.freezed.dart | 5 - .../split_address_result.freezed.dart | 8 - .../repositories/daemon/daemon_constants.dart | 2 +- .../daemon/daemon_rpc_methods_extension.dart | 14 +- pubspec.yaml | 2 +- 28 files changed, 386 insertions(+), 468 deletions(-) delete mode 100644 lib/src/data_transfer_objects/get_balance/balance.dart create mode 100644 lib/src/data_transfer_objects/get_balance/get_balance_params.dart rename lib/src/data_transfer_objects/{get_last_balance/get_last_balance_params.freezed.dart => get_balance/get_balance_params.freezed.dart} (61%) rename lib/src/data_transfer_objects/{get_last_balance/get_last_balance_params.g.dart => get_balance/get_balance_params.g.dart} (68%) create mode 100644 lib/src/data_transfer_objects/get_balance/get_balance_result.dart create mode 100644 lib/src/data_transfer_objects/get_balance/get_balance_result.freezed.dart rename lib/src/data_transfer_objects/{get_last_balance/get_last_balance_result.g.dart => get_balance/get_balance_result.g.dart} (56%) delete mode 100644 lib/src/data_transfer_objects/get_last_balance/get_last_balance_params.dart delete mode 100644 lib/src/data_transfer_objects/get_last_balance/get_last_balance_result.dart delete mode 100644 lib/src/data_transfer_objects/get_last_balance/get_last_balance_result.freezed.dart create mode 100644 lib/src/data_transfer_objects/versioned_balance/versioned_balance.dart rename lib/src/data_transfer_objects/{get_balance/balance.freezed.dart => versioned_balance/versioned_balance.freezed.dart} (64%) rename lib/src/data_transfer_objects/{get_balance/balance.g.dart => versioned_balance/versioned_balance.g.dart} (67%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 203e43c..d389efd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.13.3 + +- update get_last_balance RPC method to get_balance. + ## 0.13.2 - update all events name to snake case. diff --git a/lib/src/data_transfer_objects/dtos.dart b/lib/src/data_transfer_objects/dtos.dart index d78001c..8d18faa 100644 --- a/lib/src/data_transfer_objects/dtos.dart +++ b/lib/src/data_transfer_objects/dtos.dart @@ -13,7 +13,8 @@ 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/balance.dart'; +export 'get_balance/get_balance_params.dart'; +export 'get_balance/get_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'; @@ -23,8 +24,6 @@ export 'get_blocks_at_height/get_blocks_at_height_params.dart'; export 'get_dev_fee_thresholds/get_dev_fee_threshold_result.dart'; export 'get_info/get_info_result.dart'; export 'get_info/network.dart'; -export 'get_last_balance/get_last_balance_params.dart'; -export 'get_last_balance/get_last_balance_result.dart'; export 'get_nonce/get_nonce_params.dart'; export 'get_peers/peer.dart'; export 'get_peers/peer_type.dart'; @@ -49,6 +48,7 @@ export 'transaction/transaction.dart'; export 'transaction/transaction_type.dart'; export 'transaction/transfer.dart'; export 'transaction_executed_event/transaction_executed_event.dart'; +export 'versioned_balance/versioned_balance.dart'; export 'wallet/balance_changed_event/balance_changed.dart'; export 'wallet/build_transaction/build_transaction_params.dart'; export 'wallet/build_transaction/fee_builder.dart'; diff --git a/lib/src/data_transfer_objects/get_balance/balance.dart b/lib/src/data_transfer_objects/get_balance/balance.dart deleted file mode 100644 index c4c6943..0000000 --- a/lib/src/data_transfer_objects/get_balance/balance.dart +++ /dev/null @@ -1,18 +0,0 @@ -// ignore_for_file: public_member_api_docs, invalid_annotation_target - -import 'package:freezed_annotation/freezed_annotation.dart'; - -part 'balance.freezed.dart'; - -part 'balance.g.dart'; - -@freezed -class Balance with _$Balance { - const factory Balance({ - @JsonKey(name: 'balance') required int balance, - @JsonKey(name: 'previous_topoheight') int? previousTopoHeight, - }) = _Balance; - - factory Balance.fromJson(Map json) => - _$BalanceFromJson(json); -} diff --git a/lib/src/data_transfer_objects/get_balance/get_balance_params.dart b/lib/src/data_transfer_objects/get_balance/get_balance_params.dart new file mode 100644 index 0000000..1d1ce30 --- /dev/null +++ b/lib/src/data_transfer_objects/get_balance/get_balance_params.dart @@ -0,0 +1,18 @@ +// ignore_for_file: public_member_api_docs, invalid_annotation_target + +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'get_balance_params.freezed.dart'; + +part 'get_balance_params.g.dart'; + +@freezed +class GetBalanceParams with _$GetBalanceParams { + const factory GetBalanceParams({ + @JsonKey(name: 'address') required String address, + @JsonKey(name: 'asset') required String asset, + }) = _GetBalanceParams; + + factory GetBalanceParams.fromJson(Map json) => + _$GetBalanceParamsFromJson(json); +} diff --git a/lib/src/data_transfer_objects/get_last_balance/get_last_balance_params.freezed.dart b/lib/src/data_transfer_objects/get_balance/get_balance_params.freezed.dart similarity index 61% rename from lib/src/data_transfer_objects/get_last_balance/get_last_balance_params.freezed.dart rename to lib/src/data_transfer_objects/get_balance/get_balance_params.freezed.dart index cfff466..fca43dc 100644 --- a/lib/src/data_transfer_objects/get_last_balance/get_last_balance_params.freezed.dart +++ b/lib/src/data_transfer_objects/get_balance/get_balance_params.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_last_balance_params.dart'; +part of 'get_balance_params.dart'; // ************************************************************************** // FreezedGenerator @@ -14,28 +14,31 @@ 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#custom-getters-and-methods'); -GetLastBalanceParams _$GetLastBalanceParamsFromJson(Map json) { - return _GetLastBalanceParams.fromJson(json); +GetBalanceParams _$GetBalanceParamsFromJson(Map json) { + return _GetBalanceParams.fromJson(json); } /// @nodoc -mixin _$GetLastBalanceParams { +mixin _$GetBalanceParams { @JsonKey(name: 'address') String get address => throw _privateConstructorUsedError; + @JsonKey(name: 'asset') String get asset => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) - $GetLastBalanceParamsCopyWith get copyWith => + $GetBalanceParamsCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class $GetLastBalanceParamsCopyWith<$Res> { - factory $GetLastBalanceParamsCopyWith(GetLastBalanceParams value, - $Res Function(GetLastBalanceParams) then) = - _$GetLastBalanceParamsCopyWithImpl<$Res, GetLastBalanceParams>; +abstract class $GetBalanceParamsCopyWith<$Res> { + factory $GetBalanceParamsCopyWith( + GetBalanceParams value, $Res Function(GetBalanceParams) then) = + _$GetBalanceParamsCopyWithImpl<$Res, GetBalanceParams>; + @useResult $Res call( {@JsonKey(name: 'address') String address, @@ -43,13 +46,13 @@ abstract class $GetLastBalanceParamsCopyWith<$Res> { } /// @nodoc -class _$GetLastBalanceParamsCopyWithImpl<$Res, - $Val extends GetLastBalanceParams> - implements $GetLastBalanceParamsCopyWith<$Res> { - _$GetLastBalanceParamsCopyWithImpl(this._value, this._then); +class _$GetBalanceParamsCopyWithImpl<$Res, $Val extends GetBalanceParams> + implements $GetBalanceParamsCopyWith<$Res> { + _$GetBalanceParamsCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -73,11 +76,12 @@ class _$GetLastBalanceParamsCopyWithImpl<$Res, } /// @nodoc -abstract class _$$GetLastBalanceParamsImplCopyWith<$Res> - implements $GetLastBalanceParamsCopyWith<$Res> { - factory _$$GetLastBalanceParamsImplCopyWith(_$GetLastBalanceParamsImpl value, - $Res Function(_$GetLastBalanceParamsImpl) then) = - __$$GetLastBalanceParamsImplCopyWithImpl<$Res>; +abstract class _$$GetBalanceParamsImplCopyWith<$Res> + implements $GetBalanceParamsCopyWith<$Res> { + factory _$$GetBalanceParamsImplCopyWith(_$GetBalanceParamsImpl value, + $Res Function(_$GetBalanceParamsImpl) then) = + __$$GetBalanceParamsImplCopyWithImpl<$Res>; + @override @useResult $Res call( @@ -86,11 +90,11 @@ abstract class _$$GetLastBalanceParamsImplCopyWith<$Res> } /// @nodoc -class __$$GetLastBalanceParamsImplCopyWithImpl<$Res> - extends _$GetLastBalanceParamsCopyWithImpl<$Res, _$GetLastBalanceParamsImpl> - implements _$$GetLastBalanceParamsImplCopyWith<$Res> { - __$$GetLastBalanceParamsImplCopyWithImpl(_$GetLastBalanceParamsImpl _value, - $Res Function(_$GetLastBalanceParamsImpl) _then) +class __$$GetBalanceParamsImplCopyWithImpl<$Res> + extends _$GetBalanceParamsCopyWithImpl<$Res, _$GetBalanceParamsImpl> + implements _$$GetBalanceParamsImplCopyWith<$Res> { + __$$GetBalanceParamsImplCopyWithImpl(_$GetBalanceParamsImpl _value, + $Res Function(_$GetBalanceParamsImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -99,7 +103,7 @@ class __$$GetLastBalanceParamsImplCopyWithImpl<$Res> Object? address = null, Object? asset = null, }) { - return _then(_$GetLastBalanceParamsImpl( + return _then(_$GetBalanceParamsImpl( address: null == address ? _value.address : address // ignore: cast_nullable_to_non_nullable @@ -114,13 +118,13 @@ class __$$GetLastBalanceParamsImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() -class _$GetLastBalanceParamsImpl implements _GetLastBalanceParams { - const _$GetLastBalanceParamsImpl( +class _$GetBalanceParamsImpl implements _GetBalanceParams { + const _$GetBalanceParamsImpl( {@JsonKey(name: 'address') required this.address, @JsonKey(name: 'asset') required this.asset}); - factory _$GetLastBalanceParamsImpl.fromJson(Map json) => - _$$GetLastBalanceParamsImplFromJson(json); + factory _$GetBalanceParamsImpl.fromJson(Map json) => + _$$GetBalanceParamsImplFromJson(json); @override @JsonKey(name: 'address') @@ -131,14 +135,14 @@ class _$GetLastBalanceParamsImpl implements _GetLastBalanceParams { @override String toString() { - return 'GetLastBalanceParams(address: $address, asset: $asset)'; + return 'GetBalanceParams(address: $address, asset: $asset)'; } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$GetLastBalanceParamsImpl && + other is _$GetBalanceParamsImpl && (identical(other.address, address) || other.address == address) && (identical(other.asset, asset) || other.asset == asset)); } @@ -150,36 +154,37 @@ class _$GetLastBalanceParamsImpl implements _GetLastBalanceParams { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$GetLastBalanceParamsImplCopyWith<_$GetLastBalanceParamsImpl> - get copyWith => - __$$GetLastBalanceParamsImplCopyWithImpl<_$GetLastBalanceParamsImpl>( - this, _$identity); + _$$GetBalanceParamsImplCopyWith<_$GetBalanceParamsImpl> get copyWith => + __$$GetBalanceParamsImplCopyWithImpl<_$GetBalanceParamsImpl>( + this, _$identity); @override Map toJson() { - return _$$GetLastBalanceParamsImplToJson( + return _$$GetBalanceParamsImplToJson( this, ); } } -abstract class _GetLastBalanceParams implements GetLastBalanceParams { - const factory _GetLastBalanceParams( +abstract class _GetBalanceParams implements GetBalanceParams { + const factory _GetBalanceParams( {@JsonKey(name: 'address') required final String address, @JsonKey(name: 'asset') required final String asset}) = - _$GetLastBalanceParamsImpl; + _$GetBalanceParamsImpl; - factory _GetLastBalanceParams.fromJson(Map json) = - _$GetLastBalanceParamsImpl.fromJson; + factory _GetBalanceParams.fromJson(Map json) = + _$GetBalanceParamsImpl.fromJson; @override @JsonKey(name: 'address') String get address; + @override @JsonKey(name: 'asset') String get asset; + @override @JsonKey(ignore: true) - _$$GetLastBalanceParamsImplCopyWith<_$GetLastBalanceParamsImpl> - get copyWith => throw _privateConstructorUsedError; + _$$GetBalanceParamsImplCopyWith<_$GetBalanceParamsImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/src/data_transfer_objects/get_last_balance/get_last_balance_params.g.dart b/lib/src/data_transfer_objects/get_balance/get_balance_params.g.dart similarity index 68% rename from lib/src/data_transfer_objects/get_last_balance/get_last_balance_params.g.dart rename to lib/src/data_transfer_objects/get_balance/get_balance_params.g.dart index 64987bf..e2e71d7 100644 --- a/lib/src/data_transfer_objects/get_last_balance/get_last_balance_params.g.dart +++ b/lib/src/data_transfer_objects/get_balance/get_balance_params.g.dart @@ -2,21 +2,21 @@ // ignore_for_file: package_api_docs, non_constant_identifier_names -part of 'get_last_balance_params.dart'; +part of 'get_balance_params.dart'; // ************************************************************************** // JsonSerializableGenerator // ************************************************************************** -_$GetLastBalanceParamsImpl _$$GetLastBalanceParamsImplFromJson( +_$GetBalanceParamsImpl _$$GetBalanceParamsImplFromJson( Map json) => - _$GetLastBalanceParamsImpl( + _$GetBalanceParamsImpl( address: json['address'] as String, asset: json['asset'] as String, ); -Map _$$GetLastBalanceParamsImplToJson( - _$GetLastBalanceParamsImpl instance) => +Map _$$GetBalanceParamsImplToJson( + _$GetBalanceParamsImpl instance) => { 'address': instance.address, 'asset': instance.asset, 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 new file mode 100644 index 0000000..f36a095 --- /dev/null +++ b/lib/src/data_transfer_objects/get_balance/get_balance_result.dart @@ -0,0 +1,20 @@ +// ignore_for_file: public_member_api_docs, 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'; + +@freezed +class GetBalanceResult with _$GetBalanceResult { + const factory GetBalanceResult({ + @JsonKey(name: 'version') required VersionedBalance versionedBalance, + @JsonKey(name: 'topoheight') required int topoHeight, + }) = _GetBalanceResult; + + factory GetBalanceResult.fromJson(Map json) => + _$GetBalanceResultFromJson(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_balance_result.freezed.dart new file mode 100644 index 0000000..5f8b88c --- /dev/null +++ b/lib/src/data_transfer_objects/get_balance/get_balance_result.freezed.dart @@ -0,0 +1,201 @@ +// 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_balance_result.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#custom-getters-and-methods'); + +GetBalanceResult _$GetBalanceResultFromJson(Map json) { + return _GetBalanceResult.fromJson(json); +} + +/// @nodoc +mixin _$GetBalanceResult { + @JsonKey(name: 'version') + VersionedBalance get versionedBalance => throw _privateConstructorUsedError; + + @JsonKey(name: 'topoheight') + int get topoHeight => throw _privateConstructorUsedError; + + Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) + $GetBalanceResultCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $GetBalanceResultCopyWith<$Res> { + factory $GetBalanceResultCopyWith( + GetBalanceResult value, $Res Function(GetBalanceResult) then) = + _$GetBalanceResultCopyWithImpl<$Res, GetBalanceResult>; + @useResult + $Res call( + {@JsonKey(name: 'version') VersionedBalance versionedBalance, + @JsonKey(name: 'topoheight') int topoHeight}); + + $VersionedBalanceCopyWith<$Res> get versionedBalance; +} + +/// @nodoc +class _$GetBalanceResultCopyWithImpl<$Res, $Val extends GetBalanceResult> + implements $GetBalanceResultCopyWith<$Res> { + _$GetBalanceResultCopyWithImpl(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? versionedBalance = 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 + as int, + ) as $Val); + } + + @override + @pragma('vm:prefer-inline') + $VersionedBalanceCopyWith<$Res> get versionedBalance { + return $VersionedBalanceCopyWith<$Res>(_value.versionedBalance, (value) { + return _then(_value.copyWith(versionedBalance: value) as $Val); + }); + } +} + +/// @nodoc +abstract class _$$GetBalanceResultImplCopyWith<$Res> + implements $GetBalanceResultCopyWith<$Res> { + factory _$$GetBalanceResultImplCopyWith(_$GetBalanceResultImpl value, + $Res Function(_$GetBalanceResultImpl) then) = + __$$GetBalanceResultImplCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {@JsonKey(name: 'version') VersionedBalance versionedBalance, + @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) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? versionedBalance = null, + Object? topoHeight = null, + }) { + return _then(_$GetBalanceResultImpl( + 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 + as int, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$GetBalanceResultImpl implements _GetBalanceResult { + const _$GetBalanceResultImpl( + {@JsonKey(name: 'version') required this.versionedBalance, + @JsonKey(name: 'topoheight') required this.topoHeight}); + + factory _$GetBalanceResultImpl.fromJson(Map json) => + _$$GetBalanceResultImplFromJson(json); + + @override + @JsonKey(name: 'version') + final VersionedBalance versionedBalance; + @override + @JsonKey(name: 'topoheight') + final int topoHeight; + + @override + String toString() { + return 'GetBalanceResult(versionedBalance: $versionedBalance, topoHeight: $topoHeight)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$GetBalanceResultImpl && + (identical(other.versionedBalance, versionedBalance) || + other.versionedBalance == versionedBalance) && + (identical(other.topoHeight, topoHeight) || + other.topoHeight == topoHeight)); + } + + @JsonKey(ignore: true) + @override + int get hashCode => Object.hash(runtimeType, versionedBalance, topoHeight); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$GetBalanceResultImplCopyWith<_$GetBalanceResultImpl> get copyWith => + __$$GetBalanceResultImplCopyWithImpl<_$GetBalanceResultImpl>( + this, _$identity); + + @override + Map toJson() { + return _$$GetBalanceResultImplToJson( + this, + ); + } +} + +abstract class _GetBalanceResult implements GetBalanceResult { + const factory _GetBalanceResult( + {@JsonKey(name: 'version') + required final VersionedBalance versionedBalance, + @JsonKey(name: 'topoheight') required final int topoHeight}) = + _$GetBalanceResultImpl; + + factory _GetBalanceResult.fromJson(Map json) = + _$GetBalanceResultImpl.fromJson; + + @override + @JsonKey(name: 'version') + VersionedBalance get versionedBalance; + + @override + @JsonKey(name: 'topoheight') + int get topoHeight; + @override + @JsonKey(ignore: true) + _$$GetBalanceResultImplCopyWith<_$GetBalanceResultImpl> get copyWith => + throw _privateConstructorUsedError; +} diff --git a/lib/src/data_transfer_objects/get_last_balance/get_last_balance_result.g.dart b/lib/src/data_transfer_objects/get_balance/get_balance_result.g.dart similarity index 56% rename from lib/src/data_transfer_objects/get_last_balance/get_last_balance_result.g.dart rename to lib/src/data_transfer_objects/get_balance/get_balance_result.g.dart index c09ecf0..230da60 100644 --- a/lib/src/data_transfer_objects/get_last_balance/get_last_balance_result.g.dart +++ b/lib/src/data_transfer_objects/get_balance/get_balance_result.g.dart @@ -2,22 +2,23 @@ // ignore_for_file: package_api_docs, non_constant_identifier_names -part of 'get_last_balance_result.dart'; +part of 'get_balance_result.dart'; // ************************************************************************** // JsonSerializableGenerator // ************************************************************************** -_$GetLastBalanceResultImpl _$$GetLastBalanceResultImplFromJson( +_$GetBalanceResultImpl _$$GetBalanceResultImplFromJson( Map json) => - _$GetLastBalanceResultImpl( - balance: Balance.fromJson(json['balance'] as Map), + _$GetBalanceResultImpl( + versionedBalance: + VersionedBalance.fromJson(json['version'] as Map), topoHeight: json['topoheight'] as int, ); -Map _$$GetLastBalanceResultImplToJson( - _$GetLastBalanceResultImpl instance) => +Map _$$GetBalanceResultImplToJson( + _$GetBalanceResultImpl instance) => { - 'balance': instance.balance, + 'version': instance.versionedBalance, 'topoheight': instance.topoHeight, }; diff --git a/lib/src/data_transfer_objects/get_last_balance/get_last_balance_params.dart b/lib/src/data_transfer_objects/get_last_balance/get_last_balance_params.dart deleted file mode 100644 index 6fdb367..0000000 --- a/lib/src/data_transfer_objects/get_last_balance/get_last_balance_params.dart +++ /dev/null @@ -1,18 +0,0 @@ -// ignore_for_file: public_member_api_docs, invalid_annotation_target - -import 'package:freezed_annotation/freezed_annotation.dart'; - -part 'get_last_balance_params.freezed.dart'; - -part 'get_last_balance_params.g.dart'; - -@freezed -class GetLastBalanceParams with _$GetLastBalanceParams { - const factory GetLastBalanceParams({ - @JsonKey(name: 'address') required String address, - @JsonKey(name: 'asset') required String asset, - }) = _GetLastBalanceParams; - - factory GetLastBalanceParams.fromJson(Map json) => - _$GetLastBalanceParamsFromJson(json); -} diff --git a/lib/src/data_transfer_objects/get_last_balance/get_last_balance_result.dart b/lib/src/data_transfer_objects/get_last_balance/get_last_balance_result.dart deleted file mode 100644 index a29ed1f..0000000 --- a/lib/src/data_transfer_objects/get_last_balance/get_last_balance_result.dart +++ /dev/null @@ -1,20 +0,0 @@ -// ignore_for_file: public_member_api_docs, invalid_annotation_target - -import 'package:freezed_annotation/freezed_annotation.dart'; - -import 'package:xelis_dart_sdk/xelis_dart_sdk.dart'; - -part 'get_last_balance_result.freezed.dart'; - -part 'get_last_balance_result.g.dart'; - -@freezed -class GetLastBalanceResult with _$GetLastBalanceResult { - const factory GetLastBalanceResult({ - @JsonKey(name: 'balance') required Balance balance, - @JsonKey(name: 'topoheight') required int topoHeight, - }) = _GetLastBalanceResult; - - factory GetLastBalanceResult.fromJson(Map json) => - _$GetLastBalanceResultFromJson(json); -} diff --git a/lib/src/data_transfer_objects/get_last_balance/get_last_balance_result.freezed.dart b/lib/src/data_transfer_objects/get_last_balance/get_last_balance_result.freezed.dart deleted file mode 100644 index b7a4c29..0000000 --- a/lib/src/data_transfer_objects/get_last_balance/get_last_balance_result.freezed.dart +++ /dev/null @@ -1,199 +0,0 @@ -// 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_last_balance_result.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#custom-getters-and-methods'); - -GetLastBalanceResult _$GetLastBalanceResultFromJson(Map json) { - return _GetLastBalanceResult.fromJson(json); -} - -/// @nodoc -mixin _$GetLastBalanceResult { - @JsonKey(name: 'balance') - Balance get balance => throw _privateConstructorUsedError; - @JsonKey(name: 'topoheight') - int get topoHeight => throw _privateConstructorUsedError; - - Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) - $GetLastBalanceResultCopyWith get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $GetLastBalanceResultCopyWith<$Res> { - factory $GetLastBalanceResultCopyWith(GetLastBalanceResult value, - $Res Function(GetLastBalanceResult) then) = - _$GetLastBalanceResultCopyWithImpl<$Res, GetLastBalanceResult>; - @useResult - $Res call( - {@JsonKey(name: 'balance') Balance balance, - @JsonKey(name: 'topoheight') int topoHeight}); - - $BalanceCopyWith<$Res> get balance; -} - -/// @nodoc -class _$GetLastBalanceResultCopyWithImpl<$Res, - $Val extends GetLastBalanceResult> - implements $GetLastBalanceResultCopyWith<$Res> { - _$GetLastBalanceResultCopyWithImpl(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? balance = null, - Object? topoHeight = null, - }) { - return _then(_value.copyWith( - balance: null == balance - ? _value.balance - : balance // ignore: cast_nullable_to_non_nullable - as Balance, - topoHeight: null == topoHeight - ? _value.topoHeight - : topoHeight // ignore: cast_nullable_to_non_nullable - as int, - ) as $Val); - } - - @override - @pragma('vm:prefer-inline') - $BalanceCopyWith<$Res> get balance { - return $BalanceCopyWith<$Res>(_value.balance, (value) { - return _then(_value.copyWith(balance: value) as $Val); - }); - } -} - -/// @nodoc -abstract class _$$GetLastBalanceResultImplCopyWith<$Res> - implements $GetLastBalanceResultCopyWith<$Res> { - factory _$$GetLastBalanceResultImplCopyWith(_$GetLastBalanceResultImpl value, - $Res Function(_$GetLastBalanceResultImpl) then) = - __$$GetLastBalanceResultImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {@JsonKey(name: 'balance') Balance balance, - @JsonKey(name: 'topoheight') int topoHeight}); - - @override - $BalanceCopyWith<$Res> get balance; -} - -/// @nodoc -class __$$GetLastBalanceResultImplCopyWithImpl<$Res> - extends _$GetLastBalanceResultCopyWithImpl<$Res, _$GetLastBalanceResultImpl> - implements _$$GetLastBalanceResultImplCopyWith<$Res> { - __$$GetLastBalanceResultImplCopyWithImpl(_$GetLastBalanceResultImpl _value, - $Res Function(_$GetLastBalanceResultImpl) _then) - : super(_value, _then); - - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? balance = null, - Object? topoHeight = null, - }) { - return _then(_$GetLastBalanceResultImpl( - balance: null == balance - ? _value.balance - : balance // ignore: cast_nullable_to_non_nullable - as Balance, - topoHeight: null == topoHeight - ? _value.topoHeight - : topoHeight // ignore: cast_nullable_to_non_nullable - as int, - )); - } -} - -/// @nodoc -@JsonSerializable() -class _$GetLastBalanceResultImpl implements _GetLastBalanceResult { - const _$GetLastBalanceResultImpl( - {@JsonKey(name: 'balance') required this.balance, - @JsonKey(name: 'topoheight') required this.topoHeight}); - - factory _$GetLastBalanceResultImpl.fromJson(Map json) => - _$$GetLastBalanceResultImplFromJson(json); - - @override - @JsonKey(name: 'balance') - final Balance balance; - @override - @JsonKey(name: 'topoheight') - final int topoHeight; - - @override - String toString() { - return 'GetLastBalanceResult(balance: $balance, topoHeight: $topoHeight)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$GetLastBalanceResultImpl && - (identical(other.balance, balance) || other.balance == balance) && - (identical(other.topoHeight, topoHeight) || - other.topoHeight == topoHeight)); - } - - @JsonKey(ignore: true) - @override - int get hashCode => Object.hash(runtimeType, balance, topoHeight); - - @JsonKey(ignore: true) - @override - @pragma('vm:prefer-inline') - _$$GetLastBalanceResultImplCopyWith<_$GetLastBalanceResultImpl> - get copyWith => - __$$GetLastBalanceResultImplCopyWithImpl<_$GetLastBalanceResultImpl>( - this, _$identity); - - @override - Map toJson() { - return _$$GetLastBalanceResultImplToJson( - this, - ); - } -} - -abstract class _GetLastBalanceResult implements GetLastBalanceResult { - const factory _GetLastBalanceResult( - {@JsonKey(name: 'balance') required final Balance balance, - @JsonKey(name: 'topoheight') required final int topoHeight}) = - _$GetLastBalanceResultImpl; - - factory _GetLastBalanceResult.fromJson(Map json) = - _$GetLastBalanceResultImpl.fromJson; - - @override - @JsonKey(name: 'balance') - Balance get balance; - @override - @JsonKey(name: 'topoheight') - int get topoHeight; - @override - @JsonKey(ignore: true) - _$$GetLastBalanceResultImplCopyWith<_$GetLastBalanceResultImpl> - get copyWith => throw _privateConstructorUsedError; -} diff --git a/lib/src/data_transfer_objects/versioned_balance/versioned_balance.dart b/lib/src/data_transfer_objects/versioned_balance/versioned_balance.dart new file mode 100644 index 0000000..7a6787a --- /dev/null +++ b/lib/src/data_transfer_objects/versioned_balance/versioned_balance.dart @@ -0,0 +1,18 @@ +// ignore_for_file: public_member_api_docs, invalid_annotation_target + +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'versioned_balance.freezed.dart'; + +part 'versioned_balance.g.dart'; + +@freezed +class VersionedBalance with _$VersionedBalance { + const factory VersionedBalance({ + @JsonKey(name: 'balance') required int balance, + @JsonKey(name: 'previous_topoheight') int? previousTopoHeight, + }) = _VersionedBalance; + + factory VersionedBalance.fromJson(Map json) => + _$VersionedBalanceFromJson(json); +} diff --git a/lib/src/data_transfer_objects/get_balance/balance.freezed.dart b/lib/src/data_transfer_objects/versioned_balance/versioned_balance.freezed.dart similarity index 64% rename from lib/src/data_transfer_objects/get_balance/balance.freezed.dart rename to lib/src/data_transfer_objects/versioned_balance/versioned_balance.freezed.dart index dbfa59d..4aa07cb 100644 --- a/lib/src/data_transfer_objects/get_balance/balance.freezed.dart +++ b/lib/src/data_transfer_objects/versioned_balance/versioned_balance.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 'balance.dart'; +part of 'versioned_balance.dart'; // ************************************************************************** // FreezedGenerator @@ -14,26 +14,31 @@ 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#custom-getters-and-methods'); -Balance _$BalanceFromJson(Map json) { - return _Balance.fromJson(json); +VersionedBalance _$VersionedBalanceFromJson(Map json) { + return _VersionedBalance.fromJson(json); } /// @nodoc -mixin _$Balance { +mixin _$VersionedBalance { @JsonKey(name: 'balance') int get balance => throw _privateConstructorUsedError; + @JsonKey(name: 'previous_topoheight') int? get previousTopoHeight => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) - $BalanceCopyWith get copyWith => throw _privateConstructorUsedError; + $VersionedBalanceCopyWith get copyWith => + throw _privateConstructorUsedError; } /// @nodoc -abstract class $BalanceCopyWith<$Res> { - factory $BalanceCopyWith(Balance value, $Res Function(Balance) then) = - _$BalanceCopyWithImpl<$Res, Balance>; +abstract class $VersionedBalanceCopyWith<$Res> { + factory $VersionedBalanceCopyWith( + VersionedBalance value, $Res Function(VersionedBalance) then) = + _$VersionedBalanceCopyWithImpl<$Res, VersionedBalance>; + @useResult $Res call( {@JsonKey(name: 'balance') int balance, @@ -41,12 +46,13 @@ abstract class $BalanceCopyWith<$Res> { } /// @nodoc -class _$BalanceCopyWithImpl<$Res, $Val extends Balance> - implements $BalanceCopyWith<$Res> { - _$BalanceCopyWithImpl(this._value, this._then); +class _$VersionedBalanceCopyWithImpl<$Res, $Val extends VersionedBalance> + implements $VersionedBalanceCopyWith<$Res> { + _$VersionedBalanceCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -70,10 +76,12 @@ class _$BalanceCopyWithImpl<$Res, $Val extends Balance> } /// @nodoc -abstract class _$$BalanceImplCopyWith<$Res> implements $BalanceCopyWith<$Res> { - factory _$$BalanceImplCopyWith( - _$BalanceImpl value, $Res Function(_$BalanceImpl) then) = - __$$BalanceImplCopyWithImpl<$Res>; +abstract class _$$VersionedBalanceImplCopyWith<$Res> + implements $VersionedBalanceCopyWith<$Res> { + factory _$$VersionedBalanceImplCopyWith(_$VersionedBalanceImpl value, + $Res Function(_$VersionedBalanceImpl) then) = + __$$VersionedBalanceImplCopyWithImpl<$Res>; + @override @useResult $Res call( @@ -82,11 +90,11 @@ abstract class _$$BalanceImplCopyWith<$Res> implements $BalanceCopyWith<$Res> { } /// @nodoc -class __$$BalanceImplCopyWithImpl<$Res> - extends _$BalanceCopyWithImpl<$Res, _$BalanceImpl> - implements _$$BalanceImplCopyWith<$Res> { - __$$BalanceImplCopyWithImpl( - _$BalanceImpl _value, $Res Function(_$BalanceImpl) _then) +class __$$VersionedBalanceImplCopyWithImpl<$Res> + extends _$VersionedBalanceCopyWithImpl<$Res, _$VersionedBalanceImpl> + implements _$$VersionedBalanceImplCopyWith<$Res> { + __$$VersionedBalanceImplCopyWithImpl(_$VersionedBalanceImpl _value, + $Res Function(_$VersionedBalanceImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -95,7 +103,7 @@ class __$$BalanceImplCopyWithImpl<$Res> Object? balance = null, Object? previousTopoHeight = freezed, }) { - return _then(_$BalanceImpl( + return _then(_$VersionedBalanceImpl( balance: null == balance ? _value.balance : balance // ignore: cast_nullable_to_non_nullable @@ -110,13 +118,13 @@ class __$$BalanceImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() -class _$BalanceImpl implements _Balance { - const _$BalanceImpl( +class _$VersionedBalanceImpl implements _VersionedBalance { + const _$VersionedBalanceImpl( {@JsonKey(name: 'balance') required this.balance, @JsonKey(name: 'previous_topoheight') this.previousTopoHeight}); - factory _$BalanceImpl.fromJson(Map json) => - _$$BalanceImplFromJson(json); + factory _$VersionedBalanceImpl.fromJson(Map json) => + _$$VersionedBalanceImplFromJson(json); @override @JsonKey(name: 'balance') @@ -127,14 +135,14 @@ class _$BalanceImpl implements _Balance { @override String toString() { - return 'Balance(balance: $balance, previousTopoHeight: $previousTopoHeight)'; + return 'VersionedBalance(balance: $balance, previousTopoHeight: $previousTopoHeight)'; } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$BalanceImpl && + other is _$VersionedBalanceImpl && (identical(other.balance, balance) || other.balance == balance) && (identical(other.previousTopoHeight, previousTopoHeight) || other.previousTopoHeight == previousTopoHeight)); @@ -147,33 +155,37 @@ class _$BalanceImpl implements _Balance { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$BalanceImplCopyWith<_$BalanceImpl> get copyWith => - __$$BalanceImplCopyWithImpl<_$BalanceImpl>(this, _$identity); + _$$VersionedBalanceImplCopyWith<_$VersionedBalanceImpl> get copyWith => + __$$VersionedBalanceImplCopyWithImpl<_$VersionedBalanceImpl>( + this, _$identity); @override Map toJson() { - return _$$BalanceImplToJson( + return _$$VersionedBalanceImplToJson( this, ); } } -abstract class _Balance implements Balance { - const factory _Balance( +abstract class _VersionedBalance implements VersionedBalance { + const factory _VersionedBalance( {@JsonKey(name: 'balance') required final int balance, @JsonKey(name: 'previous_topoheight') - final int? previousTopoHeight}) = _$BalanceImpl; + final int? previousTopoHeight}) = _$VersionedBalanceImpl; - factory _Balance.fromJson(Map json) = _$BalanceImpl.fromJson; + factory _VersionedBalance.fromJson(Map json) = + _$VersionedBalanceImpl.fromJson; @override @JsonKey(name: 'balance') int get balance; + @override @JsonKey(name: 'previous_topoheight') int? get previousTopoHeight; + @override @JsonKey(ignore: true) - _$$BalanceImplCopyWith<_$BalanceImpl> get copyWith => + _$$VersionedBalanceImplCopyWith<_$VersionedBalanceImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/src/data_transfer_objects/get_balance/balance.g.dart b/lib/src/data_transfer_objects/versioned_balance/versioned_balance.g.dart similarity index 67% rename from lib/src/data_transfer_objects/get_balance/balance.g.dart rename to lib/src/data_transfer_objects/versioned_balance/versioned_balance.g.dart index 0155bd8..4a5db8f 100644 --- a/lib/src/data_transfer_objects/get_balance/balance.g.dart +++ b/lib/src/data_transfer_objects/versioned_balance/versioned_balance.g.dart @@ -2,19 +2,21 @@ // ignore_for_file: package_api_docs, non_constant_identifier_names -part of 'balance.dart'; +part of 'versioned_balance.dart'; // ************************************************************************** // JsonSerializableGenerator // ************************************************************************** -_$BalanceImpl _$$BalanceImplFromJson(Map json) => - _$BalanceImpl( +_$VersionedBalanceImpl _$$VersionedBalanceImplFromJson( + Map json) => + _$VersionedBalanceImpl( balance: json['balance'] as int, previousTopoHeight: json['previous_topoheight'] as int?, ); -Map _$$BalanceImplToJson(_$BalanceImpl instance) => +Map _$$VersionedBalanceImplToJson( + _$VersionedBalanceImpl instance) => { 'balance': instance.balance, 'previous_topoheight': instance.previousTopoHeight, diff --git a/lib/src/data_transfer_objects/wallet/balance_changed_event/balance_changed.freezed.dart b/lib/src/data_transfer_objects/wallet/balance_changed_event/balance_changed.freezed.dart index ce9a46a..d5dbd9c 100644 --- a/lib/src/data_transfer_objects/wallet/balance_changed_event/balance_changed.freezed.dart +++ b/lib/src/data_transfer_objects/wallet/balance_changed_event/balance_changed.freezed.dart @@ -22,12 +22,10 @@ BalanceChanged _$BalanceChangedFromJson(Map json) { mixin _$BalanceChanged { @JsonKey(name: 'asset') String get assetHash => throw _privateConstructorUsedError; - @JsonKey(name: 'balance') int get balance => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) $BalanceChangedCopyWith get copyWith => throw _privateConstructorUsedError; @@ -38,7 +36,6 @@ abstract class $BalanceChangedCopyWith<$Res> { factory $BalanceChangedCopyWith( BalanceChanged value, $Res Function(BalanceChanged) then) = _$BalanceChangedCopyWithImpl<$Res, BalanceChanged>; - @useResult $Res call( {@JsonKey(name: 'asset') String assetHash, @@ -52,7 +49,6 @@ class _$BalanceChangedCopyWithImpl<$Res, $Val extends BalanceChanged> // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -81,7 +77,6 @@ abstract class _$$BalanceChangedImplCopyWith<$Res> factory _$$BalanceChangedImplCopyWith(_$BalanceChangedImpl value, $Res Function(_$BalanceChangedImpl) then) = __$$BalanceChangedImplCopyWithImpl<$Res>; - @override @useResult $Res call( @@ -179,11 +174,9 @@ abstract class _BalanceChanged implements BalanceChanged { @override @JsonKey(name: 'asset') String get assetHash; - @override @JsonKey(name: 'balance') int get balance; - @override @JsonKey(ignore: true) _$$BalanceChangedImplCopyWith<_$BalanceChangedImpl> get copyWith => diff --git a/lib/src/data_transfer_objects/wallet/build_transaction/build_transaction_params.freezed.dart b/lib/src/data_transfer_objects/wallet/build_transaction/build_transaction_params.freezed.dart index 2720c5a..e847486 100644 --- a/lib/src/data_transfer_objects/wallet/build_transaction/build_transaction_params.freezed.dart +++ b/lib/src/data_transfer_objects/wallet/build_transaction/build_transaction_params.freezed.dart @@ -23,27 +23,20 @@ BuildTransactionParams _$BuildTransactionParamsFromJson( mixin _$BuildTransactionParams { @JsonKey(name: 'transfers') List? get transfers => throw _privateConstructorUsedError; - @JsonKey(name: 'burn') Burn? get burn => throw _privateConstructorUsedError; - @JsonKey(name: 'call_contract') CallContract? get callContract => throw _privateConstructorUsedError; - @JsonKey(name: 'deploy_contract') String? get deployContract => throw _privateConstructorUsedError; - @JsonKey(name: 'fee') FeeBuilder? get feeBuilder => throw _privateConstructorUsedError; - @JsonKey(name: 'broadcast') bool get broadcast => throw _privateConstructorUsedError; - @JsonKey(name: 'tx_as_hex') bool? get txAsHex => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) $BuildTransactionParamsCopyWith get copyWith => throw _privateConstructorUsedError; @@ -54,7 +47,6 @@ abstract class $BuildTransactionParamsCopyWith<$Res> { factory $BuildTransactionParamsCopyWith(BuildTransactionParams value, $Res Function(BuildTransactionParams) then) = _$BuildTransactionParamsCopyWithImpl<$Res, BuildTransactionParams>; - @useResult $Res call( {@JsonKey(name: 'transfers') List? transfers, @@ -66,9 +58,7 @@ abstract class $BuildTransactionParamsCopyWith<$Res> { @JsonKey(name: 'tx_as_hex') bool? txAsHex}); $BurnCopyWith<$Res>? get burn; - $CallContractCopyWith<$Res>? get callContract; - $FeeBuilderCopyWith<$Res>? get feeBuilder; } @@ -80,7 +70,6 @@ class _$BuildTransactionParamsCopyWithImpl<$Res, // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -171,7 +160,6 @@ abstract class _$$BuildTransactionParamsImplCopyWith<$Res> _$BuildTransactionParamsImpl value, $Res Function(_$BuildTransactionParamsImpl) then) = __$$BuildTransactionParamsImplCopyWithImpl<$Res>; - @override @useResult $Res call( @@ -185,10 +173,8 @@ abstract class _$$BuildTransactionParamsImplCopyWith<$Res> @override $BurnCopyWith<$Res>? get burn; - @override $CallContractCopyWith<$Res>? get callContract; - @override $FeeBuilderCopyWith<$Res>? get feeBuilder; } @@ -265,7 +251,6 @@ class _$BuildTransactionParamsImpl implements _BuildTransactionParams { _$$BuildTransactionParamsImplFromJson(json); final List? _transfers; - @override @JsonKey(name: 'transfers') List? get transfers { @@ -363,31 +348,24 @@ abstract class _BuildTransactionParams implements BuildTransactionParams { @override @JsonKey(name: 'transfers') List? get transfers; - @override @JsonKey(name: 'burn') Burn? get burn; - @override @JsonKey(name: 'call_contract') CallContract? get callContract; - @override @JsonKey(name: 'deploy_contract') String? get deployContract; - @override @JsonKey(name: 'fee') FeeBuilder? get feeBuilder; - @override @JsonKey(name: 'broadcast') bool get broadcast; - @override @JsonKey(name: 'tx_as_hex') bool? get txAsHex; - @override @JsonKey(ignore: true) _$$BuildTransactionParamsImplCopyWith<_$BuildTransactionParamsImpl> diff --git a/lib/src/data_transfer_objects/wallet/build_transaction/fee_builder.freezed.dart b/lib/src/data_transfer_objects/wallet/build_transaction/fee_builder.freezed.dart index 36cf64f..942590c 100644 --- a/lib/src/data_transfer_objects/wallet/build_transaction/fee_builder.freezed.dart +++ b/lib/src/data_transfer_objects/wallet/build_transaction/fee_builder.freezed.dart @@ -22,12 +22,10 @@ FeeBuilder _$FeeBuilderFromJson(Map json) { mixin _$FeeBuilder { @JsonKey(name: 'Multiplier') double? get multiplier => throw _privateConstructorUsedError; - @JsonKey(name: 'Value') int? get value => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) $FeeBuilderCopyWith get copyWith => throw _privateConstructorUsedError; @@ -38,7 +36,6 @@ abstract class $FeeBuilderCopyWith<$Res> { factory $FeeBuilderCopyWith( FeeBuilder value, $Res Function(FeeBuilder) then) = _$FeeBuilderCopyWithImpl<$Res, FeeBuilder>; - @useResult $Res call( {@JsonKey(name: 'Multiplier') double? multiplier, @@ -52,7 +49,6 @@ class _$FeeBuilderCopyWithImpl<$Res, $Val extends FeeBuilder> // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -81,7 +77,6 @@ abstract class _$$FeeBuilderImplCopyWith<$Res> factory _$$FeeBuilderImplCopyWith( _$FeeBuilderImpl value, $Res Function(_$FeeBuilderImpl) then) = __$$FeeBuilderImplCopyWithImpl<$Res>; - @override @useResult $Res call( @@ -177,11 +172,9 @@ abstract class _FeeBuilder implements FeeBuilder { @override @JsonKey(name: 'Multiplier') double? get multiplier; - @override @JsonKey(name: 'Value') int? get value; - @override @JsonKey(ignore: true) _$$FeeBuilderImplCopyWith<_$FeeBuilderImpl> get copyWith => diff --git a/lib/src/data_transfer_objects/wallet/get_address/get_address_params.freezed.dart b/lib/src/data_transfer_objects/wallet/get_address/get_address_params.freezed.dart index d9ca30b..8733221 100644 --- a/lib/src/data_transfer_objects/wallet/get_address/get_address_params.freezed.dart +++ b/lib/src/data_transfer_objects/wallet/get_address/get_address_params.freezed.dart @@ -24,7 +24,6 @@ mixin _$GetAddressParams { Map get integratedData => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) $GetAddressParamsCopyWith get copyWith => throw _privateConstructorUsedError; @@ -35,7 +34,6 @@ abstract class $GetAddressParamsCopyWith<$Res> { factory $GetAddressParamsCopyWith( GetAddressParams value, $Res Function(GetAddressParams) then) = _$GetAddressParamsCopyWithImpl<$Res, GetAddressParams>; - @useResult $Res call( {@JsonKey(name: 'integrated_data') Map integratedData}); @@ -48,7 +46,6 @@ class _$GetAddressParamsCopyWithImpl<$Res, $Val extends GetAddressParams> // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -72,7 +69,6 @@ abstract class _$$GetAddressParamsImplCopyWith<$Res> factory _$$GetAddressParamsImplCopyWith(_$GetAddressParamsImpl value, $Res Function(_$GetAddressParamsImpl) then) = __$$GetAddressParamsImplCopyWithImpl<$Res>; - @override @useResult $Res call( @@ -113,7 +109,6 @@ class _$GetAddressParamsImpl implements _GetAddressParams { _$$GetAddressParamsImplFromJson(json); final Map _integratedData; - @override @JsonKey(name: 'integrated_data') Map get integratedData { @@ -168,7 +163,6 @@ abstract class _GetAddressParams implements GetAddressParams { @override @JsonKey(name: 'integrated_data') Map get integratedData; - @override @JsonKey(ignore: true) _$$GetAddressParamsImplCopyWith<_$GetAddressParamsImpl> get copyWith => 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 4b99c50..73739b4 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 @@ -23,27 +23,20 @@ ListTransactionsParams _$ListTransactionsParamsFromJson( mixin _$ListTransactionsParams { @JsonKey(name: 'min_topoheight') int? get minTopoHeight => throw _privateConstructorUsedError; - @JsonKey(name: 'max_topoheight') int? get maxTopoHeight => throw _privateConstructorUsedError; - @JsonKey(name: 'address') String? get address => throw _privateConstructorUsedError; - @JsonKey(name: 'accept_incoming') bool? get acceptIncoming => throw _privateConstructorUsedError; - @JsonKey(name: 'accept_outgoing') bool? get acceptOutgoing => throw _privateConstructorUsedError; - @JsonKey(name: 'accept_coinbase') bool? get acceptCoinbase => throw _privateConstructorUsedError; - @JsonKey(name: 'accept_burn') bool? get acceptBurn => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) $ListTransactionsParamsCopyWith get copyWith => throw _privateConstructorUsedError; @@ -54,7 +47,6 @@ abstract class $ListTransactionsParamsCopyWith<$Res> { factory $ListTransactionsParamsCopyWith(ListTransactionsParams value, $Res Function(ListTransactionsParams) then) = _$ListTransactionsParamsCopyWithImpl<$Res, ListTransactionsParams>; - @useResult $Res call( {@JsonKey(name: 'min_topoheight') int? minTopoHeight, @@ -74,7 +66,6 @@ class _$ListTransactionsParamsCopyWithImpl<$Res, // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -129,7 +120,6 @@ abstract class _$$ListTransactionsParamsImplCopyWith<$Res> _$ListTransactionsParamsImpl value, $Res Function(_$ListTransactionsParamsImpl) then) = __$$ListTransactionsParamsImplCopyWithImpl<$Res>; - @override @useResult $Res call( @@ -296,31 +286,24 @@ abstract class _ListTransactionsParams implements ListTransactionsParams { @override @JsonKey(name: 'min_topoheight') int? get minTopoHeight; - @override @JsonKey(name: 'max_topoheight') int? get maxTopoHeight; - @override @JsonKey(name: 'address') String? get address; - @override @JsonKey(name: 'accept_incoming') bool? get acceptIncoming; - @override @JsonKey(name: 'accept_outgoing') bool? get acceptOutgoing; - @override @JsonKey(name: 'accept_coinbase') bool? get acceptCoinbase; - @override @JsonKey(name: 'accept_burn') bool? get acceptBurn; - @override @JsonKey(ignore: true) _$$ListTransactionsParamsImplCopyWith<_$ListTransactionsParamsImpl> diff --git a/lib/src/data_transfer_objects/wallet/list_transactions/transaction_entry.freezed.dart b/lib/src/data_transfer_objects/wallet/list_transactions/transaction_entry.freezed.dart index c04b019..405a173 100644 --- a/lib/src/data_transfer_objects/wallet/list_transactions/transaction_entry.freezed.dart +++ b/lib/src/data_transfer_objects/wallet/list_transactions/transaction_entry.freezed.dart @@ -22,30 +22,22 @@ TransactionEntry _$TransactionEntryFromJson(Map json) { mixin _$TransactionEntry { @JsonKey(name: 'hash') String get hash => throw _privateConstructorUsedError; - @JsonKey(name: 'topoheight') int get topoHeight => throw _privateConstructorUsedError; - @JsonKey(name: 'transfers') List? get transfers => throw _privateConstructorUsedError; - @JsonKey(name: 'burn') Burn? get burn => throw _privateConstructorUsedError; - @JsonKey(name: 'call_contract') CallContract? get callContract => throw _privateConstructorUsedError; - @JsonKey(name: 'deploy_contract') String? get deployContract => throw _privateConstructorUsedError; - @JsonKey(name: 'fee') int? get fee => throw _privateConstructorUsedError; - @JsonKey(name: 'nonce') int? get nonce => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) $TransactionEntryCopyWith get copyWith => throw _privateConstructorUsedError; @@ -56,7 +48,6 @@ abstract class $TransactionEntryCopyWith<$Res> { factory $TransactionEntryCopyWith( TransactionEntry value, $Res Function(TransactionEntry) then) = _$TransactionEntryCopyWithImpl<$Res, TransactionEntry>; - @useResult $Res call( {@JsonKey(name: 'hash') String hash, @@ -69,7 +60,6 @@ abstract class $TransactionEntryCopyWith<$Res> { @JsonKey(name: 'nonce') int? nonce}); $BurnCopyWith<$Res>? get burn; - $CallContractCopyWith<$Res>? get callContract; } @@ -80,7 +70,6 @@ class _$TransactionEntryCopyWithImpl<$Res, $Val extends TransactionEntry> // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -163,7 +152,6 @@ abstract class _$$TransactionEntryImplCopyWith<$Res> factory _$$TransactionEntryImplCopyWith(_$TransactionEntryImpl value, $Res Function(_$TransactionEntryImpl) then) = __$$TransactionEntryImplCopyWithImpl<$Res>; - @override @useResult $Res call( @@ -178,7 +166,6 @@ abstract class _$$TransactionEntryImplCopyWith<$Res> @override $BurnCopyWith<$Res>? get burn; - @override $CallContractCopyWith<$Res>? get callContract; } @@ -264,7 +251,6 @@ class _$TransactionEntryImpl implements _TransactionEntry { @JsonKey(name: 'topoheight') final int topoHeight; final List? _transfers; - @override @JsonKey(name: 'transfers') List? get transfers { @@ -360,35 +346,27 @@ abstract class _TransactionEntry implements TransactionEntry { @override @JsonKey(name: 'hash') String get hash; - @override @JsonKey(name: 'topoheight') int get topoHeight; - @override @JsonKey(name: 'transfers') List? get transfers; - @override @JsonKey(name: 'burn') Burn? get burn; - @override @JsonKey(name: 'call_contract') CallContract? get callContract; - @override @JsonKey(name: 'deploy_contract') String? get deployContract; - @override @JsonKey(name: 'fee') int? get fee; - @override @JsonKey(name: 'nonce') int? get nonce; - @override @JsonKey(ignore: true) _$$TransactionEntryImplCopyWith<_$TransactionEntryImpl> get copyWith => diff --git a/lib/src/data_transfer_objects/wallet/new_asset_event/asset_with_data.freezed.dart b/lib/src/data_transfer_objects/wallet/new_asset_event/asset_with_data.freezed.dart index 8bc0f3b..1f0eeb8 100644 --- a/lib/src/data_transfer_objects/wallet/new_asset_event/asset_with_data.freezed.dart +++ b/lib/src/data_transfer_objects/wallet/new_asset_event/asset_with_data.freezed.dart @@ -22,15 +22,12 @@ AssetWithData _$AssetWithDataFromJson(Map json) { mixin _$AssetWithData { @JsonKey(name: 'asset') String get assetHash => throw _privateConstructorUsedError; - @JsonKey(name: 'topoheight') int get topoHeight => throw _privateConstructorUsedError; - @JsonKey(name: 'decimals') int get decimals => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) $AssetWithDataCopyWith get copyWith => throw _privateConstructorUsedError; @@ -41,7 +38,6 @@ abstract class $AssetWithDataCopyWith<$Res> { factory $AssetWithDataCopyWith( AssetWithData value, $Res Function(AssetWithData) then) = _$AssetWithDataCopyWithImpl<$Res, AssetWithData>; - @useResult $Res call( {@JsonKey(name: 'asset') String assetHash, @@ -56,7 +52,6 @@ class _$AssetWithDataCopyWithImpl<$Res, $Val extends AssetWithData> // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -90,7 +85,6 @@ abstract class _$$AssetWithDataImplCopyWith<$Res> factory _$$AssetWithDataImplCopyWith( _$AssetWithDataImpl value, $Res Function(_$AssetWithDataImpl) then) = __$$AssetWithDataImplCopyWithImpl<$Res>; - @override @useResult $Res call( @@ -201,15 +195,12 @@ abstract class _AssetWithData implements AssetWithData { @override @JsonKey(name: 'asset') String get assetHash; - @override @JsonKey(name: 'topoheight') int get topoHeight; - @override @JsonKey(name: 'decimals') int get decimals; - @override @JsonKey(ignore: true) _$$AssetWithDataImplCopyWith<_$AssetWithDataImpl> get copyWith => 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 b9aa52e..091934e 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 @@ -24,7 +24,6 @@ mixin _$RescanParams { int get topoHeight => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) $RescanParamsCopyWith get copyWith => throw _privateConstructorUsedError; @@ -35,7 +34,6 @@ abstract class $RescanParamsCopyWith<$Res> { factory $RescanParamsCopyWith( RescanParams value, $Res Function(RescanParams) then) = _$RescanParamsCopyWithImpl<$Res, RescanParams>; - @useResult $Res call({@JsonKey(name: 'topoheight') int topoHeight}); } @@ -47,7 +45,6 @@ class _$RescanParamsCopyWithImpl<$Res, $Val extends RescanParams> // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -71,7 +68,6 @@ abstract class _$$RescanParamsImplCopyWith<$Res> factory _$$RescanParamsImplCopyWith( _$RescanParamsImpl value, $Res Function(_$RescanParamsImpl) then) = __$$RescanParamsImplCopyWithImpl<$Res>; - @override @useResult $Res call({@JsonKey(name: 'topoheight') int topoHeight}); @@ -155,7 +151,6 @@ abstract class _RescanParams implements RescanParams { @override @JsonKey(name: 'topoheight') int get topoHeight; - @override @JsonKey(ignore: true) _$$RescanParamsImplCopyWith<_$RescanParamsImpl> get copyWith => diff --git a/lib/src/data_transfer_objects/wallet/split_address/split_address_params.freezed.dart b/lib/src/data_transfer_objects/wallet/split_address/split_address_params.freezed.dart index fe03f68..c8c387b 100644 --- a/lib/src/data_transfer_objects/wallet/split_address/split_address_params.freezed.dart +++ b/lib/src/data_transfer_objects/wallet/split_address/split_address_params.freezed.dart @@ -24,7 +24,6 @@ mixin _$SplitAddressParams { String get address => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) $SplitAddressParamsCopyWith get copyWith => throw _privateConstructorUsedError; @@ -35,7 +34,6 @@ abstract class $SplitAddressParamsCopyWith<$Res> { factory $SplitAddressParamsCopyWith( SplitAddressParams value, $Res Function(SplitAddressParams) then) = _$SplitAddressParamsCopyWithImpl<$Res, SplitAddressParams>; - @useResult $Res call({@JsonKey(name: 'address') String address}); } @@ -47,7 +45,6 @@ class _$SplitAddressParamsCopyWithImpl<$Res, $Val extends SplitAddressParams> // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -71,7 +68,6 @@ abstract class _$$SplitAddressParamsImplCopyWith<$Res> factory _$$SplitAddressParamsImplCopyWith(_$SplitAddressParamsImpl value, $Res Function(_$SplitAddressParamsImpl) then) = __$$SplitAddressParamsImplCopyWithImpl<$Res>; - @override @useResult $Res call({@JsonKey(name: 'address') String address}); @@ -155,7 +151,6 @@ abstract class _SplitAddressParams implements SplitAddressParams { @override @JsonKey(name: 'address') String get address; - @override @JsonKey(ignore: true) _$$SplitAddressParamsImplCopyWith<_$SplitAddressParamsImpl> get copyWith => diff --git a/lib/src/data_transfer_objects/wallet/split_address/split_address_result.freezed.dart b/lib/src/data_transfer_objects/wallet/split_address/split_address_result.freezed.dart index cc21f72..3829038 100644 --- a/lib/src/data_transfer_objects/wallet/split_address/split_address_result.freezed.dart +++ b/lib/src/data_transfer_objects/wallet/split_address/split_address_result.freezed.dart @@ -22,12 +22,10 @@ SplitAddressResult _$SplitAddressResultFromJson(Map json) { mixin _$SplitAddressResult { @JsonKey(name: 'address') String get address => throw _privateConstructorUsedError; - @JsonKey(name: 'integrated_data') Map get integratedData => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) $SplitAddressResultCopyWith get copyWith => throw _privateConstructorUsedError; @@ -38,7 +36,6 @@ abstract class $SplitAddressResultCopyWith<$Res> { factory $SplitAddressResultCopyWith( SplitAddressResult value, $Res Function(SplitAddressResult) then) = _$SplitAddressResultCopyWithImpl<$Res, SplitAddressResult>; - @useResult $Res call( {@JsonKey(name: 'address') String address, @@ -52,7 +49,6 @@ class _$SplitAddressResultCopyWithImpl<$Res, $Val extends SplitAddressResult> // ignore: unused_field final $Val _value; - // ignore: unused_field final $Res Function($Val) _then; @@ -81,7 +77,6 @@ abstract class _$$SplitAddressResultImplCopyWith<$Res> factory _$$SplitAddressResultImplCopyWith(_$SplitAddressResultImpl value, $Res Function(_$SplitAddressResultImpl) then) = __$$SplitAddressResultImplCopyWithImpl<$Res>; - @override @useResult $Res call( @@ -132,7 +127,6 @@ class _$SplitAddressResultImpl implements _SplitAddressResult { @JsonKey(name: 'address') final String address; final Map _integratedData; - @override @JsonKey(name: 'integrated_data') Map get integratedData { @@ -189,11 +183,9 @@ abstract class _SplitAddressResult implements SplitAddressResult { @override @JsonKey(name: 'address') String get address; - @override @JsonKey(name: 'integrated_data') Map get integratedData; - @override @JsonKey(ignore: true) _$$SplitAddressResultImplCopyWith<_$SplitAddressResultImpl> get copyWith => diff --git a/lib/src/repositories/daemon/daemon_constants.dart b/lib/src/repositories/daemon/daemon_constants.dart index df7f566..c6cffee 100644 --- a/lib/src/repositories/daemon/daemon_constants.dart +++ b/lib/src/repositories/daemon/daemon_constants.dart @@ -36,7 +36,7 @@ enum DaemonMethod implements XelisJsonKey { getNonce('get_nonce'), /// Get up-to-date asset's balance for a specific address. - getLastBalance('get_last_balance'), + getBalance('get_balance'), /// Get asset's balance from address at exact topoheight. getBalanceAtTopoHeight('get_balance_at_topoheight'), diff --git a/lib/src/repositories/daemon/daemon_rpc_methods_extension.dart b/lib/src/repositories/daemon/daemon_rpc_methods_extension.dart index 80c0ece..d400198 100644 --- a/lib/src/repositories/daemon/daemon_rpc_methods_extension.dart +++ b/lib/src/repositories/daemon/daemon_rpc_methods_extension.dart @@ -103,27 +103,27 @@ extension DaemonRpcMethodsExtension on DaemonClient { /// Returns up-to-date asset's balance for a specific address. /// /// NOTE: Balance is returned in atomic units. - Future getLastBalance( - GetLastBalanceParams getLastBalanceParams, + Future getBalance( + GetBalanceParams getBalanceParams, ) async { final result = await sendRequest( - DaemonMethod.getLastBalance, - getLastBalanceParams.toJson(), + DaemonMethod.getBalance, + getBalanceParams.toJson(), ); - return GetLastBalanceResult.fromJson(result as Map); + return GetBalanceResult.fromJson(result as Map); } /// Returns asset's balance from address at exact topo height. /// /// NOTE: Balance is returned in atomic units - Future getBalanceAtTopoHeight( + Future getBalanceAtTopoHeight( GetBalanceAtTopoHeightParams getBalanceAtTopoHeightParams, ) async { final result = await sendRequest( DaemonMethod.getBalanceAtTopoHeight, getBalanceAtTopoHeightParams.toJson(), ); - return Balance.fromJson(result as Map); + return VersionedBalance.fromJson(result as Map); } /// Get registered topoheight and decimals data from a specific asset. diff --git a/pubspec.yaml b/pubspec.yaml index 59b5141..fddf37f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: xelis_dart_sdk description: Software Development Kit in Dart to build Apps for the Xelis Blockchain. -version: 0.13.2 +version: 0.13.3 repository: https://github.com/xelis-project/xelis-dart-jdk environment: