atlas-cardano-0.3.0: Application backend for Plutus smart contracts on Cardano
Copyright(c) 2023 GYELD GMBH
LicenseApache 2.0
Maintainer[email protected]
Safe HaskellNone





data GYTxBuildResult f #

Result of building GYTxBodys with the option of recovery from error.

Consider the act of building five GYTxSkeletons into GYTxBodys. If three out of the five succeed, but the next one fails due to insufficient funds - this type facilitates recovering the three rather than failing outright and discarding the results.


GYTxBuildSuccess !(NonEmpty (f GYTxBody))

All given GYTxSkeletons were successfully built.

GYTxBuildPartialSuccess !GYValue !(NonEmpty (f GYTxBody))

Some of the given GYTxSkeletons were successfully built, but the rest failed due to _insufficient funds_.

GYTxBuildFailure !GYValue

None of the given GYTxSkeletons could be built due to _insufficient funds_.


Input did not contain any GYTxSkeletons.

buildTxCore #


∷ ∀ m f v. (GYTxQueryMonad m, MonadRandom m, Traversable f) 
⇒ SystemStart 
→ EraHistory CardanoMode 
→ ProtocolParameters 
Set PoolId 
→ [GYAddress] 
Maybe GYTxOutRef

Is Nothing if there was no 5 ada collateral returned by browser wallet.

→ m [f (GYTxSkeleton v)] 
→ m (Either BuildTxException (GYTxBuildResult f)) 

The core implementation of GYTxQueryMonad for building GYTxBodys out of one or more GYTxSkeletons.

Peculiarly, this is parameterized on:

  • An "own utxo update" function, this is meant to govern how the set of known "own utxos" is updated after building a transaction skeleton.

If the user chooses not to update this set, based on the newly created GYTxBody, the same own utxos set will be used for the next transaction in the list (if any). Which may lead to the balancer choosing the same utxo inputs again - resulting in a transaction conflict.

The function recovers successfully built tx skeletons, in case the list contains several of them. See: GYTxBuildResult.