atlas-cardano-0.6.2: 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 GYTxSkeleton (v ∷ PlutusVersion) #

Transaction skeleton

Note: let's add fields as we need them.

The parameter v indicates the minimum version of scripts allowed as inputs.

Instances

Instances details
Monoid (GYTxSkeleton v) # 
Instance details

Defined in GeniusYield.TxBuilder.Common

Semigroup (GYTxSkeleton v) # 
Instance details

Defined in GeniusYield.TxBuilder.Common

Show (GYTxSkeleton v) # 
Instance details

Defined in GeniusYield.TxBuilder.Common

Methods

showsPrecIntGYTxSkeleton v → ShowS #

showGYTxSkeleton v → String #

showList ∷ [GYTxSkeleton v] → ShowS #

data GYTxBuildResult #

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 GYTxBody)

All given GYTxSkeletons were successfully built.

GYTxBuildPartialSuccess !GYBalancingError !(NonEmpty GYTxBody)

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

GYTxBuildFailure !GYBalancingError

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

GYTxBuildNoInputs

Input did not contain any GYTxSkeletons.

buildTxCore #

Arguments

∷ ∀ m v. (GYTxQueryMonad m, MonadRandom m) 
SystemStart 
EraHistory 
ApiProtocolParameters 
Set PoolId 
GYCoinSelectionStrategy 
→ (GYTxBodyGYUTxOsGYUTxOs) 
→ [GYAddress] 
GYAddress 
Maybe GYUTxO

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

→ [GYTxSkeleton v] 
→ m (Either GYBuildTxError GYTxBuildResult) 

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.

maximumRequiredCollateralLovelaceApiProtocolParametersIntInteger #

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