atlas-0.1.0.0: Application backend for Plutus smart contracts on Cardano
Copyright(c) 2023 GYELD GMBH
LicenseApache 2.0
Maintainersupport@geniusyield.co
Stabilitydevelop
Safe HaskellNone
LanguageHaskell2010

GeniusYield.TxBuilder.Common

Description

 
Synopsis

Documentation

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.

Constructors

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_.

GYTxBuildNoInputs

Input did not contain any GYTxSkeletons.

buildTxCore ∷ ∀ m f v. (GYTxQueryMonad m, MonadRandom m, Traversable f) ⇒ SystemStart → EraHistory CardanoMode → ProtocolParameters → Set PoolId → GYCoinSelectionStrategy → (GYTxBodyGYUTxOsGYUTxOs) → [GYAddress] → GYAddressGYTxOutRef → 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.