Skip to main content

pallas_txbuilder/
lib.rs

1mod conway;
2mod scriptdata;
3mod transaction;
4
5pub use conway::BuildConway;
6pub use transaction::model::{
7    BuiltTransaction, ExUnits, Input, Output, ScriptKind, StagingTransaction,
8};
9
10#[derive(Debug, Clone, PartialEq, thiserror::Error)]
11pub enum TxBuilderError {
12    /// Provided bytes could not be decoded into a script
13    #[error("Transaction has no inputs")]
14    MalformedScript,
15    /// Provided bytes could not be decoded into a datum
16    #[error("Could not decode datum bytes")]
17    MalformedDatum,
18    /// Provided datum hash was not 32 bytes in length
19    #[error("Invalid bytes length for datum hash")]
20    MalformedDatumHash,
21    /// Input, policy, etc pointed to by a redeemer was not found in the
22    /// transaction
23    #[error("Input/policy pointed to by redeemer not found in tx")]
24    RedeemerTargetMissing,
25    /// Provided network ID is invalid (must be 0 or 1)
26    #[error("Invalid network ID")]
27    InvalidNetworkId,
28    /// Transaction bytes in built transaction object could not be decoded
29    #[error("Corrupted transaction bytes in built transaction")]
30    CorruptedTxBytes,
31    /// Public key generated from private key was of unexpected length
32    #[error("Public key for private key is malformed")]
33    MalformedKey,
34    /// Asset name is too long, it must be 32 bytes or less
35    #[error("Asset name must be 32 bytes or less")]
36    AssetNameTooLong,
37    /// Unsupported era
38    #[error("Unsupported era")]
39    UnsupportedEra,
40}