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<FixedTransaction>
pub async fn bake_balanced_tx( &self, submitter: &impl Submitter, tx: TxWithCtx<'_> ) -> Result<FixedTransaction>
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
Auto Trait Implementations§
impl Freeze for TxBakery
impl RefUnwindSafe for TxBakery
impl Send for TxBakery
impl Sync for TxBakery
impl Unpin for TxBakery
impl UnwindSafe for TxBakery
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more