atlas-cardano-0.4.0: Application backend for Plutus smart contracts on Cardano
Copyright(c) 2023 GYELD GMBH
LicenseApache 2.0
Maintainer[email protected]
Stabilitydevelop
Safe HaskellSafe-Inferred
LanguageGHC2021

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 !BalancingError !(NonEmpty (f GYTxBody))

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

GYTxBuildFailure !BalancingError

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

GYTxBuildNoInputs

Input did not contain any GYTxSkeletons.

buildTxCore #

Arguments

∷ ∀ m f v. (GYTxQueryMonad m, MonadRandom m, Traversable f) 
SystemStart 
EraHistory CardanoMode 
BundledProtocolParameters BabbageEra 
Set PoolId 
GYCoinSelectionStrategy 
→ (GYTxBodyGYUTxOsGYUTxOs) 
→ [GYAddress] 
GYAddress 
Maybe GYUTxO

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.

maximumRequiredCollateralLovelaceProtocolParametersInteger #

What is the maximum possible collateral requirement as per current protocol parameters?