From 637adb214104c16fc3bb10f349353072225cd937 Mon Sep 17 00:00:00 2001 From: Ez3kiel Date: Thu, 1 Aug 2024 21:15:13 +0200 Subject: [PATCH] feat(daemon): getMinerWork RPC method --- README.md | 1 + lib/src/data_transfer_objects/dtos.dart | 2 + .../get_miner_work/get_miner_work_params.dart | 21 ++ .../get_miner_work_params.freezed.dart | 197 +++++++++++++ .../get_miner_work_params.g.dart | 23 ++ .../get_miner_work/get_miner_work_result.dart | 24 ++ .../get_miner_work_result.freezed.dart | 270 ++++++++++++++++++ .../get_miner_work_result.g.dart | 29 ++ .../repositories/daemon/daemon_constants.dart | 5 +- .../daemon/daemon_rpc_methods_extension.dart | 11 + 10 files changed, 582 insertions(+), 1 deletion(-) create mode 100644 lib/src/data_transfer_objects/get_miner_work/get_miner_work_params.dart create mode 100644 lib/src/data_transfer_objects/get_miner_work/get_miner_work_params.freezed.dart create mode 100644 lib/src/data_transfer_objects/get_miner_work/get_miner_work_params.g.dart create mode 100644 lib/src/data_transfer_objects/get_miner_work/get_miner_work_result.dart create mode 100644 lib/src/data_transfer_objects/get_miner_work/get_miner_work_result.freezed.dart create mode 100644 lib/src/data_transfer_objects/get_miner_work/get_miner_work_result.g.dart diff --git a/README.md b/README.md index 2a54e64..6a00446 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,7 @@ JSON-RPC Clients to interact with daemon and wallet API. - validateAddress - splitAddress - extractKeyFromAddress +- getMinerWork #### Wallet diff --git a/lib/src/data_transfer_objects/dtos.dart b/lib/src/data_transfer_objects/dtos.dart index 9c1253b..f8227e4 100644 --- a/lib/src/data_transfer_objects/dtos.dart +++ b/lib/src/data_transfer_objects/dtos.dart @@ -32,6 +32,8 @@ export 'get_difficulty/get_difficulty_result.dart'; export 'get_info/get_info_result.dart'; export 'get_mempool_cache/get_mempool_cache_params.dart'; export 'get_mempool_cache/get_mempool_cache_result.dart'; +export 'get_miner_work/get_miner_work_params.dart'; +export 'get_miner_work/get_miner_work_result.dart'; export 'get_nonce/get_nonce_params.dart'; export 'get_nonce/get_nonce_result.dart'; export 'get_nonce_at_topoheight/get_nonce_at_topoheight_params.dart'; diff --git a/lib/src/data_transfer_objects/get_miner_work/get_miner_work_params.dart b/lib/src/data_transfer_objects/get_miner_work/get_miner_work_params.dart new file mode 100644 index 0000000..15df761 --- /dev/null +++ b/lib/src/data_transfer_objects/get_miner_work/get_miner_work_params.dart @@ -0,0 +1,21 @@ +// ignore_for_file: invalid_annotation_target + +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'get_miner_work_params.freezed.dart'; + +part 'get_miner_work_params.g.dart'; + +/// @nodoc +@freezed +class GetMinerWorkParams with _$GetMinerWorkParams { + /// @nodoc + const factory GetMinerWorkParams({ + @JsonKey(name: 'template') required String template, + @JsonKey(name: 'address') required String address, + }) = _GetMinerWorkParams; + + /// @nodoc + factory GetMinerWorkParams.fromJson(Map json) => + _$GetMinerWorkParamsFromJson(json); +} diff --git a/lib/src/data_transfer_objects/get_miner_work/get_miner_work_params.freezed.dart b/lib/src/data_transfer_objects/get_miner_work/get_miner_work_params.freezed.dart new file mode 100644 index 0000000..876d285 --- /dev/null +++ b/lib/src/data_transfer_objects/get_miner_work/get_miner_work_params.freezed.dart @@ -0,0 +1,197 @@ +// 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_miner_work_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'); + +GetMinerWorkParams _$GetMinerWorkParamsFromJson(Map json) { + return _GetMinerWorkParams.fromJson(json); +} + +/// @nodoc +mixin _$GetMinerWorkParams { + @JsonKey(name: 'template') + String get template => throw _privateConstructorUsedError; + @JsonKey(name: 'address') + String get address => throw _privateConstructorUsedError; + + /// Serializes this GetMinerWorkParams to a JSON map. + Map toJson() => throw _privateConstructorUsedError; + + /// Create a copy of GetMinerWorkParams + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $GetMinerWorkParamsCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $GetMinerWorkParamsCopyWith<$Res> { + factory $GetMinerWorkParamsCopyWith( + GetMinerWorkParams value, $Res Function(GetMinerWorkParams) then) = + _$GetMinerWorkParamsCopyWithImpl<$Res, GetMinerWorkParams>; + @useResult + $Res call( + {@JsonKey(name: 'template') String template, + @JsonKey(name: 'address') String address}); +} + +/// @nodoc +class _$GetMinerWorkParamsCopyWithImpl<$Res, $Val extends GetMinerWorkParams> + implements $GetMinerWorkParamsCopyWith<$Res> { + _$GetMinerWorkParamsCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of GetMinerWorkParams + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? template = null, + Object? address = null, + }) { + return _then(_value.copyWith( + template: null == template + ? _value.template + : template // ignore: cast_nullable_to_non_nullable + as String, + address: null == address + ? _value.address + : address // ignore: cast_nullable_to_non_nullable + as String, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$GetMinerWorkParamsImplCopyWith<$Res> + implements $GetMinerWorkParamsCopyWith<$Res> { + factory _$$GetMinerWorkParamsImplCopyWith(_$GetMinerWorkParamsImpl value, + $Res Function(_$GetMinerWorkParamsImpl) then) = + __$$GetMinerWorkParamsImplCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {@JsonKey(name: 'template') String template, + @JsonKey(name: 'address') String address}); +} + +/// @nodoc +class __$$GetMinerWorkParamsImplCopyWithImpl<$Res> + extends _$GetMinerWorkParamsCopyWithImpl<$Res, _$GetMinerWorkParamsImpl> + implements _$$GetMinerWorkParamsImplCopyWith<$Res> { + __$$GetMinerWorkParamsImplCopyWithImpl(_$GetMinerWorkParamsImpl _value, + $Res Function(_$GetMinerWorkParamsImpl) _then) + : super(_value, _then); + + /// Create a copy of GetMinerWorkParams + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? template = null, + Object? address = null, + }) { + return _then(_$GetMinerWorkParamsImpl( + template: null == template + ? _value.template + : template // ignore: cast_nullable_to_non_nullable + as String, + address: null == address + ? _value.address + : address // ignore: cast_nullable_to_non_nullable + as String, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$GetMinerWorkParamsImpl implements _GetMinerWorkParams { + const _$GetMinerWorkParamsImpl( + {@JsonKey(name: 'template') required this.template, + @JsonKey(name: 'address') required this.address}); + + factory _$GetMinerWorkParamsImpl.fromJson(Map json) => + _$$GetMinerWorkParamsImplFromJson(json); + + @override + @JsonKey(name: 'template') + final String template; + @override + @JsonKey(name: 'address') + final String address; + + @override + String toString() { + return 'GetMinerWorkParams(template: $template, address: $address)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$GetMinerWorkParamsImpl && + (identical(other.template, template) || + other.template == template) && + (identical(other.address, address) || other.address == address)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash(runtimeType, template, address); + + /// Create a copy of GetMinerWorkParams + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$GetMinerWorkParamsImplCopyWith<_$GetMinerWorkParamsImpl> get copyWith => + __$$GetMinerWorkParamsImplCopyWithImpl<_$GetMinerWorkParamsImpl>( + this, _$identity); + + @override + Map toJson() { + return _$$GetMinerWorkParamsImplToJson( + this, + ); + } +} + +abstract class _GetMinerWorkParams implements GetMinerWorkParams { + const factory _GetMinerWorkParams( + {@JsonKey(name: 'template') required final String template, + @JsonKey(name: 'address') required final String address}) = + _$GetMinerWorkParamsImpl; + + factory _GetMinerWorkParams.fromJson(Map json) = + _$GetMinerWorkParamsImpl.fromJson; + + @override + @JsonKey(name: 'template') + String get template; + @override + @JsonKey(name: 'address') + String get address; + + /// Create a copy of GetMinerWorkParams + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$GetMinerWorkParamsImplCopyWith<_$GetMinerWorkParamsImpl> get copyWith => + throw _privateConstructorUsedError; +} diff --git a/lib/src/data_transfer_objects/get_miner_work/get_miner_work_params.g.dart b/lib/src/data_transfer_objects/get_miner_work/get_miner_work_params.g.dart new file mode 100644 index 0000000..2df3f06 --- /dev/null +++ b/lib/src/data_transfer_objects/get_miner_work/get_miner_work_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_miner_work_params.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_$GetMinerWorkParamsImpl _$$GetMinerWorkParamsImplFromJson( + Map json) => + _$GetMinerWorkParamsImpl( + template: json['template'] as String, + address: json['address'] as String, + ); + +Map _$$GetMinerWorkParamsImplToJson( + _$GetMinerWorkParamsImpl instance) => + { + 'template': instance.template, + 'address': instance.address, + }; diff --git a/lib/src/data_transfer_objects/get_miner_work/get_miner_work_result.dart b/lib/src/data_transfer_objects/get_miner_work/get_miner_work_result.dart new file mode 100644 index 0000000..86b86be --- /dev/null +++ b/lib/src/data_transfer_objects/get_miner_work/get_miner_work_result.dart @@ -0,0 +1,24 @@ +// ignore_for_file: invalid_annotation_target + +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'get_miner_work_result.freezed.dart'; + +part 'get_miner_work_result.g.dart'; + +/// @nodoc +@freezed +class GetMinerWorkResult with _$GetMinerWorkResult { + /// @nodoc + const factory GetMinerWorkResult({ + @JsonKey(name: 'algorithm') required String algorithm, + @JsonKey(name: 'miner_work') required String minerWork, + @JsonKey(name: 'height') required int height, + @JsonKey(name: 'difficulty') required int difficulty, + @JsonKey(name: 'topoheight') required int topoheight, + }) = _GetMinerWorkResult; + + /// @nodoc + factory GetMinerWorkResult.fromJson(Map json) => + _$GetMinerWorkResultFromJson(json); +} diff --git a/lib/src/data_transfer_objects/get_miner_work/get_miner_work_result.freezed.dart b/lib/src/data_transfer_objects/get_miner_work/get_miner_work_result.freezed.dart new file mode 100644 index 0000000..a636d6f --- /dev/null +++ b/lib/src/data_transfer_objects/get_miner_work/get_miner_work_result.freezed.dart @@ -0,0 +1,270 @@ +// 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_miner_work_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#adding-getters-and-methods-to-our-models'); + +GetMinerWorkResult _$GetMinerWorkResultFromJson(Map json) { + return _GetMinerWorkResult.fromJson(json); +} + +/// @nodoc +mixin _$GetMinerWorkResult { + @JsonKey(name: 'algorithm') + String get algorithm => throw _privateConstructorUsedError; + @JsonKey(name: 'miner_work') + String get minerWork => throw _privateConstructorUsedError; + @JsonKey(name: 'height') + int get height => throw _privateConstructorUsedError; + @JsonKey(name: 'difficulty') + int get difficulty => throw _privateConstructorUsedError; + @JsonKey(name: 'topoheight') + int get topoheight => throw _privateConstructorUsedError; + + /// Serializes this GetMinerWorkResult to a JSON map. + Map toJson() => throw _privateConstructorUsedError; + + /// Create a copy of GetMinerWorkResult + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $GetMinerWorkResultCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $GetMinerWorkResultCopyWith<$Res> { + factory $GetMinerWorkResultCopyWith( + GetMinerWorkResult value, $Res Function(GetMinerWorkResult) then) = + _$GetMinerWorkResultCopyWithImpl<$Res, GetMinerWorkResult>; + @useResult + $Res call( + {@JsonKey(name: 'algorithm') String algorithm, + @JsonKey(name: 'miner_work') String minerWork, + @JsonKey(name: 'height') int height, + @JsonKey(name: 'difficulty') int difficulty, + @JsonKey(name: 'topoheight') int topoheight}); +} + +/// @nodoc +class _$GetMinerWorkResultCopyWithImpl<$Res, $Val extends GetMinerWorkResult> + implements $GetMinerWorkResultCopyWith<$Res> { + _$GetMinerWorkResultCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of GetMinerWorkResult + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? algorithm = null, + Object? minerWork = null, + Object? height = null, + Object? difficulty = null, + Object? topoheight = null, + }) { + return _then(_value.copyWith( + algorithm: null == algorithm + ? _value.algorithm + : algorithm // ignore: cast_nullable_to_non_nullable + as String, + minerWork: null == minerWork + ? _value.minerWork + : minerWork // ignore: cast_nullable_to_non_nullable + as String, + height: null == height + ? _value.height + : height // ignore: cast_nullable_to_non_nullable + as int, + difficulty: null == difficulty + ? _value.difficulty + : difficulty // ignore: cast_nullable_to_non_nullable + as int, + topoheight: null == topoheight + ? _value.topoheight + : topoheight // ignore: cast_nullable_to_non_nullable + as int, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$GetMinerWorkResultImplCopyWith<$Res> + implements $GetMinerWorkResultCopyWith<$Res> { + factory _$$GetMinerWorkResultImplCopyWith(_$GetMinerWorkResultImpl value, + $Res Function(_$GetMinerWorkResultImpl) then) = + __$$GetMinerWorkResultImplCopyWithImpl<$Res>; + @override + @useResult + $Res call( + {@JsonKey(name: 'algorithm') String algorithm, + @JsonKey(name: 'miner_work') String minerWork, + @JsonKey(name: 'height') int height, + @JsonKey(name: 'difficulty') int difficulty, + @JsonKey(name: 'topoheight') int topoheight}); +} + +/// @nodoc +class __$$GetMinerWorkResultImplCopyWithImpl<$Res> + extends _$GetMinerWorkResultCopyWithImpl<$Res, _$GetMinerWorkResultImpl> + implements _$$GetMinerWorkResultImplCopyWith<$Res> { + __$$GetMinerWorkResultImplCopyWithImpl(_$GetMinerWorkResultImpl _value, + $Res Function(_$GetMinerWorkResultImpl) _then) + : super(_value, _then); + + /// Create a copy of GetMinerWorkResult + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? algorithm = null, + Object? minerWork = null, + Object? height = null, + Object? difficulty = null, + Object? topoheight = null, + }) { + return _then(_$GetMinerWorkResultImpl( + algorithm: null == algorithm + ? _value.algorithm + : algorithm // ignore: cast_nullable_to_non_nullable + as String, + minerWork: null == minerWork + ? _value.minerWork + : minerWork // ignore: cast_nullable_to_non_nullable + as String, + height: null == height + ? _value.height + : height // ignore: cast_nullable_to_non_nullable + as int, + difficulty: null == difficulty + ? _value.difficulty + : difficulty // ignore: cast_nullable_to_non_nullable + as int, + topoheight: null == topoheight + ? _value.topoheight + : topoheight // ignore: cast_nullable_to_non_nullable + as int, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$GetMinerWorkResultImpl implements _GetMinerWorkResult { + const _$GetMinerWorkResultImpl( + {@JsonKey(name: 'algorithm') required this.algorithm, + @JsonKey(name: 'miner_work') required this.minerWork, + @JsonKey(name: 'height') required this.height, + @JsonKey(name: 'difficulty') required this.difficulty, + @JsonKey(name: 'topoheight') required this.topoheight}); + + factory _$GetMinerWorkResultImpl.fromJson(Map json) => + _$$GetMinerWorkResultImplFromJson(json); + + @override + @JsonKey(name: 'algorithm') + final String algorithm; + @override + @JsonKey(name: 'miner_work') + final String minerWork; + @override + @JsonKey(name: 'height') + final int height; + @override + @JsonKey(name: 'difficulty') + final int difficulty; + @override + @JsonKey(name: 'topoheight') + final int topoheight; + + @override + String toString() { + return 'GetMinerWorkResult(algorithm: $algorithm, minerWork: $minerWork, height: $height, difficulty: $difficulty, topoheight: $topoheight)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$GetMinerWorkResultImpl && + (identical(other.algorithm, algorithm) || + other.algorithm == algorithm) && + (identical(other.minerWork, minerWork) || + other.minerWork == minerWork) && + (identical(other.height, height) || other.height == height) && + (identical(other.difficulty, difficulty) || + other.difficulty == difficulty) && + (identical(other.topoheight, topoheight) || + other.topoheight == topoheight)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash( + runtimeType, algorithm, minerWork, height, difficulty, topoheight); + + /// Create a copy of GetMinerWorkResult + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$GetMinerWorkResultImplCopyWith<_$GetMinerWorkResultImpl> get copyWith => + __$$GetMinerWorkResultImplCopyWithImpl<_$GetMinerWorkResultImpl>( + this, _$identity); + + @override + Map toJson() { + return _$$GetMinerWorkResultImplToJson( + this, + ); + } +} + +abstract class _GetMinerWorkResult implements GetMinerWorkResult { + const factory _GetMinerWorkResult( + {@JsonKey(name: 'algorithm') required final String algorithm, + @JsonKey(name: 'miner_work') required final String minerWork, + @JsonKey(name: 'height') required final int height, + @JsonKey(name: 'difficulty') required final int difficulty, + @JsonKey(name: 'topoheight') required final int topoheight}) = + _$GetMinerWorkResultImpl; + + factory _GetMinerWorkResult.fromJson(Map json) = + _$GetMinerWorkResultImpl.fromJson; + + @override + @JsonKey(name: 'algorithm') + String get algorithm; + @override + @JsonKey(name: 'miner_work') + String get minerWork; + @override + @JsonKey(name: 'height') + int get height; + @override + @JsonKey(name: 'difficulty') + int get difficulty; + @override + @JsonKey(name: 'topoheight') + int get topoheight; + + /// Create a copy of GetMinerWorkResult + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$GetMinerWorkResultImplCopyWith<_$GetMinerWorkResultImpl> get copyWith => + throw _privateConstructorUsedError; +} diff --git a/lib/src/data_transfer_objects/get_miner_work/get_miner_work_result.g.dart b/lib/src/data_transfer_objects/get_miner_work/get_miner_work_result.g.dart new file mode 100644 index 0000000..5995be7 --- /dev/null +++ b/lib/src/data_transfer_objects/get_miner_work/get_miner_work_result.g.dart @@ -0,0 +1,29 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +// ignore_for_file: package_api_docs, non_constant_identifier_names + +part of 'get_miner_work_result.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_$GetMinerWorkResultImpl _$$GetMinerWorkResultImplFromJson( + Map json) => + _$GetMinerWorkResultImpl( + algorithm: json['algorithm'] as String, + minerWork: json['miner_work'] as String, + height: (json['height'] as num).toInt(), + difficulty: (json['difficulty'] as num).toInt(), + topoheight: (json['topoheight'] as num).toInt(), + ); + +Map _$$GetMinerWorkResultImplToJson( + _$GetMinerWorkResultImpl instance) => + { + 'algorithm': instance.algorithm, + 'miner_work': instance.minerWork, + 'height': instance.height, + 'difficulty': instance.difficulty, + 'topoheight': instance.topoheight, + }; diff --git a/lib/src/repositories/daemon/daemon_constants.dart b/lib/src/repositories/daemon/daemon_constants.dart index 2b34635..2950ce4 100644 --- a/lib/src/repositories/daemon/daemon_constants.dart +++ b/lib/src/repositories/daemon/daemon_constants.dart @@ -158,7 +158,10 @@ enum DaemonMethod implements XelisJsonKey { splitAddress('split_address'), /// Extract key from address - extractKeyFromAddress('extract_key_from_address'); + extractKeyFromAddress('extract_key_from_address'), + + /// Get miner Work + getMinerWork('get_miner_work'); /// Creates a new [DaemonMethod] instance. const DaemonMethod(this.jsonKey); diff --git a/lib/src/repositories/daemon/daemon_rpc_methods_extension.dart b/lib/src/repositories/daemon/daemon_rpc_methods_extension.dart index 5145e62..493da69 100644 --- a/lib/src/repositories/daemon/daemon_rpc_methods_extension.dart +++ b/lib/src/repositories/daemon/daemon_rpc_methods_extension.dart @@ -484,4 +484,15 @@ extension DaemonRpcMethodsExtension on DaemonClient { ); return ExtractKeyFromAddressResult.fromJson(result as Map); } + + /// Get miner Work + Future getMinerWork( + GetMinerWorkParams getMinerWorkParams, + ) async { + final result = await sendRequest( + DaemonMethod.getMinerWork, + getMinerWorkParams.toJson(), + ); + return GetMinerWorkResult.fromJson(result as Map); + } }