diff --git a/rpc-client/src/subcommands/transactions_subcommands.rs b/rpc-client/src/subcommands/transactions_subcommands.rs index ee87c3242e..b44c7ceb9c 100644 --- a/rpc-client/src/subcommands/transactions_subcommands.rs +++ b/rpc-client/src/subcommands/transactions_subcommands.rs @@ -328,6 +328,18 @@ pub enum TransactionCommand { #[clap(short, long, default_value_t)] validity_start_height: ValidityStartHeight, }, + + /// Deserializes the given transaction and prints its details. + GetRawTransactionInfo { + /// The transaction to be sent in hex string format. + raw_tx: String, + }, + + /// Sends the given serialized transaction to the network. + SendRawTransaction { + /// The transaction to be sent in hex string format. + raw_tx: String, + }, } impl TransactionCommand { @@ -828,6 +840,14 @@ impl HandleSubcommand for TransactionCommand { .await?; println!("{tx:#?}"); } + TransactionCommand::GetRawTransactionInfo { raw_tx } => { + let tx = client.consensus.get_raw_transaction_info(raw_tx).await?; + println!("{tx:#?}"); + } + TransactionCommand::SendRawTransaction { raw_tx } => { + let tx = client.consensus.send_raw_transaction(raw_tx).await?; + println!("{tx:#?}"); + } } Ok(client) }