make_transaction

Function make_transaction 

Source
pub fn make_transaction(
    builder_params: TransactionBuilderParams<'_>,
    transaction_params: TransactionStrParams<'_>,
    force: bool,
) -> Result<Transaction, CliError>
Expand description

Creates a Transaction and outputs it to a file or stdout if the std-fs-io feature is enabled.

As a file, the Transaction can subsequently be signed by other parties using sign_transaction_file and then sent to the network for execution using send_transaction_file.

If the std-fs-io feature is NOT enabled, maybe_output_path and force are ignored. Otherwise, maybe_output_path specifies the output file path, or if empty, will print it to stdout. If force is true, and a file exists at maybe_output_path, it will be overwritten. If force is false and a file exists at maybe_output_path, crate::Error::FileAlreadyExists is returned and the file will not be written.