| Copyright | (c) 2023 GYELD GMBH |
|---|---|
| License | Apache 2.0 |
| Maintainer | [email protected] |
| Stability | develop |
| Safe Haskell | None |
| Language | GHC2021 |
GeniusYield.TxBuilder.Common
Description
Synopsis
- data GYTxSkeleton (v :: PlutusVersion) = GYTxSkeleton {
- gytxIns :: ![GYTxIn v]
- gytxOuts :: ![GYTxOut v]
- gytxRefIns :: !(GYTxSkeletonRefIns v)
- gytxMint :: !(Map (GYBuildScript v) (Map GYTokenName Integer, GYRedeemer))
- gytxWdrls :: ![GYTxWdrl v]
- gytxSigs :: !(Set GYPubKeyHash)
- gytxCerts :: ![GYTxCert v]
- gytxInvalidBefore :: !(Maybe GYSlot)
- gytxInvalidAfter :: !(Maybe GYSlot)
- gytxMetadata :: !(Maybe GYTxMetadata)
- gytxVotingProcedures :: !(GYTxSkeletonVotingProcedures v)
- gytxProposalProcedures :: !(GYTxSkeletonProposalProcedures v)
- gytxDonation :: !(GYTxSkeletonDonation v)
- data GYTxSkeletonRefIns (a :: PlutusVersion) where
- GYTxSkeletonRefIns :: forall (a :: PlutusVersion). !(Set GYTxOutRef) -> GYTxSkeletonRefIns a
- GYTxSkeletonNoRefIns :: forall (a :: PlutusVersion). GYTxSkeletonRefIns a
- data GYTxSkeletonVotingProcedures (a :: PlutusVersion) where
- GYTxSkeletonVotingProceduresNone :: forall (a :: PlutusVersion). GYTxSkeletonVotingProcedures a
- GYTxSkeletonVotingProcedures :: forall (a :: PlutusVersion). VersionIsGreaterOrEqual a 'PlutusV3 => !(GYTxVotingProcedures a) -> GYTxSkeletonVotingProcedures a
- data GYTxSkeletonProposalProcedures (a :: PlutusVersion) where
- GYTxSkeletonProposalProceduresNone :: forall (a :: PlutusVersion). GYTxSkeletonProposalProcedures a
- GYTxSkeletonProposalProcedures :: forall (a :: PlutusVersion). VersionIsGreaterOrEqual a 'PlutusV3 => ![(GYProposalProcedurePB, GYTxBuildWitness a)] -> GYTxSkeletonProposalProcedures a
- data GYTxSkeletonDonation (a :: PlutusVersion) where
- GYTxSkeletonDonationNone :: forall (a :: PlutusVersion). GYTxSkeletonDonation a
- GYTxSkeletonDonation :: forall (a :: PlutusVersion). VersionIsGreaterOrEqual a 'PlutusV3 => !Natural -> GYTxSkeletonDonation a
- emptyGYTxSkeleton :: forall (v :: PlutusVersion). GYTxSkeleton v
- gyTxSkeletonRefInsToList :: forall (v :: PlutusVersion). GYTxSkeletonRefIns v -> [GYTxOutRef]
- gyTxSkeletonRefInsSet :: forall (v :: PlutusVersion). GYTxSkeletonRefIns v -> Set GYTxOutRef
- data GYTxBuildResult
- buildTxCore :: forall m (v :: PlutusVersion). (GYTxQueryMonad m, MonadRandom m) => SystemStart -> EraHistory -> ApiProtocolParameters -> Set PoolId -> GYCoinSelectionStrategy -> (GYTxBody -> GYUTxOs -> GYUTxOs) -> [GYAddress] -> GYAddress -> Maybe GYUTxO -> GYTxExtraConfiguration v -> [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.
Constructors
| GYTxSkeleton | |
Fields
| |
Instances
| Monoid (GYTxSkeleton v) # | |
Defined in GeniusYield.TxBuilder.Common Methods mempty :: GYTxSkeleton v # mappend :: GYTxSkeleton v -> GYTxSkeleton v -> GYTxSkeleton v # mconcat :: [GYTxSkeleton v] -> GYTxSkeleton v # | |
| Semigroup (GYTxSkeleton v) # | |
Defined in GeniusYield.TxBuilder.Common Methods (<>) :: 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 Methods showsPrec :: Int -> GYTxSkeleton v -> ShowS # show :: GYTxSkeleton v -> String # showList :: [GYTxSkeleton v] -> ShowS # | |
data GYTxSkeletonRefIns (a :: PlutusVersion) where #
Constructors
| GYTxSkeletonRefIns :: forall (a :: PlutusVersion). !(Set GYTxOutRef) -> GYTxSkeletonRefIns a | |
| GYTxSkeletonNoRefIns :: forall (a :: PlutusVersion). GYTxSkeletonRefIns a |
Instances
| Semigroup (GYTxSkeletonRefIns v) # | |
Defined in GeniusYield.TxBuilder.Common Methods (<>) :: 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 Methods showsPrec :: Int -> GYTxSkeletonRefIns v -> ShowS # show :: GYTxSkeletonRefIns v -> String # showList :: [GYTxSkeletonRefIns v] -> ShowS # | |
| Eq (GYTxSkeletonRefIns v) # | |
Defined in GeniusYield.TxBuilder.Common Methods (==) :: GYTxSkeletonRefIns v -> GYTxSkeletonRefIns v -> Bool # (/=) :: GYTxSkeletonRefIns v -> GYTxSkeletonRefIns v -> Bool # | |
data GYTxSkeletonVotingProcedures (a :: PlutusVersion) where #
Constructors
| GYTxSkeletonVotingProceduresNone :: forall (a :: PlutusVersion). GYTxSkeletonVotingProcedures a | |
| GYTxSkeletonVotingProcedures :: forall (a :: PlutusVersion). VersionIsGreaterOrEqual a 'PlutusV3 => !(GYTxVotingProcedures a) -> GYTxSkeletonVotingProcedures a |
Instances
| Semigroup (GYTxSkeletonVotingProcedures v) # | |
Defined in GeniusYield.TxBuilder.Common Methods (<>) :: GYTxSkeletonVotingProcedures v -> GYTxSkeletonVotingProcedures v -> GYTxSkeletonVotingProcedures v # sconcat :: NonEmpty (GYTxSkeletonVotingProcedures v) -> GYTxSkeletonVotingProcedures v # stimes :: Integral b => b -> GYTxSkeletonVotingProcedures v -> GYTxSkeletonVotingProcedures v # | |
| Show (GYTxSkeletonVotingProcedures v) # | |
Defined in GeniusYield.TxBuilder.Common Methods showsPrec :: Int -> GYTxSkeletonVotingProcedures v -> ShowS # show :: GYTxSkeletonVotingProcedures v -> String # showList :: [GYTxSkeletonVotingProcedures v] -> ShowS # | |
| Eq (GYTxSkeletonVotingProcedures v) # | |
Defined in GeniusYield.TxBuilder.Common Methods (==) :: GYTxSkeletonVotingProcedures v -> GYTxSkeletonVotingProcedures v -> Bool # (/=) :: GYTxSkeletonVotingProcedures v -> GYTxSkeletonVotingProcedures v -> Bool # | |
data GYTxSkeletonProposalProcedures (a :: PlutusVersion) where #
Constructors
| GYTxSkeletonProposalProceduresNone :: forall (a :: PlutusVersion). GYTxSkeletonProposalProcedures a | |
| GYTxSkeletonProposalProcedures :: forall (a :: PlutusVersion). VersionIsGreaterOrEqual a 'PlutusV3 => ![(GYProposalProcedurePB, GYTxBuildWitness a)] -> GYTxSkeletonProposalProcedures a |
Instances
| Semigroup (GYTxSkeletonProposalProcedures v) # | |
Defined in GeniusYield.TxBuilder.Common Methods (<>) :: GYTxSkeletonProposalProcedures v -> GYTxSkeletonProposalProcedures v -> GYTxSkeletonProposalProcedures v # sconcat :: NonEmpty (GYTxSkeletonProposalProcedures v) -> GYTxSkeletonProposalProcedures v # stimes :: Integral b => b -> GYTxSkeletonProposalProcedures v -> GYTxSkeletonProposalProcedures v # | |
| Show (GYTxSkeletonProposalProcedures v) # | |
Defined in GeniusYield.TxBuilder.Common Methods showsPrec :: Int -> GYTxSkeletonProposalProcedures v -> ShowS # show :: GYTxSkeletonProposalProcedures v -> String # showList :: [GYTxSkeletonProposalProcedures v] -> ShowS # | |
| Eq (GYTxSkeletonProposalProcedures v) # | |
Defined in GeniusYield.TxBuilder.Common Methods (==) :: GYTxSkeletonProposalProcedures v -> GYTxSkeletonProposalProcedures v -> Bool # (/=) :: GYTxSkeletonProposalProcedures v -> GYTxSkeletonProposalProcedures v -> Bool # | |
data GYTxSkeletonDonation (a :: PlutusVersion) where #
Constructors
| GYTxSkeletonDonationNone :: forall (a :: PlutusVersion). GYTxSkeletonDonation a | |
| GYTxSkeletonDonation :: forall (a :: PlutusVersion). VersionIsGreaterOrEqual a 'PlutusV3 => !Natural -> GYTxSkeletonDonation a |
Instances
| Semigroup (GYTxSkeletonDonation v) # | |
Defined in GeniusYield.TxBuilder.Common Methods (<>) :: GYTxSkeletonDonation v -> GYTxSkeletonDonation v -> GYTxSkeletonDonation v # sconcat :: NonEmpty (GYTxSkeletonDonation v) -> GYTxSkeletonDonation v # stimes :: Integral b => b -> GYTxSkeletonDonation v -> GYTxSkeletonDonation v # | |
| Show (GYTxSkeletonDonation v) # | |
Defined in GeniusYield.TxBuilder.Common Methods showsPrec :: Int -> GYTxSkeletonDonation v -> ShowS # show :: GYTxSkeletonDonation v -> String # showList :: [GYTxSkeletonDonation v] -> ShowS # | |
| Eq (GYTxSkeletonDonation v) # | |
Defined in GeniusYield.TxBuilder.Common Methods (==) :: GYTxSkeletonDonation v -> GYTxSkeletonDonation v -> Bool # (/=) :: GYTxSkeletonDonation v -> GYTxSkeletonDonation v -> Bool # | |
emptyGYTxSkeleton :: forall (v :: PlutusVersion). GYTxSkeleton v #
gyTxSkeletonRefInsToList :: forall (v :: PlutusVersion). GYTxSkeletonRefIns v -> [GYTxOutRef] #
gyTxSkeletonRefInsSet :: forall (v :: PlutusVersion). GYTxSkeletonRefIns v -> Set GYTxOutRef #
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 |
| GYTxBuildPartialSuccess !GYBalancingError !(NonEmpty GYTxBody) | Some of the given |
| GYTxBuildFailure !GYBalancingError | None of the given |
| GYTxBuildNoInputs | Input did not contain any |
Arguments
| :: forall m (v :: PlutusVersion). (GYTxQueryMonad m, MonadRandom m) | |
| => SystemStart | |
| -> EraHistory | |
| -> ApiProtocolParameters | |
| -> Set PoolId | |
| -> GYCoinSelectionStrategy | |
| -> (GYTxBody -> GYUTxOs -> GYUTxOs) | |
| -> [GYAddress] | |
| -> GYAddress | |
| -> Maybe GYUTxO | Is |
| -> GYTxExtraConfiguration v | |
| -> [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.
maximumRequiredCollateralLovelace :: ApiProtocolParameters -> Int -> Integer #
What is the maximum possible collateral requirement as per current protocol parameters?