Skip to content

Commit

Permalink
feat(daemon): getMinerWork RPC method
Browse files Browse the repository at this point in the history
  • Loading branch information
Ez3kiel-dev committed Aug 1, 2024
1 parent 08bfaa5 commit 637adb2
Show file tree
Hide file tree
Showing 10 changed files with 582 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ JSON-RPC Clients to interact with daemon and wallet API.
- validateAddress
- splitAddress
- extractKeyFromAddress
- getMinerWork

#### Wallet

Expand Down
2 changes: 2 additions & 0 deletions lib/src/data_transfer_objects/dtos.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
@@ -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<String, dynamic> json) =>
_$GetMinerWorkParamsFromJson(json);
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -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<String, dynamic> json) =>
_$GetMinerWorkResultFromJson(json);
}
Loading

0 comments on commit 637adb2

Please sign in to comment.