forc-tx 0.71.0

A `forc` plugin for constructing transactions.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
fn main() -> anyhow::Result<()> {
    let cmd = forc_tx::Command::parse();
    let tx = fuel_tx::Transaction::try_from(cmd.tx)?;
    match cmd.output_path {
        None => {
            let string = serde_json::to_string_pretty(&tx)?;
            println!("{string}");
        }
        Some(path) => {
            let file = std::fs::File::create(path)?;
            let writer = std::io::BufWriter::new(file);
            serde_json::to_writer_pretty(writer, &tx)?;
        }
    }
    Ok(())
}