Copyright | (c) 2023 GYELD GMBH |
---|---|
License | Apache 2.0 |
Maintainer | [email protected] |
Stability | develop |
Safe Haskell | Safe-Inferred |
Language | GHC2021 |
Synopsis
- data GYTxSkeleton (v ∷ PlutusVersion) = GYTxSkeleton {
- gytxIns ∷ ![GYTxIn v]
- gytxOuts ∷ ![GYTxOut v]
- gytxRefIns ∷ !(GYTxSkeletonRefIns v)
- gytxMint ∷ !(Map (GYMintScript v) (Map GYTokenName Integer, GYRedeemer))
- gytxWdrls ∷ ![GYTxWdrl v]
- gytxSigs ∷ !(Set GYPubKeyHash)
- gytxCerts ∷ ![GYTxCert v]
- gytxInvalidBefore ∷ !(Maybe GYSlot)
- gytxInvalidAfter ∷ !(Maybe GYSlot)
- gytxMetadata ∷ !(Maybe GYTxMetadata)
- data GYTxSkeletonRefIns ∷ PlutusVersion → Type where
- emptyGYTxSkeleton ∷ GYTxSkeleton v
- gyTxSkeletonRefInsToList ∷ GYTxSkeletonRefIns v → [GYTxOutRef]
- gyTxSkeletonRefInsSet ∷ GYTxSkeletonRefIns v → Set GYTxOutRef
- data GYTxBuildResult
- buildTxCore ∷ ∀ m v. (GYTxQueryMonad m, MonadRandom m) ⇒ SystemStart → EraHistory → ApiProtocolParameters → Set PoolId → GYCoinSelectionStrategy → (GYTxBody → GYUTxOs → GYUTxOs) → [GYAddress] → GYAddress → Maybe GYUTxO → [GYTxSkeleton v] → m (Either GYBuildTxError GYTxBuildResult)
- collateralLovelace ∷ Integer
- collateralValue ∷ GYValue
- maximumRequiredCollateralLovelace ∷ ApiProtocolParameters → Int → Integer
- maximumRequiredCollateralValue ∷ ApiProtocolParameters → Int → GYValue
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.
GYTxSkeleton | |
|
Instances
Monoid (GYTxSkeleton v) # | |
Defined in GeniusYield.TxBuilder.Common mempty ∷ GYTxSkeleton v # mappend ∷ GYTxSkeleton v → GYTxSkeleton v → GYTxSkeleton v # mconcat ∷ [GYTxSkeleton v] → GYTxSkeleton v # | |
Semigroup (GYTxSkeleton v) # | |
Defined in GeniusYield.TxBuilder.Common (<>) ∷ GYTxSkeleton v → GYTxSkeleton v → GYTxSkeleton v # sconcat ∷ NonEmpty (GYTxSkeleton v) → GYTxSkeleton v # stimes ∷ Integral b ⇒ b → GYTxSkeleton v → GYTxSkeleton v # | |
Show (GYTxSkeleton v) # | |
Defined in GeniusYield.TxBuilder.Common showsPrec ∷ Int → GYTxSkeleton v → ShowS # show ∷ GYTxSkeleton v → String # showList ∷ [GYTxSkeleton v] → ShowS # |
data GYTxSkeletonRefIns ∷ PlutusVersion → Type where #
GYTxSkeletonRefIns ∷ VersionIsGreaterOrEqual v 'PlutusV2 ⇒ !(Set GYTxOutRef) → GYTxSkeletonRefIns v | |
GYTxSkeletonNoRefIns ∷ GYTxSkeletonRefIns v |
Instances
Semigroup (GYTxSkeletonRefIns v) # | |
Defined in GeniusYield.TxBuilder.Common (<>) ∷ GYTxSkeletonRefIns v → GYTxSkeletonRefIns v → GYTxSkeletonRefIns v # sconcat ∷ NonEmpty (GYTxSkeletonRefIns v) → GYTxSkeletonRefIns v # stimes ∷ Integral b ⇒ b → GYTxSkeletonRefIns v → GYTxSkeletonRefIns v # | |
Show (GYTxSkeletonRefIns v) # | |
Defined in GeniusYield.TxBuilder.Common showsPrec ∷ Int → GYTxSkeletonRefIns v → ShowS # show ∷ GYTxSkeletonRefIns v → String # showList ∷ [GYTxSkeletonRefIns v] → ShowS # | |
Eq (GYTxSkeletonRefIns v) # | |
Defined in GeniusYield.TxBuilder.Common (==) ∷ GYTxSkeletonRefIns v → GYTxSkeletonRefIns v → Bool # (/=) ∷ GYTxSkeletonRefIns v → GYTxSkeletonRefIns v → Bool # |
data GYTxBuildResult #
Result of building GYTxBody
s with the option of recovery from error.
Consider the act of building five GYTxSkeleton
s into GYTxBody
s. 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 GYTxBody) | All given |
GYTxBuildPartialSuccess !GYBalancingError !(NonEmpty GYTxBody) | Some of the given |
GYTxBuildFailure !GYBalancingError | None of the given |
GYTxBuildNoInputs | Input did not contain any |
∷ ∀ m v. (GYTxQueryMonad m, MonadRandom m) | |
⇒ SystemStart | |
→ EraHistory | |
→ ApiProtocolParameters | |
→ Set PoolId | |
→ GYCoinSelectionStrategy | |
→ (GYTxBody → GYUTxOs → GYUTxOs) | |
→ [GYAddress] | |
→ GYAddress | |
→ Maybe GYUTxO | Is |
→ [GYTxSkeleton v] | |
→ m (Either GYBuildTxError GYTxBuildResult) |
The core implementation of GYTxQueryMonad
for building GYTxBody
s out of one or more GYTxSkeleton
s.
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
.
maximumRequiredCollateralLovelace ∷ ApiProtocolParameters → Int → Integer #
What is the maximum possible collateral requirement as per current protocol parameters?