1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
//! Ergonomic builder for constructing and signing Cardano transactions.
//!
//! The crate is organised around [`StagingTransaction`], a fluent builder
//! that collects inputs, outputs, mint, scripts, datums, and redeemers, and
//! finalises into a [`BuiltTransaction`] ready to be signed and submitted.
//!
//! Currently the only era supported for building is **Conway** (via the
//! [`BuildConway`] trait). Earlier-era builders are intentionally not
//! maintained.
//!
//! # Usage
//!
//! ```ignore
//! use pallas_txbuilder::{BuildConway, Input, Output, StagingTransaction};
//!
//! let tx = StagingTransaction::new()
//! .input(Input::new(prev_tx_hash, 0))
//! .output(Output::new(recipient_address, 2_000_000))
//! .fee(170_000)
//! .build_conway_raw()?;
//!
//! let signed = tx.sign(&signing_key)?;
//! let cbor = signed.tx_bytes;
//! ```
//!
//! # Overview
//!
//! - [`StagingTransaction`] — the in-progress, mutable transaction; the
//! entry point for everything (`new`, `input`, `output`, `mint`, `fee`,
//! `network_id`, `valid_after`, …).
//! - [`BuiltTransaction`] — the finalised, encoded body produced by
//! [`BuildConway`]; exposes `sign(&signer)` and the raw CBOR bytes.
//! - [`Input`], [`Output`], [`ExUnits`], [`ScriptKind`], [`Bytes`],
//! [`Bytes32`] — the value types that go into the builder.
//! - [`BuildConway`] trait — implemented for [`StagingTransaction`]; turns
//! staging state into a Conway-encoded transaction.
//! - [`TxBuilderError`] — the unified error returned from build / sign.
//!
//! # Usage as part of `pallas`
//!
//! When depending on the umbrella [`pallas`] crate, this crate is re-exported
//! as `pallas::txbuilder`.
//!
//! [`pallas`]: https://crates.io/crates/pallas
pub use BuildConway;
pub use ;
/// Errors produced while staging, building, or signing a transaction.