pub struct TxBakery { /* private fields */ }
Expand description
Transaction builder
The purpose of this component is to convert a raw TransactionInfo (dough) into a fully baked valid transaction. TxBakery does not perform IO and won’t change it’s internal state once initialized.
Implementations§
source§impl TxBakery
impl TxBakery
sourcepub async fn init(chain_query: &impl ChainQuery) -> Result<Self>
pub async fn init(chain_query: &impl ChainQuery) -> Result<Self>
Query all the parameters required to build a transaction and store it for later use. This command will call the ChainQuery service to pull certain chain parameters
sourcepub async fn init_with_config(
network: &Network,
protocol_params: &ProtocolParameters,
system_start: DateTime<Utc>,
era_summaries: Vec<EraSummary>
) -> Result<Self>
pub async fn init_with_config( network: &Network, protocol_params: &ProtocolParameters, system_start: DateTime<Utc>, era_summaries: Vec<EraSummary> ) -> Result<Self>
Init TxBakey with the required configurations This allows to directly inject configurations, and handle them separately from the bakery (for example prefetch and cache them)
sourcepub fn mk_tx_builder(&self, tx: &TxWithCtx<'_>) -> Result<TransactionBuilder>
pub fn mk_tx_builder(&self, tx: &TxWithCtx<'_>) -> Result<TransactionBuilder>
Convert a PLA TransactionInfo into a CSL transaction builder. The result is not yet balanced and witnesses are not added. This is useful for some further manual processing of the transaction before finalising.
pub fn mk_tx_body(&self, tx: &TxWithCtx<'_>) -> Result<TransactionBody>
sourcepub async fn bake_balanced_tx(
&self,
submitter: &impl Submitter,
tx: TxWithCtx<'_>
) -> Result<Transaction>
pub async fn bake_balanced_tx( &self, submitter: &impl Submitter, tx: TxWithCtx<'_> ) -> Result<Transaction>
Convert a TransactionInfo into a valid TransactionBody and prepare all witnesses (except wallet signatures) If the transaction context does not include execution units, we use Ogmios to calculate those