Skip to content

Commit

Permalink
feat(daemon): splitAddress RPC method
Browse files Browse the repository at this point in the history
  • Loading branch information
Ez3kiel-dev committed Jul 30, 2024
1 parent 5c26f61 commit e69e4f8
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/src/data_transfer_objects/dtos.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ export 'network/network.dart';
export 'p2p_status/p2p_status_result.dart';
export 'peer_peer_disconnected_event/peer_peer_disconnected_event.dart';
export 'peer_peer_list_updated_event/peer_peer_list_updated_event.dart';
export 'split_address/split_address_params.dart';
export 'split_address/split_address_result.dart';
export 'stable_height_changed_event/stable_height_changed_event.dart';
export 'submit_block/submit_block_params.dart';
export 'submit_transaction/submit_transaction_params.dart';
Expand All @@ -75,8 +77,6 @@ export 'wallet/get_address/get_address_params.dart';
export 'wallet/get_balance/get_wallet_balance_params.dart';
export 'wallet/list_transactions/list_transactions_params.dart';
export 'wallet/rescan/rescan_params.dart';
export 'wallet/split_address/split_address_params.dart';
export 'wallet/split_address/split_address_result.dart';
export 'wallet/transaction_entry/transaction_entry.dart';
export 'wallet/transaction_entry/transaction_entry_type.dart';
export 'wallet/transaction_entry/transfer_in_entry.dart';
Expand Down
5 changes: 4 additions & 1 deletion lib/src/repositories/daemon/daemon_constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,10 @@ enum DaemonMethod implements XelisJsonKey {
getDifficulty('get_difficulty'),

/// Validate an address
validateAddress('validate_address');
validateAddress('validate_address'),

/// Splits address and integrated data into two different fields.
splitAddress('split_address');

/// Creates a new [DaemonMethod] instance.
const DaemonMethod(this.jsonKey);
Expand Down
11 changes: 11 additions & 0 deletions lib/src/repositories/daemon/daemon_rpc_methods_extension.dart
Original file line number Diff line number Diff line change
Expand Up @@ -462,4 +462,15 @@ extension DaemonRpcMethodsExtension on DaemonClient {
final result = await sendRequest(DaemonMethod.getDifficulty);
return GetDifficultyResult.fromJson(result as Map<String, dynamic>);
}

/// Splits address and integrated data into two different fields.
Future<SplitAddressResult> splitAddress(
SplitAddressParams splitAddressParams,
) async {
final result = await sendRequest(
DaemonMethod.splitAddress,
splitAddressParams.toJson(),
);
return SplitAddressResult.fromJson(result as Map<String, dynamic>);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ extension WalletRpcMethodsExtension on WalletClient {
/// until the specified topoheight.
/// When no topoheight is set, it rescan until 0.
///
/// **WARNING**: All balances and transactions will be deleted from wallet storage to be up-to-date with the chain of the node connected to.
/// **WARNING**: All balances and transactions will be deleted from wallet
/// storage to be up-to-date with the chain of the node connected to.
Future<bool> rescan(RescanParams rescanParams) async {
final result = await sendRequest(
WalletMethod.rescan,
Expand Down

0 comments on commit e69e4f8

Please sign in to comment.